Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2018 10:34:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r338521 - stable/11/sys/amd64/amd64
Message-ID:  <201809071034.w87AYSp3040350@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Sep  7 10:34:27 2018
New Revision: 338521
URL: https://svnweb.freebsd.org/changeset/base/338521

Log:
  MFC r338459:
  amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.

Modified:
  stable/11/sys/amd64/amd64/pmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/11/sys/amd64/amd64/pmap.c	Fri Sep  7 00:12:46 2018	(r338520)
+++ stable/11/sys/amd64/amd64/pmap.c	Fri Sep  7 10:34:27 2018	(r338521)
@@ -7526,9 +7526,13 @@ pmap_activate_boot(pmap_t pmap)
 	CPU_SET(cpuid, &pmap->pm_active);
 #endif
 	PCPU_SET(curpmap, pmap);
-	kcr3 = pmap->pm_cr3;
-	if (pmap_pcid_enabled)
-		kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE;
+	if (pti) {
+		kcr3 = pmap->pm_cr3;
+		if (pmap_pcid_enabled)
+			kcr3 |= pmap->pm_pcids[cpuid].pm_pcid | CR3_PCID_SAVE;
+	} else {
+		kcr3 = PMAP_NO_CR3;
+	}
 	PCPU_SET(kcr3, kcr3);
 	PCPU_SET(ucr3, PMAP_NO_CR3);
 }



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