qemu-e2k/target/arm
Peter Maydell 049edada5e target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1
The semantics of HSTR_EL2 require that it traps cpreg accesses
to EL2 for:
 * EL1 accesses
 * EL0 accesses, if the access is not UNDEFINED when the
   trap bit is 0

(You can see this in the I_ZFGJP priority ordering, where HSTR_EL2
traps from EL1 to EL2 are priority 12, UNDEFs are priority 13, and
HSTR_EL2 traps from EL0 are priority 15.)

However, we don't get this right for EL1 accesses which UNDEF because
the register doesn't exist at all or because its ri->access bits
non-configurably forbid the access.  At EL1, check for the HSTR_EL2
trap early, before either of these UNDEF reasons.

We have to retain the HSTR_EL2 check in access_check_cp_reg(),
because at EL0 any kind of UNDEF-to-EL1 (including "no such
register", "bad ri->access" and "ri->accessfn returns 'trap to EL1'")
takes precedence over the trap to EL2.  But we only need to do that
check for EL0 now.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230130182459.3309057-7-peter.maydell@linaro.org
Message-id: 20230127175507.2895013-7-peter.maydell@linaro.org
2023-02-03 12:59:22 +00:00
..
hvf hvf: arm: Add support for GICv3 2023-02-03 12:59:22 +00:00
a32-uncond.decode
a32.decode
arch_dump.c
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
common-semi-target.h
cpregs.h target/arm: Remove CP_ACCESS_TRAP_UNCATEGORIZED_{EL2, EL3} 2023-02-03 12:59:22 +00:00
cpu64.c target/arm: cleanup cpu includes 2023-01-05 12:28:37 +00:00
cpu_tcg.c target/arm: Add ARM Cortex-R52 CPU 2023-01-05 11:51:09 +00:00
cpu-param.h
cpu-qom.h target/arm: Convert to 3-phase reset 2022-12-16 15:58:15 +00:00
cpu.c target/arm: cleanup cpu includes 2023-01-05 12:28:37 +00:00
cpu.h target/arm: implement DBGCLAIM registers 2023-01-23 13:32:38 +00:00
crypto_helper.c
debug_helper.c target/arm: provide stubs for more external debug registers 2023-01-23 13:32:38 +00:00
gdbstub64.c
gdbstub.c
helper-a64.c
helper-a64.h
helper-mve.h
helper-sme.h target/arm/sme: Unify set_pstate() SM/ZA helpers as set_svcr() 2023-01-23 13:32:38 +00:00
helper-sve.h
helper.c target/arm: Correct syndrome for ATS12NSO* at Secure EL1 2023-02-03 12:59:22 +00:00
helper.h target/arm: Look up ARMCPRegInfo at runtime 2023-01-23 13:32:38 +00:00
hvf_arm.h
idau.h
internals.h target/arm: Enable TTBCR_EAE for ARMv8-R AArch32 2023-01-05 11:51:09 +00:00
iwmmxt_helper.c
Kconfig
kvm64.c
kvm_arm.h
kvm-consts.h hw/misc: Move some arm-related files from specific_ss into softmmu_ss 2022-12-15 17:37:47 +00:00
kvm-stub.c
kvm.c
m_helper.c target/arm: Don't set EXC_RETURN.ES if Security Extension not present 2023-01-23 13:32:38 +00:00
m-nocp.decode
machine.c target/arm: Add PMSAv8r registers 2023-01-05 11:51:09 +00:00
meson.build
monitor.c qapi machine: Elide redundant has_FOO in generated C 2022-12-14 20:04:47 +01:00
mte_helper.c target/arm: Fix physical address resolution for MTE 2023-01-23 13:32:38 +00:00
mve_helper.c
mve.decode
neon_helper.c
neon-dp.decode
neon-ls.decode
neon-shared.decode
op_addsub.h
op_helper.c target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1 2023-02-03 12:59:22 +00:00
pauth_helper.c
psci.c
ptw.c target/arm: Fix physical address resolution for Stage2 2023-02-03 12:59:21 +00:00
sme_helper.c target/arm/sme: Unify set_pstate() SM/ZA helpers as set_svcr() 2023-01-23 13:32:38 +00:00
sme-fa64.decode
sme.decode
sve_helper.c target/arm: Fix sve_probe_page 2023-01-12 16:50:19 +00:00
sve_ldst_internal.h
sve.decode
syndrome.h
t16.decode
t32.decode
tlb_helper.c target/arm: Enable TTBCR_EAE for ARMv8-R AArch32 2023-01-05 11:51:09 +00:00
trace-events
trace.h
translate-a32.h
translate-a64.c target/arm: Look up ARMCPRegInfo at runtime 2023-01-23 13:32:38 +00:00
translate-a64.h
translate-m-nocp.c
translate-mve.c
translate-neon.c
translate-sme.c
translate-sve.c
translate-vfp.c
translate.c target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1 2023-02-03 12:59:22 +00:00
translate.h target/arm: Look up ARMCPRegInfo at runtime 2023-01-23 13:32:38 +00:00
vec_helper.c
vec_internal.h
vfp_helper.c
vfp-uncond.decode
vfp.decode