socsvn commit: r269000 - soc2014/op/freebsd-base/sys/amd64/amd64

op at FreeBSD.org op at FreeBSD.org
Tue Jun 3 09:40:31 UTC 2014


Author: op
Date: Tue Jun  3 09:40:30 2014
New Revision: 269000
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=269000

Log:
  SMAP AMD64: postpone enabling of SMAP, same like in SMEP case
  
  git: https://github.com/opntr/opBSD/commits/op/gsoc2014/smap
  
  Signed-off-by: Oliver Pinter <oliver.pntr at gmail.com>
  
  

Modified:
  soc2014/op/freebsd-base/sys/amd64/amd64/initcpu.c

Modified: soc2014/op/freebsd-base/sys/amd64/amd64/initcpu.c
==============================================================================
--- soc2014/op/freebsd-base/sys/amd64/amd64/initcpu.c	Tue Jun  3 09:39:51 2014	(r268999)
+++ soc2014/op/freebsd-base/sys/amd64/amd64/initcpu.c	Tue Jun  3 09:40:30 2014	(r269000)
@@ -168,13 +168,15 @@
 		cr4 |= CR4_FSGSBASE;
 
 	/*
-	 * Postpone enabling the SMEP on the boot CPU until the page
-	 * tables are switched from the boot loader identity mapping
+	 * Postpone enabling the SMEP and SMAP on the boot CPU until the
+	 * page tables are switched from the boot loader identity mapping
 	 * to the kernel tables.  The boot loader enables the U bit in
 	 * its tables.
 	 */
 	if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP))
 		cr4 |= CR4_SMEP;
+	if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMAP))
+		cr4 |= CR4_SMAP;
 	load_cr4(cr4);
 	if ((amd_feature & AMDID_NX) != 0) {
 		msr = rdmsr(MSR_EFER) | EFER_NXE;


More information about the svn-soc-all mailing list