qemu-e2k/target/arm
Peter Maydell 478dccbb99 target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check
In check_s2_mmu_setup() we have a check that is attempting to
implement the part of AArch64.S2MinTxSZ that is specific to when EL1
is AArch32:

    if !s1aarch64 then
        // EL1 is AArch32
        min_txsz = Min(min_txsz, 24);

Unfortunately we got this wrong in two ways:

(1) The minimum txsz corresponds to a maximum inputsize, but we got
the sense of the comparison wrong and were faulting for all
inputsizes less than 40 bits

(2) We try to implement this as an extra check that happens after
we've done the same txsz checks we would do for an AArch64 EL1, but
in fact the pseudocode is *loosening* the requirements, so that txsz
values that would fault for an AArch64 EL1 do not fault for AArch32
EL1, because it does Min(old_min, 24), not Max(old_min, 24).

You can see this also in the text of the Arm ARM in table D8-8, which
shows that where the implemented PA size is less than 40 bits an
AArch32 EL1 is still OK with a configured stage2 T0SZ for a 40 bit
IPA, whereas if EL1 is AArch64 then the T0SZ must be big enough to
constrain the IPA to the implemented PA size.

Because of part (2), we can't do this as a separate check, but
have to integrate it into aa64_va_parameters(). Add a new argument
to that function to indicate that EL1 is 32-bit. All the existing
callsites except the one in get_phys_addr_lpae() can pass 'false',
because they are either doing a lookup for a stage 1 regime or
else they don't care about the tsz/tsz_oob fields.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1627
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230509092059.3176487-1-peter.maydell@linaro.org
2023-05-12 16:01:25 +01:00
..
hvf hvf: arm: Add support for GICv3 2023-02-03 12:59:22 +00:00
tcg target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
Kconfig target/arm: Select CONFIG_ARM_V7M when TCG is enabled 2023-05-12 15:49:20 +01:00
arch_dump.c dump: Replace opaque DumpState pointer with a typed one 2022-10-06 19:30:43 +04:00
arm-powerctl.c target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled 2023-02-27 13:27:04 +00:00
arm-powerctl.h
arm-qmp-cmds.c target/arm: Restrict 'qapi-commands-machine.h' to system emulation 2023-03-02 07:51:06 +01:00
common-semi-target.h
cortex-regs.c target/arm: Move cortex sysregs into a separate file 2023-05-02 10:21:32 +01:00
cpregs.h target/arm: Move cortex sysregs into a separate file 2023-05-02 10:21:32 +01:00
cpu-param.h target/arm: Remove `NB_MMU_MODES` define 2023-03-13 06:44:37 -07:00
cpu-qom.h target/arm: Convert to 3-phase reset 2022-12-16 15:58:15 +00:00
cpu.c target/arm: Replace `tb_pc()` with `tb->pc` 2023-03-01 07:33:25 -10:00
cpu.h target/arm: Implement FEAT_PAN3 2023-04-20 10:21:16 +01:00
cpu64.c target/arm: Move 64-bit TCG CPUs into tcg/ 2023-05-02 10:21:32 +01:00
debug_helper.c target/arm: Wrap TCG-only code in debug_helper.c 2023-02-27 13:27:04 +00:00
gdbstub.c target/arm: Report pauth information to gdb as 'pauth_v2' 2023-04-20 10:21:16 +01:00
gdbstub64.c target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
helper.c target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
helper.h target/arm: Move helper-{a64,mve,sme,sve}.h to tcg/ 2023-05-12 15:43:37 +01:00
hvf_arm.h
idau.h
internals.h target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
kvm-consts.h target/arm: Remove KVM AArch32 CPU definitions 2023-04-20 10:21:15 +01:00
kvm-stub.c
kvm.c target/arm: Initialize debug capabilities only once 2023-04-20 10:21:15 +01:00
kvm64.c target/arm: Initialize debug capabilities only once 2023-04-20 10:21:15 +01:00
kvm_arm.h target/arm: Initialize debug capabilities only once 2023-04-20 10:21:15 +01:00
machine.c target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled 2023-02-27 13:27:04 +00:00
meson.build target/arm: move cpu_tcg to tcg/cpu32.c 2023-05-02 10:54:31 +01:00
op_addsub.h
ptw.c target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
syndrome.h target/arm: Implement the HFGITR_EL2.ERET trap 2023-02-03 12:59:24 +00:00
tcg-stubs.c target/arm: Move hflags code into the tcg directory 2023-02-27 13:27:04 +00:00
trace-events
trace.h
vfp_helper.c target/arm: Improve arm_rmode_to_sf 2023-03-13 06:44:38 -07:00