armv7m: Replace armv7m.hack with unassigned_access handler
commit542b3478a00cb7ef51c259255b3ab1e2a7daada2
authorMichael Davidsaver <mdavidsaver@gmail.com>
Fri, 27 Jan 2017 15:20:21 +0000 (27 15:20 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 27 Jan 2017 15:20:21 +0000 (27 15:20 +0000)
tree03f53c282fbcdee5dde971c4c99b2b22276d9aa8
parent58117c9bb429cd9552d998687aa99088eb1d8528
armv7m: Replace armv7m.hack with unassigned_access handler

For v7m we need to catch attempts to execute from special
addresses at 0xfffffff0 and above. Previously we did this
with the aid of a hacky special purpose lump of memory
in the address space and a check in translate.c for whether
we were translating code at those addresses.

We can implement this more cleanly using a CPU
unassigned access handler which throws the exception
if the unassigned access is for one of the special addresses.

Signed-off-by: Michael Davidsaver <mdavidsaver@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1484937883-1068-3-git-send-email-peter.maydell@linaro.org
[PMM:
 * drop the deletion of the "don't interrupt if PC is magic"
   code in arm_v7m_cpu_exec_interrupt() -- this is still
   required
 * don't generate an exception for unassigned accesses
   which aren't to the magic address -- although doing
   this is in theory correct in practice it will break
   currently working guests which rely on the RAZ/WI
   behaviour when they touch devices which we haven't
   modelled.
 * trigger EXCP_EXCEPTION_EXIT on is_exec, not !is_write
]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/armv7m.c
target/arm/cpu.c
target/arm/translate.c