Attention is currently required from: Jérémy Compostella, Shuo Liu.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/87256?usp=email )
Change subject: arch/x86/c_start: Drop switching the code selector ......................................................................
arch/x86/c_start: Drop switching the code selector
Since the ramstage GDT now has the same entries as the preRAM GDT there's no need to switch the code selector after loading the new GDT.
Change-Id: I67200fe691ddd9f2fd8de5b4464f6e48fd31e75b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/c_start.S 1 file changed, 0 insertions(+), 31 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/87256/1
diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S index 3bdef70..81d6b4b 100644 --- a/src/arch/x86/c_start.S +++ b/src/arch/x86/c_start.S @@ -30,7 +30,6 @@ lgdt (%rax) #else lgdt %cs:gdtaddr - ljmp $GDT_CODE_SEG, $1f #endif 1: movl $GDT_DATA_SEG, %eax movl %eax, %ds @@ -39,10 +38,6 @@ xor %eax, %eax /* zero out the gs and fs segment index */ movl %eax, %fs movl %eax, %gs /* Will be used for cpu_info */ -#if ENV_X86_64 - mov $GDT_CODE_SEG64, %ecx - call SetCodeSelector -#endif
post_code(POSTCODE_ENTRY_C_START) /* post 13 */
@@ -234,29 +229,3 @@ per_cpu_segment_selector: .long per_cpu_segment_descriptors - gdt
- .section ".text._start", "ax", @progbits -#if ENV_X86_64 -SetCodeSelector: - # save rsp because iret will align it to a 16 byte boundary - mov %rsp, %rdx - - # use iret to jump to a 64-bit offset in a new code segment - # iret will pop cs:rip, flags, then ss:rsp - mov %ss, %ax # need to push ss.. - push %rax # push ss instruction not valid in x64 mode, - # so use ax - push %rsp - pushfq - push %rcx # cx is code segment selector from caller - movabs $setCodeSelectorLongJump, %rax - push %rax - - # the iret will continue at next instruction, with the new cs value - # loaded - iretq - -setCodeSelectorLongJump: - # restore rsp, it might not have been 16-byte aligned on entry - mov %rdx, %rsp - ret -#endif