OSDN Git Service

target/arm: Rewrite check_s2_mmu_setup
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Feb 2023 22:58:32 +0000 (12:58 -1000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 6 Mar 2023 14:08:12 +0000 (14:08 +0000)
commit0ffe5b7ba883c6adbbf821f9be03475d96a2e35c
treef3acfee8711dd6086f8947cee13d0117c8d639bc
parentfcc7404eff24b4c8b322fb27ca5ae7f3113129c3
target/arm: Rewrite check_s2_mmu_setup

Integrate neighboring code from get_phys_addr_lpae which computed
starting level, as it is easier to validate when doing both at the
same time.  Mirror the checks at the start of AArch{64,32}.S2Walk,
especially S2InvalidSL and S2InconsistentSL.

This reverts 49ba115bb74, which was incorrect -- there is nothing
in the ARM pseudocode that depends on TxSZ, i.e. outputsize; the
pseudocode is consistent in referencing PAMax.

Fixes: 49ba115bb74 ("target/arm: Pass outputsize down to check_s2_mmu_setup")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230227225832.816605-5-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/ptw.c