From 4e8dee51e3f0a69f3a4171723fddbda5ecebe403 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 3 Mar 2019 17:58:54 +0100 Subject: arch/x86: Prepare GDT for x86_64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make GDT a separate table and don't reuse GDT descriptor as unused first field of GDT. Required for separate x86_64 GDT descriptor, pointing to the same GDT. Tested on qemu. Change-Id: I513329b67d49ade1055bc07cf7b93ff2e0131e0b Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/31769 Reviewed-by: Kyösti Mälkki Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/arch/x86/gdt_init.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/arch/x86/gdt_init.S') diff --git a/src/arch/x86/gdt_init.S b/src/arch/x86/gdt_init.S index 6aa2a79b48..f66cd4366b 100644 --- a/src/arch/x86/gdt_init.S +++ b/src/arch/x86/gdt_init.S @@ -21,11 +21,15 @@ gdt_init: .previous .align 4 .globl gdtptr -gdt: gdtptr: .word gdt_end - gdt -1 /* compute the table limit */ .long gdt /* we know the offset */ - .word 0 + + .align 4 +gdt: + /* selgdt 0, unused */ + .word 0x0000, 0x0000 /* dummy */ + .byte 0x00, 0x00, 0x00, 0x00 /* selgdt 0x08, flat code segment */ .word 0xffff, 0x0000 -- cgit v1.2.3