File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,16 @@ SYM_DATA(kexec_pa_table_page, .quad 0)
40
40
SYM_DATA(kexec_pa_swap_page, .quad 0 )
41
41
SYM_DATA_LOCAL (pa_backup_pages_map, .quad 0 )
42
42
43
+ .balign 16
44
+ SYM_DATA_START_LOCAL (kexec_debug_gdt)
45
+ .word kexec_debug_gdt_end - kexec_debug_gdt - 1
46
+ .long 0
47
+ .word 0
48
+ .quad 0x00cf9a000000ffff /* __KERNEL32_CS */
49
+ .quad 0x00af9a000000ffff /* __KERNEL_CS */
50
+ .quad 0x00cf92000000ffff /* __KERNEL_DS */
51
+ SYM_DATA_END_LABEL(kexec_debug_gdt, SYM_L_LOCAL , kexec_debug_gdt_end)
52
+
43
53
.section .text ..relocate_kernel,"ax" ;
44
54
.code64
45
55
SYM_CODE_START_NOALIGN(relocate_kernel)
@@ -116,6 +126,19 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
116
126
/* store the start address on the stack */
117
127
pushq %rdx
118
128
129
+ /* Create a GDTR (16 bits limit, 64 bits addr) on stack */
130
+ leaq kexec_debug_gdt(%rip ), %rax
131
+ pushq %rax
132
+ pushw (%rax )
133
+
134
+ /* Load the GDT, put the stack back */
135
+ lgdt (%rsp )
136
+ addq $10 , %rsp
137
+
138
+ /* Test that we can load segments */
139
+ movq %ds , %rax
140
+ movq %rax , %ds
141
+
119
142
/*
120
143
* Clear X86_CR4_CET (if it was set) such that we can clear CR0_WP
121
144
* below.
You can’t perform that action at this time.
0 commit comments