diff options
author | Jarkko Sakkinen <jarkko.sakkinen@intel.com> | 2012-05-08 21:22:46 +0300 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-08 15:04:27 -0700 |
commit | cda846f101fb1396b6924f1d9b68ac3d42de5403 (patch) | |
tree | 1fa8716c308b8e10156a1caf51d8ff6c98eceea9 /arch/x86/kernel/realmode.c | |
parent | bf8b88e97716feb750c3d34492f00d9c085e1183 (diff) | |
download | op-kernel-dev-cda846f101fb1396b6924f1d9b68ac3d42de5403.zip op-kernel-dev-cda846f101fb1396b6924f1d9b68ac3d42de5403.tar.gz |
x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
This patch changes 64-bit trampoline so that CR4 and
EFER are provided by the kernel instead of using fixed
values.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Link: http://lkml.kernel.org/r/1336501366-28617-24-git-send-email-jarkko.sakkinen@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/realmode.c')
-rw-r--r-- | arch/x86/kernel/realmode.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kernel/realmode.c b/arch/x86/kernel/realmode.c index 712fba8..66ac276 100644 --- a/arch/x86/kernel/realmode.c +++ b/arch/x86/kernel/realmode.c @@ -6,6 +6,7 @@ #include <asm/realmode.h> struct real_mode_header *real_mode_header; +u32 *trampoline_cr4_features; void __init setup_real_mode(void) { @@ -64,7 +65,14 @@ void __init setup_real_mode(void) trampoline_header->gdt_limit = __BOOT_DS + 7; trampoline_header->gdt_base = __pa(boot_gdt); #else + if (rdmsr_safe(MSR_EFER, &trampoline_header->efer_low, + &trampoline_header->efer_high)) + BUG(); + trampoline_header->start = (u64) secondary_startup_64; + trampoline_cr4_features = &trampoline_header->cr4; + *trampoline_cr4_features = read_cr4(); + trampoline_pgd = (u64 *) __va(real_mode_header->trampoline_pgd); trampoline_pgd[0] = __pa(level3_ident_pgt) + _KERNPG_TABLE; trampoline_pgd[511] = __pa(level3_kernel_pgt) + _KERNPG_TABLE; |