From 032fc3b190351a31f7f82c634c3b80651c412a7f Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Wed, 11 Feb 2015 15:46:30 +0100 Subject: [PATCH] hw_x86_64: Enable IA-32e mode and execute-disable Set bits 8 (LME) and 11 (NXE) in the IA32_EFER MSR to enable IA-32e mode and execute-disable. --- repos/base-hw/src/core/spec/x86_64/kernel/crt0.s | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s index cfefe4e19..864754984 100644 --- a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s +++ b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s @@ -38,6 +38,13 @@ leal _kernel_pml4, %eax mov %eax, %cr3 + /* Enable IA-32e mode and execute-disable */ + movl $0xc0000080, %ecx + rdmsr + btsl $8, %eax + btsl $11, %eax + wrmsr + /* * Install initial temporary environment that is replaced later by the * environment that init_main_thread creates.