Skip to content

Commit c253b64

Browse files
Brian GerstKAGA-KOKO
authored andcommitted
x86/smpboot: Remove early_gdt_descr on 64-bit
Build the GDT descriptor on the stack instead. Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Usama Arif <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Usama Arif <[email protected]> Tested-by: Guilherme G. Piccoli <[email protected]> Reviewed-by: David Woodhouse <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3adee77 commit c253b64

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

arch/x86/kernel/acpi/sleep.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ int x86_acpi_suspend_lowlevel(void)
127127
* value is in the actual %rsp register.
128128
*/
129129
current->thread.sp = (unsigned long)temp_stack + sizeof(temp_stack);
130-
early_gdt_descr.address =
131-
(unsigned long)get_cpu_gdt_rw(smp_processor_id());
132130
initial_gs = per_cpu_offset(smp_processor_id());
133131
smpboot_control = smp_processor_id();
134132
#endif

arch/x86/kernel/head_64.S

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL)
265265
* addresses where we're currently running on. We have to do that here
266266
* because in 32bit we couldn't load a 64bit linear address.
267267
*/
268-
lgdt early_gdt_descr(%rip)
268+
subq $16, %rsp
269+
movw $(GDT_SIZE-1), (%rsp)
270+
leaq gdt_page(%rdx), %rax
271+
movq %rax, 2(%rsp)
272+
lgdt (%rsp)
273+
addq $16, %rsp
269274

270275
/* set up data segments */
271276
xorl %eax,%eax
@@ -667,10 +672,6 @@ SYM_DATA_END(level1_fixmap_pgt)
667672
.data
668673
.align 16
669674

670-
SYM_DATA(early_gdt_descr, .word GDT_ENTRIES*8-1)
671-
SYM_DATA_LOCAL(early_gdt_descr_base, .quad INIT_PER_CPU_VAR(gdt_page))
672-
673-
.align 16
674675
SYM_DATA(smpboot_control, .long 0)
675676

676677
.align 16

arch/x86/kernel/smpboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,10 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle,
10861086
start_ip = real_mode_header->trampoline_start64;
10871087
#endif
10881088
idle->thread.sp = (unsigned long)task_pt_regs(idle);
1089-
early_gdt_descr.address = (unsigned long)get_cpu_gdt_rw(cpu);
10901089
initial_code = (unsigned long)start_secondary;
10911090

10921091
if (IS_ENABLED(CONFIG_X86_32)) {
1092+
early_gdt_descr.address = (unsigned long)get_cpu_gdt_rw(cpu);
10931093
initial_stack = idle->thread.sp;
10941094
} else {
10951095
smpboot_control = cpu;

0 commit comments

Comments
 (0)