2023-10-09 20:13:57

by Thomas Weißschuh

[permalink] [raw]
Subject: qemu direct kernel boot on LoongArch

Hi,

I'm trying to boot a LoongArch Linux via the direct kernel mode of qemu.
( qemu -kernel vmlinux -append "verbose" )
This doesn't work so well.

A few problems I encoutered:

* Linux reads the cmdline from $a1 during boot, but qemu doesn't place it there.
* Qemu puts a FDT at 1MiB but Linux doesn't use it.
* Qemu does not put the cmdline into the FDT.
* Linux panics in memory_present() because memblock_init() in
arch/loongarch/kernel/mem.c did not set up any memblocks.
* Qemu has no support for initrds in direct kernel mode on LoongArch.

(All observations based on current git versions)

For the other architectures I'm using Linux/qemu with the direct kernel
mode works nicely including cmdline and initrds.

Are these restrictions by design/intentional or is it just for somebody
to do the necessary legwork?

The direct kernel mode is nice because it does not require the
installation of the additional EFI binary.


Thanks,
Thomas