Attention is currently required from: Arthur Heymans, Julius Werner, Jérémy Compostella, Kapil Porwal, Nico Huber, Patrick Rudolph.
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/81960?usp=email )
Change subject: arch/x86: Enable long mode entry into payload for x86_64 support ......................................................................
Patch Set 7:
(1 comment)
File src/arch/x86/boot.c:
https://review.coreboot.org/c/coreboot/+/81960/comment/653d352a_ce4ce8c7 : PS3, Line 47: is_payload_64_bit_enabled
yes. Either that or use long_mode_call_3arg() to switch to long mode before calling the payload. I haven't tested that but should work fine.
I have tried following ur review comment and after some experiement I have concluded that supporting 64-bit payload with 32-bit coreboot is not pratical to launch because the `long_mode_call_3arg` and associated pagetable codes are only getting compiled when CONFIG_ARCH_BOOTBLOCK_X86_32 Kconfig remains enabled. Even I tried to W/A that but eventually started running into issue due to relocation type which seems to be different between 32-bit coreboot code is tring to compile 64-bit entrypoint for payload. Rather for now, I have added `die` to forbid such entry.
src/cpu/x86/64bit/pt.S:23: Error: cannot represent relocation type BFD_RELOC_64 /opt/coreboot-sdk/lib/gcc/i386-elf/11.3.0/../../../../i386-elf/bin/as: /build/rex/tmp/portage/sys-boot/coreboot-9999/work/build/rex0-serial/romstage/cpu/x86/64bit/pt.o: unsupported relocation type: 0x1
I don't believe below one is the correct approach to skip the compilation issue with 32-bit coreboot
``` diff --git a/src/cpu/x86/64bit/pt.S b/src/cpu/x86/64bit/pt.S index 67e4b1b8bf6..a9e763f86aa 100644 --- a/src/cpu/x86/64bit/pt.S +++ b/src/cpu/x86/64bit/pt.S @@ -20,16 +20,28 @@ .global PM4LE .align 4096 PM4LE: +#if CONFIG(ARCH_BOOTBLOCK_X86_64) .quad _GEN_DIR(PDPE_table) +#else +.long _GEN_DIR(PDPE_table) +#endif
```