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
..
2018-06-04 10:15:16 +01:00
2018-06-12 15:34:34 +01:00
2018-06-13 13:47:35 +02:00
2018-06-01 18:24:16 +01:00
2016-01-29 15:07:25 +00:00
2018-06-13 13:47:35 +02:00
2018-06-01 18:24:16 +01:00
2018-06-04 10:15:16 +01:00
2018-06-13 13:47:35 +02:00
2018-06-04 10:15:16 +01:00
2018-06-01 18:24:16 +01:00
2018-06-01 15:14:31 +02:00