target/arm: Honour MDCR_EL2.TDE when routing exceptions due to BKPT/BRK
commitc900a2e62dd6dde11c8f5249b638caad05bb15be
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 23 Mar 2018 18:26:46 +0000 (23 18:26 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 23 Mar 2018 18:26:46 +0000 (23 18:26 +0000)
tree8e3892e6c2310de09348acadd594c96a9f69d52c
parentdfadc3bfb458efefb72e13a57b62f138c464a577
target/arm: Honour MDCR_EL2.TDE when routing exceptions due to BKPT/BRK

The MDCR_EL2.TDE bit allows the exception level targeted by debug
exceptions to be set to EL2 for code executing at EL0.  We handle
this in the arm_debug_target_el() function, but this is only used for
hardware breakpoint and watchpoint exceptions, not for the exception
generated when the guest executes an AArch32 BKPT or AArch64 BRK
instruction.  We don't have enough information for a translate-time
equivalent of arm_debug_target_el(), so instead make BKPT and BRK
call a special purpose helper which can do the routing, rather than
the generic exception_with_syndrome helper.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180320134114.30418-2-peter.maydell@linaro.org
target/arm/helper.h
target/arm/op_helper.c
target/arm/translate-a64.c
target/arm/translate.c