Attention is currently required from: Arthur Heymans, Julius Werner, Jérémy Compostella, Kapil Porwal, Nico Huber.
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 1:
(2 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/81960/comment/e79ab5ea_443aa1ca : PS1, Line 15: transition.
When we implement the x64 architecture for libpayload, we design the ABI expectation according to long mode
So your problem is between coreboot and your payload, not "between libpayload and depthcharge"? I guess we should discuss the new ABI first.
What do you mean with LB exactly? I see you're referring to the payload?
LB = libpayload DC = depthcharge
to build 64-bit DC, we need to first build 64-bit LB. Now if coreboot switch to 32-bit while entering into the LB although we are expecting to load LB in 64-bit mode, hence the calling convention is not aligned.
I won't say if this is problem between DC and LB rather the design of DC is such a way that both DC and LB should follow the same architecture.
File src/arch/x86/boot.c:
https://review.coreboot.org/c/coreboot/+/81960/comment/000fcc4d_33b0e025 : PS1, Line 25: if (CONFIG(PAYLOAD_X86_64_SUPPORT)) {
Would it be possible to make it an offset? Then we could have a 32-bit entry point followed by a 64-bit one, and a coreboot that knows the new ABI could skip the first and jump directly to the new entry point. This would allow the most compatibility between coreboot and payloads, as we could say the 64-bit entry point is optional on both ends (except for X86S, ofc.).
I guess the complexity of such a 32-bit entry point, that switches to long mode, would depend a lot on the expectations on page tables in the new ABI.
I'm following the guideline shared by Arthur in previous comment where we will have add new cmd line for cbfstool option `--64` for adding a 64-bit payload. based on this cmdline, cbfstool will inject additional tag to understand if this payload is 64bit or 32bit. later coreboot can search the header before jumping into correct ABI.
for chromeos builder, the chromeos_bootimage will inject payload/depthcharge into cbfs with `--64` cmdline for applicable platform.