qemu-e2k/hw/arm
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
..
allwinner-a10.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
allwinner-h3.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
armsse.c hw/arm: Model TCMs in the SSE-300, not the AN547 2021-05-25 16:01:43 +01:00
armv7m.c target/arm: Allow board models to specify initial NS VTOR 2021-06-03 16:43:25 +01:00
aspeed_ast2600.c Trivial patches pull request 20210503 2021-05-05 13:52:00 +01:00
aspeed_soc.c Trivial patches pull request 20210503 2021-05-05 13:52:00 +01:00
aspeed.c sensor: Move hardware sensors from misc to a sensor directory 2021-06-17 07:10:32 -05:00
bcm2835_peripherals.c hw/arm: Add basic power management to raspi. 2021-07-02 11:48:36 +01:00
bcm2836.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
boot.c hw/arm/boot: Report error if there is no fw_cfg device in the machine 2021-08-02 12:55:51 +01:00
collie.c
cubieboard.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
digic_boards.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
digic.c
exynos4_boards.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
exynos4210.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
fsl-imx6.c
fsl-imx6ul.c
fsl-imx7.c
fsl-imx25.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
fsl-imx31.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
gumstix.c
highbank.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
imx25_pdk.c hw/arm/imx25_pdk: Fix error message for invalid RAM size 2021-05-10 17:21:54 +01:00
integratorcp.c
Kconfig hw/arm/Kconfig: Add missing SDHCI symbol to FSL_IMX25 2021-07-20 15:31:45 +02:00
kzm.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
mainstone.c
mcimx6ul-evk.c arm: Consistently use "Cortex-Axx", not "Cortex Axx" 2021-06-03 16:43:25 +01:00
mcimx7d-sabre.c arm: Consistently use "Cortex-Axx", not "Cortex Axx" 2021-06-03 16:43:25 +01:00
meson.build stm32vldiscovery: Add the STM32VLDISCOVERY Machine 2021-07-09 16:09:12 +01:00
microbit.c
mps2-tz.c hw/arm: Model TCMs in the SSE-300, not the AN547 2021-05-25 16:01:43 +01:00
mps2.c
msf2-soc.c hw: Do not include hw/irq.h if it is not necessary 2021-05-02 17:24:50 +02:00
msf2-som.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
musca.c
musicpal.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
netduino2.c
netduinoplus2.c
npcm7xx_boards.c hw/arm: gsj add pca9548 2021-06-16 14:33:51 +01:00
npcm7xx.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
nrf51_soc.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
nseries.c hw/arm/nseries: Display hexadecimal value with '0x' prefix 2021-07-27 10:57:40 +01:00
omap1.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
omap2.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
omap_sx1.c
orangepi.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
palm.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
pxa2xx_gpio.c
pxa2xx_pic.c hw/arm: Constify VMStateDescription 2021-05-02 17:24:50 +02:00
pxa2xx.c hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() 2021-07-08 14:15:01 -05:00
raspi.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
realview.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
sabrelite.c arm: Consistently use "Cortex-Axx", not "Cortex Axx" 2021-06-03 16:43:25 +01:00
sbsa-ref.c hw/arm/boot: Report error if there is no fw_cfg device in the machine 2021-08-02 12:55:51 +01:00
smmu-common.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
smmu-internal.h
smmuv3-internal.h hw/arm/smmuv3: Check 31st bit to see if CD is valid 2021-07-27 10:57:39 +01:00
smmuv3.c hw/arm/smmuv3: Another range invalidation fix 2021-05-25 15:44:45 +01:00
spitz.c hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() 2021-07-08 14:15:01 -05:00
stellaris.c hw/arm/stellaris: Expand comment about handling of OLED chipselect 2021-07-09 16:09:12 +01:00
stm32f100_soc.c stm32f100: Add the stm32f100 SoC 2021-07-09 16:09:11 +01:00
stm32f205_soc.c
stm32f405_soc.c
stm32vldiscovery.c stm32vldiscovery: Add the STM32VLDISCOVERY Machine 2021-07-09 16:09:12 +01:00
strongarm.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
strongarm.h
sysbus-fdt.c arm: Eliminate all TPM related code if CONFIG_TPM is not set 2021-06-15 10:54:55 -04:00
tosa.c
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h
versatilepb.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
vexpress.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
virt-acpi-build.c hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3 2021-07-16 11:10:45 -04:00
virt.c hw/arm/virt: Add default_bus_bypass_iommu machine option 2021-07-16 11:10:45 -04:00
xilinx_zynq.c adc: Move the zynq-xadc file to the adc directories 2021-06-17 07:10:32 -05:00
xlnx-versal-virt.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xlnx-versal.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
xlnx-zcu102.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
xlnx-zynqmp.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
z2.c hw/arm: Constify VMStateDescription 2021-05-02 17:24:50 +02:00