qemu/target
Peter Maydell 903dbefc2b target/arm: Don't skip MTE checks for LDRT/STRT at EL0
The LDRT/STRT "unprivileged load/store" instructions behave like
normal ones if executed at EL0. We handle this correctly for
the load/store semantics, but get the MTE checking wrong.

We always look at s->mte_active[is_unpriv] to see whether we should
be doing MTE checks, but in hflags.c when we set the TB flags that
will be used to fill the mte_active[] array we only set the
MTE0_ACTIVE bit if UNPRIV is true (i.e.  we are not at EL0).

This means that a LDRT at EL0 will see s->mte_active[1] as 0,
and will not do MTE checks even when MTE is enabled.

To avoid the translate-time code having to do an explicit check on
s->unpriv to see if it is OK to index into the mte_active[] array,
duplicate MTE_ACTIVE into MTE0_ACTIVE when UNPRIV is false.

(This isn't a very serious bug because generally nobody executes
LDRT/STRT at EL0, because they have no use there.)

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230912140434.1333369-2-peter.maydell@linaro.org
2023-09-21 16:07:13 +01:00
..
alpha target/translate: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
arm target/arm: Don't skip MTE checks for LDRT/STRT at EL0 2023-09-21 16:07:13 +01:00
avr target/translate: Include missing 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
cris target/helpers: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
hexagon hexagon: spelling fixes 2023-09-08 13:08:52 +03:00
hppa target/hppa: Wire up diag instruction to support BTLB 2023-09-19 21:12:18 +02:00
i386 target/i386: Use clmul_64 2023-09-15 13:57:00 +00:00
loongarch target/loongarch: CPUCFG support LASX 2023-09-20 14:33:43 +08:00
m68k target/m68k: Add URL to semihosting spec 2023-09-21 14:27:41 +01:00
microblaze target/translate: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
mips hw/mips: spelling fixes 2023-08-31 19:47:43 +02:00
nios2 target/helpers: Remove unnecessary 'qemu/main-loop.h' header 2023-08-31 19:47:43 +02:00
openrisc target/translate: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
ppc target/ppc: Use clmul_64 2023-09-15 13:57:00 +00:00
riscv target/riscv: don't read CSR in riscv_csrrw_do64 2023-09-11 11:45:55 +10:00
rx include/exec: Replace target_ulong with abi_ptr in cpu_[st|ld]*() 2023-08-24 11:21:46 -07:00
s390x target/s390x: Use clmul_64 2023-09-15 13:57:00 +00:00
sh4 target/translate: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
sparc target/translate: Remove unnecessary 'exec/cpu_ldst.h' header 2023-08-31 19:47:43 +02:00
tricore target/tricore: Replace gen_cond_w with tcg_gen_negsetcond_tl 2023-08-24 11:22:42 -07:00
xtensa target/xtensa: Include missing 'qemu/atomic.h' header 2023-08-31 19:47:43 +02:00
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build target/loongarch: Add target build suport 2022-06-06 18:09:03 +00:00