hw/intc/armv7m_nvic: Only show ID register values for Main Extension CPUs
commitd20c3ebda2972255e67c0a07368ac37f37a16c04
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Sep 2020 17:38:53 +0000 (10 18:38 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 1 Oct 2020 14:31:00 +0000 (1 15:31 +0100)
treecf28d4e6e863388f9bc7744cd5e0a23a07da8897
parent8a130a7be6e222965641e1fd9469fd3ee752c7d4
hw/intc/armv7m_nvic: Only show ID register values for Main Extension CPUs

M-profile CPUs only implement the ID registers as guest-visible if
the CPU implements the Main Extension (all our current CPUs except
the Cortex-M0 do).

Currently we handle this by having the Cortex-M0 leave the ID
register values in the ARMCPU struct as zero, but this conflicts with
our design decision to make QEMU behaviour be keyed off ID register
fields wherever possible.

Explicitly code the ID registers in the NVIC to return 0 if the Main
Extension is not implemented, so we can make the M0 model set the
ARMCPU struct fields to obtain the correct behaviour without those
values becoming guest-visible.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200910173855.4068-4-peter.maydell@linaro.org
hw/intc/armv7m_nvic.c