x86/head/64: Codestyle fixes for loading startup GDT
PATCH 1/1 x86/head/64: Codestyle fixes for loading startup GDT
Wrap the GDT access in fixup_pointer to avoid having to rely on the compiler optimization passes to generate %rip relative access. This also brings it in line with the rest of the code that is executed before the virtual paging is loaded (e.g. __startup_64 and startup_64_load_idt).
Signed-off-by harm-smits <[email protected]>
--- arch/x86/kernel/head64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/head64.c +3 -2
@@ -613,8 +613,9 @@ void early_setup_idt(void) void __head startup_64_setup_env(unsigned long physbase) {/* Load GDT */ - startup_gdt_descr.address = (unsigned long )fixup_pointer (startup_gdt, physbase); -native_load_gdt (&startup_gdt_descr); +struct desc_ptr *desc =fixup_pointer (&startup_gdt_descr, physbase); + desc->address = (unsigned long )fixup_pointer (startup_gdt, physbase); +native_load_gdt (desc);/* New GDT is live - reload data segment registers */ asm volatile("movl %%eax, %%ds\n"
Signature · 1 line
2.25.1