feat(la64): use DMW kernel VA and place _start after image header#51
feat(la64): use DMW kernel VA and place _start after image header#51eternalcomet wants to merge 1 commit intodevfrom
Conversation
Switch the LoongArch QEMU-virt default kernel virtual layout to a DMW-friendly 0x9000_... range and separate the Linux image header label from the real `_start` entry in boot code. This avoids direct `-kernel` ELF boot hangs seen with the previous high-half `0xffff_8000_...` layout on current QEMU LoongArch boot path.
|
之前la64因为内核地址的问题在去年OS比赛时就出现过引导相关问题,我们启动的内核地址是 |
LoongArch64 ELF boot: QEMU history, root cause, and ArceOS-side workaroundBackground and historical discussionFrom prior team discussion, there was an older LoongArch QEMU issue around virtual-to-physical truncation in direct boot paths:
What was in the old patched QEMU treeIn previously local patched tree:
return addr & MAKE_64BIT_MASK(0, TARGET_PHYS_ADDR_SPACE_BITS - 1);
addr_high = sextract64(address, TARGET_VIRT_ADDR_SPACE_BITS - 1, 17);These match the historical workaround direction from prior discussion. What is in current upstream QEMU (qemu-repo)In qemu new upstream build, version
return addr & *phys_addr_mask;
Conclusion: the exact old local workaround ( Current reproducible problemWith ArceOS high-half layout (
Observed behavior in this investigation:
ArceOS-side workaround goalTry to avoid QEMU-side changes and make ELF direct boot succeed by selecting a DMW-friendly kernel virtual layout. ArceOS changes appliedExternal crate was overridden locally (as requested): Effective config changes:
Boot assembly/layout change:
Verification resultAfter local ArceOS override:
This confirms we can make ELF direct boot work without modifying QEMU, by using DMW-friendly ArceOS virtual addresses and proper Interpretation
|
This pr aims at passing ELF to qemu directly without stripping the ELF file.
Switch the LoongArch QEMU-virt default kernel virtual layout to a DMW-friendly 0x9000_... range and separate the Linux image header label from the real
_startentry in boot code. This avoids direct-kernelELF boot hangs seen with the previous high-half0xffff_8000_...layout on current QEMU LoongArch boot path.