aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/relocate_kernel_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/relocate_kernel_64.S')
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S24
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index d32cfb27a479..cfc0d24003dc 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -24,7 +24,8 @@
24 .code64 24 .code64
25 .globl relocate_kernel 25 .globl relocate_kernel
26relocate_kernel: 26relocate_kernel:
27 /* %rdi indirection_page 27 /*
28 * %rdi indirection_page
28 * %rsi page_list 29 * %rsi page_list
29 * %rdx start address 30 * %rdx start address
30 */ 31 */
@@ -33,8 +34,10 @@ relocate_kernel:
33 pushq $0 34 pushq $0
34 popfq 35 popfq
35 36
36 /* get physical address of control page now */ 37 /*
37 /* this is impossible after page table switch */ 38 * get physical address of control page now
39 * this is impossible after page table switch
40 */
38 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8 41 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8
39 42
40 /* get physical address of page table now too */ 43 /* get physical address of page table now too */
@@ -55,7 +58,8 @@ identity_mapped:
55 /* store the start address on the stack */ 58 /* store the start address on the stack */
56 pushq %rdx 59 pushq %rdx
57 60
58 /* Set cr0 to a known state: 61 /*
62 * Set cr0 to a known state:
59 * - Paging enabled 63 * - Paging enabled
60 * - Alignment check disabled 64 * - Alignment check disabled
61 * - Write protect disabled 65 * - Write protect disabled
@@ -68,7 +72,8 @@ identity_mapped:
68 orl $(X86_CR0_PG | X86_CR0_PE), %eax 72 orl $(X86_CR0_PG | X86_CR0_PE), %eax
69 movq %rax, %cr0 73 movq %rax, %cr0
70 74
71 /* Set cr4 to a known state: 75 /*
76 * Set cr4 to a known state:
72 * - physical address extension enabled 77 * - physical address extension enabled
73 */ 78 */
74 movq $X86_CR4_PAE, %rax 79 movq $X86_CR4_PAE, %rax
@@ -117,7 +122,8 @@ identity_mapped:
117 jmp 0b 122 jmp 0b
1183: 1233:
119 124
120 /* To be certain of avoiding problems with self-modifying code 125 /*
126 * To be certain of avoiding problems with self-modifying code
121 * I need to execute a serializing instruction here. 127 * I need to execute a serializing instruction here.
122 * So I flush the TLB by reloading %cr3 here, it's handy, 128 * So I flush the TLB by reloading %cr3 here, it's handy,
123 * and not processor dependent. 129 * and not processor dependent.
@@ -125,8 +131,10 @@ identity_mapped:
125 movq %cr3, %rax 131 movq %cr3, %rax
126 movq %rax, %cr3 132 movq %rax, %cr3
127 133
128 /* set all of the registers to known values */ 134 /*
129 /* leave %rsp alone */ 135 * set all of the registers to known values
136 * leave %rsp alone
137 */
130 138
131 xorq %rax, %rax 139 xorq %rax, %rax
132 xorq %rbx, %rbx 140 xorq %rbx, %rbx