Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Thank you for all of your comments! In my understanding, LinuxBoot is one of the options for a coreboot's payload and it can pass the execution to any Linux distributions (OSes). So, we can use LinuxBoot as a payload when we want to run Linux. The flow is here:
coreboot -> LinuxBoot -> Linux (or any OSes)
There is no real LinuxBoot "step" in between there. Linux *is* the payload. payloads/external/LinuxBoot isn't really a payload in itself, it's just a bunch of build infrastructure that builds Linux as a payload for you. At runtime, coreboot hands off directly to the Linux kernel. (That's why I was arguing that it's misnamed and should just be named payloads/external/linux.)
In relation to 3, I'm trying to run coreboot with LinuxBoot on QEMU/AArch64 (could build it with u-boot v3.0.0, couldn't do it with the master version). I now got the following exception. I will investigate that my implementation is wrong or LinuxBoot has a something problem.
Hmmm... interesting. ESR = 0x5e00000 means "SMC instruction execution in AArch64 state, when SMC is not disabled." (see description for ESR_EL3 in the Armv8 Architecture Reference Manual). So I think(?) that's just a normal SMC entry, the problem is that you don't have a real SMC handler installed (the stuff you see is just coreboot's crashdump exception handler which was left over in memory after coreboot was finished... since the kernel starts in EL2, nothing ever overwrites the EL3 interrupt vectors).
So your main problem is essentially that you're running a kernel that expects PSCI to be available without loading Trusted Firmware. A workaround would be to disable PSCI in the kernel (if that's even still possible these days... try deleting the "arm,psci" node in the device tree). But the real solution would of course be to get Trusted Firmware working for QEMU. For that you need to 'select ARM64_USE_ARM_TRUSTED_FIRMWARE' in your Kconfig and add 'BL31_MAKEARGS += PLAT=qemu' to your Makefile. That should get it to build and run, but whether it will work I have no idea (I don't know who developed the QEMU port in TF, but they probably didn't design it to be used with coreboot). You may need to fix some things within TF to get that to work.