unicorn/qemu/target
Peter Maydell c61e22627d
target/arm: Fix routing of singlestep exceptions
When generating an architectural single-step exception we were
routing it to the "default exception level", which is to say
the same exception level we execute at except that EL0 exceptions
go to EL1. This is incorrect because the debug exception level
can be configured by the guest for situations such as single
stepping of EL0 and EL1 code by EL2.

We have to track the target debug exception level in the TB
flags, because it is dependent on CPU state like HCR_EL2.TGE
and MDCR_EL2.TDE. (That we were previously calling the
arm_debug_target_el() function to determine dc->ss_same_el
is itself a bug, though one that would only have manifested
as incorrect syndrome information.) Since we are out of TB
flag bits unless we want to expand into the cs_base field,
we share some bits with the M-profile only HANDLER and
STACKCHECK bits, since only A-profile has this singlestep.

Fixes: https://bugs.launchpad.net/qemu/+bug/1838913

Backports commit 8bd587c1066f4456ddfe611b571d9439a947d74c from qemu
2019-11-18 16:50:15 -05:00
..
arm target/arm: Fix routing of singlestep exceptions 2019-11-18 16:50:15 -05:00
i386 x86: setup FS & GS base 2019-08-08 20:26:45 -04:00
m68k m68k comments break patch submission due to being incorrectly formatted 2019-08-08 14:26:45 -04:00
mips Removed hardcoded CP0C3_ULRI (#1098) 2019-08-08 20:08:57 -04:00
riscv RISC-V: Clear load reservations on context switch and SC 2019-08-08 17:15:45 -04:00
sparc cpu: Introduce CPUNegativeOffsetState 2019-06-13 15:08:25 -04:00