qemu-e2k/hw
Daniel Henrique Barboza 43d1de32f8 hw/riscv/virt.c: skip 'mmu-type' FDT if satp mode not set
The absence of a satp mode in riscv_host_cpu_init() is causing the
following error:

$ ./qemu/build/qemu-system-riscv64  -machine virt,accel=kvm \
    -m 2G -smp 1  -nographic -snapshot \
    -kernel ./guest_imgs/Image \
    -initrd ./guest_imgs/rootfs_kvm_riscv64.img \
    -append "earlycon=sbi root=/dev/ram rw" \
    -cpu host
**
ERROR:../target/riscv/cpu.c:320:satp_mode_str: code should not be
reached
Bail out! ERROR:../target/riscv/cpu.c:320:satp_mode_str: code should
not be reached
Aborted

The error is triggered from create_fdt_socket_cpus() in hw/riscv/virt.c.
It's trying to get satp_mode_str for a NULL cpu->cfg.satp_mode.map.

For this KVM cpu we would need to inherit the satp supported modes
from the RISC-V host. At this moment this is not possible because the
KVM driver does not support it. And even when it does we can't just let
this broken for every other older kernel.

Since mmu-type is not a required node, according to [1], skip the
'mmu-type' FDT node if there's no satp_mode set. We'll revisit this
logic when we can get satp information from KVM.

[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/riscv/cpus.yaml

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230706101738.460804-3-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2023-07-10 22:29:15 +10:00
..
9pfs 9pfs: deprecate 'proxy' backend 2023-07-06 11:42:08 +02:00
acpi hw/acpi: Fix PM control register access 2023-06-26 09:49:24 -04:00
adc meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
alpha
arm hw/arm/virt-acpi-build.c: Add missing header 2023-07-08 07:24:38 +03:00
audio meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
avr
block vhost-user: fully use new backend/frontend naming 2023-06-26 09:50:00 -04:00
char escc: emulate dip switch language layout settings on SUN keyboard 2023-06-28 10:54:25 +01:00
core Block layer patches 2023-06-28 17:29:53 +02:00
cpu meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
cris
cxl hw/cxl/events: Add event interrupt support 2023-06-22 18:55:14 -04:00
display virtio-gpu-virgl: use D3D11_SHARE_TEXTURE when available 2023-06-27 17:08:56 +02:00
dma meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
gpio meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
hppa target/hppa: Provide qemu version via fw_cfg to firmware 2023-06-24 13:39:48 +02:00
hyperv
i2c meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
i386 exec/memory: Add symbolic value for memory listener priority for accel 2023-06-28 14:27:59 +02:00
ide meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
input vhost-user: fully use new backend/frontend naming 2023-06-26 09:50:00 -04:00
intc pnv/xive2: Always pass a presenter object when accessing the TIMA 2023-07-07 04:46:12 -03:00
ipack meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
ipmi meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
isa meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
loongarch hw: Simplify calls to pci_nic_init_nofail() 2023-07-08 07:24:38 +03:00
m68k q800: move macfb device to Q800MachineState 2023-06-22 09:30:11 +02:00
mem hw/cxl/events: Add injection of Memory Module Events 2023-06-23 02:54:40 -04:00
microblaze
mips hw: Simplify calls to pci_nic_init_nofail() 2023-07-08 07:24:38 +03:00
misc hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b. 2023-07-10 22:29:14 +10:00
net ppc patch queue for 2023-07-07: 2023-07-07 22:23:17 +01:00
nios2
nubus meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
nvme hw/nvme: add placement handle list ranges 2023-06-28 11:22:46 +02:00
nvram meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
openrisc
pci pcie: Add a PCIe capability version helper 2023-07-10 09:52:52 +02:00
pci-bridge meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
pci-host mv64361: Add dummy gigabit ethernet PHY access registers 2023-07-07 04:18:26 -03:00
pcmcia meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
ppc ppc/pnv: Add QME region for P10 2023-07-07 06:32:53 -03:00
rdma meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
remote exec/memory: Add symbol for memory listener priority for device backend 2023-06-28 14:27:59 +02:00
riscv hw/riscv/virt.c: skip 'mmu-type' FDT if satp mode not set 2023-07-10 22:29:15 +10:00
rtc meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
rx
s390x vfio: Implement a common device info helper 2023-06-30 06:02:51 +02:00
scsi virtio-scsi: avoid dangling host notifier in ->ioeventfd_stop() 2023-06-26 09:50:00 -04:00
sd meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sensor meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sh4
smbios meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
sparc
sparc64 Revert "hw/sparc64/niagara: Use blk_name() instead of open-coding it" 2023-06-28 10:50:41 +01:00
ssi meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
timer meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
tpm meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
tricore
usb meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
vfio vfio/pci: Enable AtomicOps completers on root ports 2023-07-10 09:52:52 +02:00
virtio exec/memory: Add symbol for memory listener priority for device backend 2023-06-28 14:27:59 +02:00
watchdog meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
xen exec/memory: Add symbolic value for memory listener priority for accel 2023-06-28 14:27:59 +02:00
xenpv
xtensa hw: Simplify calls to pci_nic_init_nofail() 2023-07-08 07:24:38 +03:00
Kconfig
meson.build