qemu-e2k/hw
Peter Maydell 95f875654a arm: Don't crash if user tries to use a Cortex-M CPU without an NVIC
The Cortex-M CPU and its NVIC are two intimately intertwined parts of
the same hardware; it is not possible to use one without the other.
Unfortunately a lot of our board models don't do any sanity checking
on the CPU type the user asks for, so a command line like
    qemu-system-arm -M versatilepb -cpu cortex-m3
will create an M3 without an NVIC, and coredump immediately.
In the other direction, trying a non-M-profile CPU in an M-profile
board won't blow up, but doesn't do anything useful either:
    qemu-system-arm -M lm3s6965evb -cpu arm926

Add some checking in the NVIC and CPU realize functions that the
user isn't trying to use an NVIC without an M-profile CPU or
an M-profile CPU without an NVIC, so we can produce a helpful
error message rather than a core dump.

Fixes: https://bugs.launchpad.net/qemu/+bug/1766896
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180601160355.15393-1-peter.maydell@linaro.org
2018-06-15 15:23:34 +01:00
..
9pfs 9p: xattr: Properly translate xattrcreate flags 2018-06-07 12:17:22 +02:00
acpi nvdimm: make persistence option symbolic 2018-06-11 22:19:57 +03:00
adc
alpha
arm arm: Don't crash if user tries to use a Cortex-M CPU without an NVIC 2018-06-15 15:23:34 +01:00
audio hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init 2018-06-01 15:14:31 +02:00
block hw/block/pflash_cfi02: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
bt
char hw/char/parallel: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
core object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
cpu
cris hw: Do not include "sysemu/block-backend.h" if it is not necessary 2018-06-01 14:15:10 +02:00
display object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
dma object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
gpio hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init 2018-06-01 15:14:31 +02:00
hppa acpi, vhost, misc: fixes, features 2018-06-04 10:15:16 +01:00
i2c ppc4xx_i2c: Clean up and improve error logging 2018-06-12 10:44:36 +10:00
i386 usb: bug fix collection, doc update. 2018-06-12 15:34:34 +01:00
ide Purge uses of banned g_assert_FOO() 2018-06-13 13:47:35 +02:00
input hw/input/pckbd: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
intc arm: Don't crash if user tries to use a Cortex-M CPU without an NVIC 2018-06-15 15:23:34 +01:00
ipack
ipmi object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
isa hw/isa/superio: Fix inconsistent use of Chardev->be 2018-06-01 15:13:46 +02:00
lm32 hw: Do not include "sysemu/block-backend.h" if it is not necessary 2018-06-01 14:15:10 +02:00
m68k hw/m68k/mcf5206: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
mem nvdimm: fix typo in label-size definition 2018-05-23 17:02:03 +03:00
microblaze hw: Do not include "sysemu/block-backend.h" if it is not necessary 2018-06-01 14:15:10 +02:00
mips hw/mips/boston: Add trailing '\n' to qemu_log() calls 2018-06-08 13:15:33 +01:00
misc mos6522: convert VMSTATE_TIMER_PTR_TEST to VMSTATE_TIMER_PTR 2018-06-12 10:44:36 +10:00
moxie Change references to serial_hds[] to serial_hd() 2018-04-26 13:57:00 +01:00
net e1000e: Do not auto-clear ICR bits which aren't set in EIAC 2018-06-15 10:39:53 +08:00
nios2 Change references to serial_hds[] to serial_hd() 2018-04-26 13:57:00 +01:00
nvram * Linux header upgrade (Peter) 2018-06-01 18:24:16 +01:00
openrisc Change references to serial_hds[] to serial_hd() 2018-04-26 13:57:00 +01:00
pci
pci-bridge
pci-host uninorth: remove token register from uninorth device 2018-06-12 09:33:52 +10:00
pcmcia
ppc Purge uses of banned g_assert_FOO() 2018-06-13 13:47:35 +02:00
rdma hw/rdma: Fix possible out of bounds access to port GID index 2018-05-03 20:52:29 +03:00
riscv hw: Do not include "exec/address-spaces.h" if it is not necessary 2018-06-01 14:15:10 +02:00
s390x * Linux header upgrade (Peter) 2018-06-01 18:24:16 +01:00
scsi acpi, vhost, misc: fixes, features 2018-06-04 10:15:16 +01:00
sd sdcard: Disable CMD19/CMD23 for Spec v2 2018-06-08 13:15:34 +01:00
sh4 hw/sh/sh7750: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
smbios
sparc Change references to serial_hds[] to serial_hd() 2018-04-26 13:57:00 +01:00
sparc64 serial-isa: Use MAX_ISA_SERIAL_PORTS instead of MAX_SERIAL_PORTS 2018-04-26 13:57:00 +01:00
ssi object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence 2018-06-12 12:07:30 +02:00
timer hw/digic: Add trailing '\n' to qemu_log() calls 2018-06-08 13:15:33 +01:00
tpm tpm: extend TPM TIS with state migration support 2018-05-24 12:07:04 -04:00
tricore
unicore32
usb Purge uses of banned g_assert_FOO() 2018-06-13 13:47:35 +02:00
vfio vfio/pci: Default display option to "off" 2018-06-05 08:28:09 -06:00
virtio acpi, vhost, misc: fixes, features 2018-06-04 10:15:16 +01:00
watchdog hw/watchdog/wdt_i6300esb: Convert away from old_mmio 2018-06-15 15:23:34 +01:00
xen * Linux header upgrade (Peter) 2018-06-01 18:24:16 +01:00
xenpv
xtensa hw: Do not include "sysemu/block-backend.h" if it is not necessary 2018-06-01 14:15:10 +02:00
Makefile.objs hw: allow compiling out SCSI 2018-06-01 15:14:31 +02:00