diff options
author | Jarkko Sakkinen <jarkko.sakkinen@intel.com> | 2012-05-08 22:22:46 +0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-09 02:04:27 +0400 |
commit | cda846f101fb1396b6924f1d9b68ac3d42de5403 (patch) | |
tree | 1fa8716c308b8e10156a1caf51d8ff6c98eceea9 /arch/x86/realmode/rm/trampoline_common.S | |
parent | bf8b88e97716feb750c3d34492f00d9c085e1183 (diff) | |
download | linux-cda846f101fb1396b6924f1d9b68ac3d42de5403.tar.xz |
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/realmode/rm/trampoline_common.S')
-rw-r--r-- | arch/x86/realmode/rm/trampoline_common.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/realmode/rm/trampoline_common.S b/arch/x86/realmode/rm/trampoline_common.S index c3f951c468c5..cac444b942f8 100644 --- a/arch/x86/realmode/rm/trampoline_common.S +++ b/arch/x86/realmode/rm/trampoline_common.S @@ -1,5 +1,20 @@ .section ".rodata","a" +#ifdef CONFIG_X86_64 + # Duplicate the global descriptor table + # so the kernel can live anywhere + .balign 16 + .globl tr_gdt +tr_gdt: + .short tr_gdt_end - tr_gdt - 1 # gdt limit + .long pa_tr_gdt + .short 0 + .quad 0x00cf9b000000ffff # __KERNEL32_CS + .quad 0x00af9b000000ffff # __KERNEL_CS + .quad 0x00cf93000000ffff # __KERNEL_DS +tr_gdt_end: +#endif + .balign 4 tr_idt: .fill 1, 6, 0 @@ -8,12 +23,16 @@ tr_idt: .fill 1, 6, 0 .balign 4 GLOBAL(trampoline_status) .space 4 + .balign 8 GLOBAL(trampoline_header) #ifdef CONFIG_X86_32 tr_start: .space 4 + tr_gdt_pad: .space 2 tr_gdt: .space 6 #else tr_start: .space 8 + GLOBAL(tr_cr4) .space 4 + GLOBAL(tr_efer) .space 8 #endif END(trampoline_header) |