summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-03-15 14:25:38 +0000
committerTom Rini <[email protected]>2025-04-03 11:41:55 -0600
commitf5b1c643b41214b0c04db827c539a278aee76255 (patch)
treed8e8ba3a14079f8ffd37aab766266884ba706108
parentf5f1ed8ae7395dbffa611823457a3beeda462577 (diff)
x86: Use the same GDT when jumping to long mode
Make use the existing GDT which now includes entries for 64-bit code. Leave the interrupt descriptors alone. They can be tidied up once U-Boot starts up. With this, kvm mode works with QEMU. Signed-off-by: Simon Glass <[email protected]> Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/31
-rw-r--r--arch/x86/cpu/i386/call64.S14
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/x86/cpu/i386/call64.S b/arch/x86/cpu/i386/call64.S
index f979f9e5f0e..c722acbd310 100644
--- a/arch/x86/cpu/i386/call64.S
+++ b/arch/x86/cpu/i386/call64.S
@@ -7,6 +7,7 @@
*/
#include <asm/msr-index.h>
+#include <asm/processor.h>
#include <asm/processor-flags.h>
.code32
@@ -30,11 +31,6 @@ cpu_call64:
andl $~X86_CR0_PG, %eax
movl %eax, %cr0
- /* Load new GDT with the 64bit segments using 32bit descriptor */
- leal gdt, %eax
- movl %eax, gdt+2
- lgdt gdt
-
/* Enable PAE mode */
movl $(X86_CR4_PAE), %eax
movl %eax, %cr4
@@ -49,12 +45,6 @@ cpu_call64:
btsl $_EFER_LME, %eax
wrmsr
- /* After gdt is loaded */
- xorl %eax, %eax
- lldt %ax
- movl $0x20, %eax
- ltr %ax
-
/*
* Setup for the jump to 64bit mode
*
@@ -67,7 +57,7 @@ cpu_call64:
*/
pop %esi /* setup_base */
- pushl $0x10
+ pushl $(X86_GDT_ENTRY_64BIT_CS * X86_GDT_ENTRY_SIZE)
leal lret_target, %eax
pushl %eax