diff --git a/hypervisor/arch/x86/cpu_primary.S b/hypervisor/arch/x86/cpu_primary.S index 76066966e..a4440b4ee 100644 --- a/hypervisor/arch/x86/cpu_primary.S +++ b/hypervisor/arch/x86/cpu_primary.S @@ -112,7 +112,8 @@ cpu_primary_start_32: lgdt (%ebx) /* Perform a long jump based to start executing in 64-bit mode */ - ljmp $HOST_GDT_RING0_CODE_SEL, $primary_start_long_mode + /* 0x0008 = HOST_GDT_RING0_CODE_SEL */ + ljmp $0x0008, $primary_start_long_mode .code64 .org 0x200 @@ -150,13 +151,15 @@ primary_start_long_mode: rex.w ljmp *(%rax) .data jmpbuf: .quad 0 - .word HOST_GDT_RING0_CODE_SEL + /* 0x0008 = HOST_GDT_RING0_CODE_SEL */ + .word 0x0008 .text after: // load all selector registers with appropriate values xor %edx, %edx lldt %dx - movl $HOST_GDT_RING0_DATA_SEL,%eax + /* 0x10 = HOST_GDT_RING0_DATA_SEL*/ + movl $0x10,%eax mov %eax,%ss // Was 32bit POC Stack mov %eax,%ds // Was 32bit POC Data mov %eax,%es // Was 32bit POC Data diff --git a/hypervisor/arch/x86/idt.S b/hypervisor/arch/x86/idt.S index c27540412..0b345413c 100644 --- a/hypervisor/arch/x86/idt.S +++ b/hypervisor/arch/x86/idt.S @@ -24,13 +24,15 @@ HOST_IDTR: * We'll rearrange and fix up the descriptors at runtime */ .macro interrupt_descriptor entry, dpl=0 ist=0 - .long HOST_GDT_RING0_CODE_SEL << 16 + /* 0x0008 = HOST_GDT_RING0_CODE_SEL */ + .long 0x0008 << 16 .long 0x00008e00 + (dpl << 13) + ist .quad entry .endm .macro trap_descriptor entry, dpl=0, ist=0 - .long HOST_GDT_RING0_CODE_SEL << 16 + /* 0x0008 = HOST_GDT_RING0_CODE_SEL */ + .long 0x0008 << 16 .long 0x00008f00 + (dpl <<13) + ist .quad entry .endm diff --git a/hypervisor/arch/x86/trampoline.S b/hypervisor/arch/x86/trampoline.S index 73036be89..b8ecf6729 100644 --- a/hypervisor/arch/x86/trampoline.S +++ b/hypervisor/arch/x86/trampoline.S @@ -133,14 +133,15 @@ trampoline_fixup_target: .global trampoline_start64_fixup trampoline_start64_fixup: .long trampoline_start64 - .word HOST_GDT_RING0_CODE_SEL + /* 0x0008 = HOST_GDT_RING0_CODE_SEL */ + .word 0x0008 .code64 trampoline_start64: /* Set up all other data segment registers */ - - movl $HOST_GDT_RING0_DATA_SEL, %eax + /* 0x0010 = HOST_GDT_RING0_DATA_SEL */ + movl $0x0010, %eax mov %eax, %ss mov %eax, %ds mov %eax, %es