qemu-patch-raspberry4/target
Peter Maydell 81621d9ab8 target/arm: Factor out code to calculate FSR for debug exceptions
When a debug exception is taken to AArch32, it appears as a Prefetch
Abort, and the Instruction Fault Status Register (IFSR) must be set.
The IFSR has two possible formats, depending on whether LPAE is in
use. Factor out the code in arm_debug_excp_handler() which picks
an FSR value into its own utility function, update it to use
arm_fi_to_lfsc() and arm_fi_to_sfsc() rather than hard-coded constants,
and use the correct condition to select long or short format.

In particular this fixes a bug where we could select the short
format because we're at EL0 and the EL1 translation regime is
not using LPAE, but then route the debug exception to EL2 because
of MDCR_EL2.TDE and hand EL2 the wrong format FSR.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180320134114.30418-3-peter.maydell@linaro.org
2018-03-23 18:26:46 +00:00
..
alpha cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
arm target/arm: Factor out code to calculate FSR for debug exceptions 2018-03-23 18:26:46 +00:00
cris cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
hppa cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
i386 HMP fixes for 2.12 2018-03-20 18:03:10 +00:00
lm32 cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
m68k -----BEGIN PGP SIGNATURE----- 2018-03-20 14:19:23 +00:00
microblaze cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
mips cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
moxie cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
nios2 cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
openrisc cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
ppc cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
riscv Machine and x86 queue, 2018-03-19 2018-03-20 12:56:20 +00:00
s390x s390x/cpumodel: fix feature groups and breakage of MSA8 2018-03-23 09:05:42 +00:00
sh4 cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
sparc cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
tilegx cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
tricore cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
unicore32 cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00
xtensa cpu: get rid of unused cpu_init() defines 2018-03-19 14:10:36 -03:00