qemu-e2k/hw
Peter Maydell dae257394a hw/arm/boot: Report error if there is no fw_cfg device in the machine
If the user provides both a BIOS/firmware image and also a guest
kernel filename, arm_setup_firmware_boot() will pass the
kernel image to the firmware via the fw_cfg device. However we
weren't checking whether there really was a fw_cfg device present,
and if there wasn't we would crash.

This crash can be provoked with a command line such as
 qemu-system-aarch64 -M raspi3 -kernel /dev/null -bios /dev/null -display none

It is currently only possible on the raspi3 machine, because unless
the machine sets info->firmware_loaded we won't call
arm_setup_firmware_boot(), and the only machines which set that are:
 * virt (has a fw-cfg device)
 * sbsa-ref (checks itself for kernel_filename && firmware_loaded)
 * raspi3 (crashes)

But this is an unfortunate beartrap to leave for future machine
model implementors, so we should handle this situation in boot.c.

Check in arm_setup_firmware_boot() whether the fw-cfg device exists
before trying to load files into it, and if it doesn't exist then
exit with a hopefully helpful error message.

Because we now handle this check in a machine-agnostic way, we
can remove the check from sbsa-ref.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/503
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210726163351.32086-1-peter.maydell@linaro.org
2021-08-02 12:55:51 +01:00
..
9pfs 9pfs: reduce latency of Twalk 2021-07-05 13:03:16 +02:00
acpi hw/acpi/Kconfig: Add missing Kconfig dependencies (build error) 2021-07-20 15:29:27 +02:00
adc adc: Move the max111x driver to the adc directory 2021-06-17 07:10:32 -05:00
alpha hw/alpha: Provide a PCI-ISA bridge device node 2021-06-28 07:27:32 -07:00
arm hw/arm/boot: Report error if there is no fw_cfg device in the machine 2021-08-02 12:55:51 +01:00
audio hw/audio/adlib: Remove unused variable in adlib_callback 2021-07-26 07:07:07 -10:00
avr hw/avr/atmega.c: use the avr51 cpu for atmega1280 2021-05-13 19:11:42 +02:00
block pc,pci,virtio: bugfixes, improvements 2021-07-09 14:30:01 +01:00
char hw/riscv/Kconfig: Add missing dependency MICROCHIP_PFSOC -> SERIAL 2021-07-20 15:32:34 +02:00
core hw/net: e1000e: Correct the initial value of VET register 2021-08-02 12:19:18 +08:00
cpu cpu/core: Fix "help" of CPU core device types 2021-04-09 16:05:16 -04:00
cris Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
display hw/display: fix virgl reset regression 2021-07-22 15:46:54 +02:00
dma docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
gpio hw: aspeed_gpio: Fix memory size 2021-07-27 11:00:00 +01:00
hppa docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
hyperv vmbus: Don't make QOM property registration conditional 2021-07-06 18:04:38 -04:00
i2c i2c/smbus_eeprom: Add feature bit to SPD data 2021-07-29 10:59:49 +10:00
i386 hw/i386/Kconfig: Add missing Kconfig dependency (runtime error) 2021-07-20 15:29:46 +02:00
ide hw/ide/Kconfig: Add missing dependency PCI -> IDE_QDEV 2021-07-20 15:30:42 +02:00
input Some qemu updates for IPMI and I2C 2021-07-11 14:32:49 +01:00
intc hw/intc/armv7m_nvic: for v8.1M VECTPENDING hides S exceptions from NS 2021-07-27 10:57:39 +01:00
ipack Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
ipmi ipmi/sim: fix watchdog_expired data type error in IPMIBmcSim struct 2021-07-08 14:15:01 -05:00
isa hw/isa/vt82c686: Add missing Kconfig dependency (runtime error) 2021-07-20 20:10:20 +02:00
m68k bitops.h: revert db1ffc32dd ("qemu/bitops.h: add bitrev8 implementation") 2021-07-26 06:56:41 -10:00
mem docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
microblaze Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
mips hw/mips: Express dependencies of the Boston machine with Kconfig 2021-07-20 15:18:39 +02:00
misc Some qemu updates for IPMI and I2C 2021-07-11 14:32:49 +01:00
net hw/net: e1000e: Don't zero out the VLAN tag in the legacy RX descriptor 2021-08-02 12:19:18 +08:00
nios2 Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
nubus hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
nvme hw/nvme: fix mmio read 2021-07-26 21:09:39 +02:00
nvram docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
openrisc Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pci hw/pci: Add pci_bus_range() to get PCI bus number range 2021-07-16 11:10:45 -04:00
pci-bridge hw/pxb: Add a bypass iommu property 2021-07-16 11:10:45 -04:00
pci-host hw/pci-hist/pnv_phb4: Fix typo in pnv_phb4_ioda_write 2021-07-26 07:07:07 -10:00
pcmcia hw/pcmcia: Do not register PCMCIA type if not required 2021-05-02 17:24:50 +02:00
ppc ppc/vof: Fix Coverity issues 2021-07-29 10:59:49 +10:00
rdma pvrdma: Fix the ring init error flow (CVE-2021-3608) 2021-07-04 22:47:51 +03:00
remote remote/memory: Replace share parameter with ram_flags 2021-07-20 15:34:20 -04:00
riscv hw/riscv/Kconfig: Restrict NUMA to Virt & Spike machines 2021-07-20 15:32:49 +02:00
rtc docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
rx hw/rx/rx-gdbsim: Do not accept invalid memory size 2021-05-03 10:07:41 +02:00
s390x s390x updates: 2021-07-12 19:15:11 +01:00
scsi virtio: Clarify MR transaction optimization 2021-07-02 11:13:39 -04:00
sd hw/sd/sdcard: Check for valid address range in SEND_WRITE_PROT (CMD30) 2021-07-12 12:27:38 +02:00
sensor hw/misc: add MAX34451 device 2021-07-08 14:42:00 -05:00
sh4 Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
smbios hw/smbios: support for type 41 (onboard devices extended information) 2021-05-14 10:26:18 -04:00
sparc hw/block/fdc: Extract SysBus floppy controllers to fdc-sysbus.c 2021-06-25 08:53:28 -04:00
sparc64 hw/block/fdc: Extract ISA floppy controllers to fdc-isa.c 2021-06-25 08:53:28 -04:00
ssi Trivial patches pull request 20210503 2021-05-05 13:52:00 +01:00
timer hw/timer: Initial commit of Ibex Timer 2021-06-24 05:00:12 -07:00
tpm docs: fix references to docs/specs/tpm.rst 2021-06-02 06:51:09 +02:00
tricore hw/tricore: fix inclusion of tricore_testboard 2021-07-20 20:10:21 +02:00
usb usbredir: fix free call 2021-07-29 11:18:46 +02:00
vfio vfio/pci: Add pba_offset PCI quirk for BAIDU KUNLUN AI processor 2021-07-14 13:47:17 -06:00
virtio vhost-vsock: SOCK_SEQPACKET feature bit support 2021-07-16 11:10:45 -04:00
watchdog docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
xen docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
xenpv meson: convert hw/arch* 2020-08-21 06:30:33 -04:00
xtensa Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
Kconfig sensor: Move hardware sensors from misc to a sensor directory 2021-06-17 07:10:32 -05:00
meson.build sensor: Move hardware sensors from misc to a sensor directory 2021-06-17 07:10:32 -05:00