Author: kib
Date: Tue Sep 25 18:24:25 2018
New Revision: 338928
URL: https://svnweb.freebsd.org/changeset/base/338928

Log:
  Fix an issue in r338862.
  
  For pmap_invalidate_all_pcid(), only reset pm_gen for non-kernel
  pmaps, as it was done before the conversion to ifuncs.  The reset is
  useless but innocent for kernel_pmap. Coverity reported that cpuid is
  used uninitialized in this case.
  
  Reported by:  cem
  Reviewed by:  alc, cem, markj
  CID:   1395807
  Sponsored by: The FreeBSD Foundation
  Approved by:  re (gjb)
  Differential revision:        https://reviews.freebsd.org/D17314

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Tue Sep 25 17:58:06 2018        (r338927)
+++ head/sys/amd64/amd64/pmap.c Tue Sep 25 18:24:25 2018        (r338928)
@@ -1966,10 +1966,10 @@ pmap_invalidate_all_pcid(pmap_t pmap, bool invpcid_wor
                        critical_exit();
                } else
                        pmap->pm_pcids[cpuid].pm_gen = 0;
-       }
-       CPU_FOREACH(i) {
-               if (cpuid != i)
-                       pmap->pm_pcids[i].pm_gen = 0;
+               CPU_FOREACH(i) {
+                       if (cpuid != i)
+                               pmap->pm_pcids[i].pm_gen = 0;
+               }
        }
        /* See the comment in pmap_invalidate_page_pcid(). */
        atomic_thread_fence_seq_cst();
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to