On 1/14/25 07:38, Ard Biesheuvel wrote:
...
Everything works fine with my distro QEMU:
$ qemu-system-loongarch64 --version
QEMU emulator version 8.2.4 (Debian 1:8.2.4+ds-1+build1)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
and it doesn't matter if I use your firmware or my own (grabbed
randomly from [0])
When I build QEMU from source (stable-9.2), things still work happily
if I use that same firmware. With your firmware, my QEMU 9.2 is
completely dead.
Where did you find that image? I tried rebuilding it myself from a
recent EDK2 base, but that doesn't work at all either.
I built it myself sometime in 2023 (when working images were not available anywhere).
It has debugging disabled and is much faster than other versions because of that.
[0] https://github.com/AOSC-Dev/LoongArchQemuVirtFirmware
... actually, turns out I built the wrong platform. If I build
OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
from the EDK2 repository, I can boot the kernel with my change
applied, using your command line.
Perhaps I should try your .config as well?
Please see http://server.roeck-us.net/qemu/loongarch/
staging: My EFI version, the version from [0], and the version from qemu 9.2 work fine.
next: My version hangs. The version from [0] crashes:
EFI stub: EFI_RNG_PROTOCOL unavailable
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services
PROGRESS CODE: V03101019 I0
!!!! LoongArch64 Exception Type - 08(#ADE - Address error exception) !!!!
Zero - 0x0000000000000000, RA - 0x900000016D817264, TP - 0x900000016E3AC000, SP - 0x900000016E3AFE70
A0 - 0x9000000170430000, A1 - 0x900000016C200000, A2 - 0x0000000003CD0000, A3 - 0x9000000170430000
A4 - 0x0000000000000000, A5 - 0x0000000000000003, A6 - 0x0000026713E4D52C, A7 - 0x0000000000000001
T0 - 0x000000000000004D, T1 - 0x900000016DE0B118, T2 - 0x5453502039333A33, T3 - 0x0000000000000007
T4 - 0x0000000000000006, T5 - 0x900000016D8801CE, T6 - 0x0000000000000007, T7 - 0x0000000000000002
T8 - 0x0000000000000001, R21 - 0x0000000000000000, FP - 0x0000000000000000, S0 - 0x9000000170430000
S1 - 0x900000016C200000, S2 - 0x0000000004230000, S3 - 0x900000000E166018, S4 - 0x900000016E3EF000
S5 - 0x900000016F214448, S6 - 0x000000000A45D000, S7 - 0x000000000F467D30, S8 - 0x0000000000000000
CRMD - 0x00000000000000B0, PRMD - 0x0000000000000000, EUEN - 0x0000000000000000, MISC - 0x0000000000000000
ECFG - 0x0000000000000800, ESTAT - 0x0000000000480000, ERA - 0x900000016D7FE2F0, BADV - 0x0000000000000000
BADI - 0x000000002900008C
!!!! Can't find image information. !!!!
The efi image from qemu 9.2 crashes with:
EFI stub: Decompressing Linux Kernel...
ConvertPages: range 200000 - 3ECFFFF covers multiple entries
EFI stub: EFI_RNG_PROTOCOL unavailable
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services
PROGRESS CODE: V03101019 I0
SetUefiImageMemoryAttributes - 0x000000000E2E0000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000E240000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000E1A0000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000E0F0000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000E050000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000DEB0000 - 0x0000000000050000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000DD10000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000DC70000 - 0x0000000000040000 (0x0000000000000008)
SetUefiImageMemoryAttributes - 0x000000000DBD0000 - 0x0000000000040000 (0x0000000000000008)
!!!! LoongArch64 Exception Type - 08(#ADE - Address error exception) !!!!
Zero - 0x0000000000000000, RA - 0x900000016D817264, TP - 0x900000016E3AC000, SP - 0x900000016E3AFE70
A0 - 0x9000000170380000, A1 - 0x900000016C200000, A2 - 0x0000000003CD0000, A3 - 0x9000000170380000
A4 - 0x0000000000000000, A5 - 0x0000000000000001, A6 - 0x0000000000000053, A7 - 0x600000000000007E
T0 - 0x000000000000004D, T1 - 0x900000016DE0B118, T2 - 0x5453502039333A33, T3 - 0x0000000000000007
T4 - 0x0000000000000006, T5 - 0x900000016D8801F6, T6 - 0x0000000000000007, T7 - 0x0000000000000000
T8 - 0x0000000000000000, R21 - 0x0000000000000000, FP - 0x00000000000B2298, S0 - 0x9000000170380000
S1 - 0x900000016C200000, S2 - 0x0000000004180000, S3 - 0x900000000E146018, S4 - 0x900000016E3EF000
S5 - 0x900000016F214448, S6 - 0x000000000A42D000, S7 - 0x00000000000B2950, S8 - 0x0000000000000010
CRMD - 0x00000000000000B0, PRMD - 0x0000000000000000, EUEN - 0x0000000000000000, MISC - 0x0000000000000000
ECFG - 0x0000000000000800, ESTAT - 0x0000000000480000, ERA - 0x900000016D7FE2F0, BADV - 0x0000000000000000
BADI - 0x000000002900008C
!!!! Find image based on IP(0x6D7FE2F0) (No PDB) (ImageBase=900000016C200000, EntryPoint=900000016D86E5E8) !!!!
Guenter