Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2018 18:24:25 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338928 - head/sys/amd64/amd64
Message-ID:  <201809251824.w8PIOPPN090623@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809251824.w8PIOPPN090623>