]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Special case M-profile in debug_helper.c code
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 25 Jul 2023 09:56:51 +0000 (10:56 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 25 Jul 2023 09:56:51 +0000 (10:56 +0100)
commit5d78893f39caf94c8587141e2219b57a7d63dd5c
tree4e29c6c8e9048088826d1574a4c105a9a2feb119
parentf9540bb1b2d35d2b0f7e831208c5f44854896cd0
target/arm: Special case M-profile in debug_helper.c code

A lot of the code called from helper_exception_bkpt_insn() is written
assuming A-profile, but we will also call this helper on M-profile
CPUs when they execute a BKPT insn.  This used to work by accident,
but recent changes mean that we will hit an assert when some of this
code calls down into lower level functions that end up calling
arm_security_space_below_el3(), arm_el_is_aa64(), and other functions
that now explicitly assert that the guest CPU is not M-profile.

Handle M-profile directly to avoid the assertions:
 * in arm_debug_target_el(), M-profile debug exceptions always
   go to EL1
 * in arm_debug_exception_fsr(), M-profile always uses the short
   format FSR (compare commit d7fe699be54b2, though in this case
   the code in arm_v7m_cpu_do_interrupt() does not need to
   look at the FSR value at all)

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1775
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230721143239.1753066-1-peter.maydell@linaro.org
target/arm/debug_helper.c