qemu-e2k/target
Peter Maydell 7142eb9e24 target/arm: Get correct MMU index for other-security-state
In arm_v7m_mmu_idx_for_secstate() we get the 'priv' level to pass to
armv7m_mmu_idx_for_secstate_and_priv() by calling arm_current_el().
This is incorrect when the security state being queried is not the
current one, because arm_current_el() uses the current security state
to determine which of the banked CONTROL.nPRIV bits to look at.
The effect was that if (for instance) Secure state was in privileged
mode but Non-Secure was not then we would return the wrong MMU index.

The only places where we are using this function in a way that could
trigger this bug are for the stack loads during a v8M function-return
and for the instruction fetch of a v8M SG insn.

Fix the bug by expanding out the M-profile version of the
arm_current_el() logic inline so it can use the passed in secstate
rather than env->v7m.secure.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201022164408.13214-1-peter.maydell@linaro.org
2020-11-02 16:52:17 +00:00
..
alpha cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
arm target/arm: Get correct MMU index for other-security-state 2020-11-02 16:52:17 +00:00
avr qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
cris qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
hppa qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
i386 * Drop ninjatool and just require ninja (Paolo) 2020-10-17 20:52:55 +01:00
lm32 qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
m68k qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
microblaze qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
mips target/mips: Increase number of TLB entries on the 34Kf core (16 -> 64) 2020-10-17 13:59:40 +02:00
moxie qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
nios2 qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
openrisc qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
ppc ppc/: fix some comment spelling errors 2020-10-28 01:08:53 +11:00
riscv target/riscv: raise exception to HS-mode at get_physical_address 2020-10-22 12:00:22 -07:00
rx target/rx: Fix Lesser GPL version number 2020-10-27 00:22:56 +01:00
s390x s390x: pv: Fix diag318 PV fencing 2020-10-22 15:47:27 +02:00
sh4 target/sh4: fix some comment spelling errors 2020-10-27 00:22:56 +01:00
sparc target/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry 2020-10-13 13:33:46 +02:00
tilegx qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
tricore qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
unicore32 qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
xtensa target/xtensa: enable all coprocessors for linux-user 2020-10-26 12:07:19 +01:00
meson.build