aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2007-04-12 11:05:24 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2007-04-12 11:05:24 +0000
commitf76f6cfd25da6f568ab0d8063a566db727c6a1fc (patch)
tree36ff6951e8c238426e379437426aeab248d363b0
parentd62f5d4e5cd7f5aea196e45c253deab5605cc5a1 (diff)
Notes
-rw-r--r--sys/i386/i386/mp_machdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 7fa94581c716..15377bc363dd 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -577,6 +577,16 @@ init_secondary(void)
/* set up SSE registers */
enable_sse();
+#ifdef PAE
+ /* Enable the PTE no-execute bit. */
+ if ((amd_feature & AMDID_NX) != 0) {
+ uint64_t msr;
+
+ msr = rdmsr(MSR_EFER) | EFER_NXE;
+ wrmsr(MSR_EFER, msr);
+ }
+#endif
+
/* A quick check from sanity claus */
if (PCPU_GET(apic_id) != lapic_id()) {
printf("SMP: cpuid = %d\n", PCPU_GET(cpuid));