diff options
Diffstat (limited to 'arch/x86/kernel/trampoline_64.S')
-rw-r--r-- | arch/x86/kernel/trampoline_64.S | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S index 894293c598db..cddfb8d386b9 100644 --- a/arch/x86/kernel/trampoline_64.S +++ b/arch/x86/kernel/trampoline_64.S | |||
@@ -25,10 +25,11 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <linux/linkage.h> | 27 | #include <linux/linkage.h> |
28 | #include <asm/pgtable.h> | 28 | #include <asm/pgtable_types.h> |
29 | #include <asm/page.h> | 29 | #include <asm/page_types.h> |
30 | #include <asm/msr.h> | 30 | #include <asm/msr.h> |
31 | #include <asm/segment.h> | 31 | #include <asm/segment.h> |
32 | #include <asm/processor-flags.h> | ||
32 | 33 | ||
33 | .section .rodata, "a", @progbits | 34 | .section .rodata, "a", @progbits |
34 | 35 | ||
@@ -37,7 +38,7 @@ | |||
37 | ENTRY(trampoline_data) | 38 | ENTRY(trampoline_data) |
38 | r_base = . | 39 | r_base = . |
39 | cli # We should be safe anyway | 40 | cli # We should be safe anyway |
40 | wbinvd | 41 | wbinvd |
41 | mov %cs, %ax # Code and data in the same place | 42 | mov %cs, %ax # Code and data in the same place |
42 | mov %ax, %ds | 43 | mov %ax, %ds |
43 | mov %ax, %es | 44 | mov %ax, %es |
@@ -73,9 +74,8 @@ r_base = . | |||
73 | lidtl tidt - r_base # load idt with 0, 0 | 74 | lidtl tidt - r_base # load idt with 0, 0 |
74 | lgdtl tgdt - r_base # load gdt with whatever is appropriate | 75 | lgdtl tgdt - r_base # load gdt with whatever is appropriate |
75 | 76 | ||
76 | xor %ax, %ax | 77 | mov $X86_CR0_PE, %ax # protected mode (PE) bit |
77 | inc %ax # protected mode (PE) bit | 78 | lmsw %ax # into protected mode |
78 | lmsw %ax # into protected mode | ||
79 | 79 | ||
80 | # flush prefetch and jump to startup_32 | 80 | # flush prefetch and jump to startup_32 |
81 | ljmpl *(startup_32_vector - r_base) | 81 | ljmpl *(startup_32_vector - r_base) |
@@ -86,9 +86,8 @@ startup_32: | |||
86 | movl $__KERNEL_DS, %eax # Initialize the %ds segment register | 86 | movl $__KERNEL_DS, %eax # Initialize the %ds segment register |
87 | movl %eax, %ds | 87 | movl %eax, %ds |
88 | 88 | ||
89 | xorl %eax, %eax | 89 | movl $X86_CR4_PAE, %eax |
90 | btsl $5, %eax # Enable PAE mode | 90 | movl %eax, %cr4 # Enable PAE mode |
91 | movl %eax, %cr4 | ||
92 | 91 | ||
93 | # Setup trampoline 4 level pagetables | 92 | # Setup trampoline 4 level pagetables |
94 | leal (trampoline_level4_pgt - r_base)(%esi), %eax | 93 | leal (trampoline_level4_pgt - r_base)(%esi), %eax |
@@ -99,9 +98,9 @@ startup_32: | |||
99 | xorl %edx, %edx | 98 | xorl %edx, %edx |
100 | wrmsr | 99 | wrmsr |
101 | 100 | ||
102 | xorl %eax, %eax | 101 | # Enable paging and in turn activate Long Mode |
103 | btsl $31, %eax # Enable paging and in turn activate Long Mode | 102 | # Enable protected mode |
104 | btsl $0, %eax # Enable protected mode | 103 | movl $(X86_CR0_PG | X86_CR0_PE), %eax |
105 | movl %eax, %cr0 | 104 | movl %eax, %cr0 |
106 | 105 | ||
107 | /* | 106 | /* |