Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jun 2014 09:40:30 GMT
From:      op@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r269000 - soc2014/op/freebsd-base/sys/amd64/amd64
Message-ID:  <201406030940.s539eUYM075126@socsvn.freebsd.org>

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



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