Skip to content

Commit

Permalink
target/arm: Fix TLBIRange.base for 16k and 64k pages
Browse files Browse the repository at this point in the history
The shift of the BaseADDR field depends on the translation
granule in use.

Fixes: 84940ed ("target/arm: Add support for FEAT_TLBIRANGE")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220301215958.157011-14-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
rth7680 authored and pm215 committed Mar 2, 2022
1 parent ab1cdb4 commit d976de2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions target/arm/helper.c
Expand Up @@ -4538,10 +4538,11 @@ static TLBIRange tlbi_aa64_get_range(CPUARMState *env, ARMMMUIdx mmuidx,
ret.length = (num + 1) << (exponent + page_shift);

if (regime_has_2_ranges(mmuidx)) {
ret.base = sextract64(value, 0, 37) << TARGET_PAGE_BITS;
ret.base = sextract64(value, 0, 37);
} else {
ret.base = extract64(value, 0, 37) << TARGET_PAGE_BITS;
ret.base = extract64(value, 0, 37);
}
ret.base <<= page_shift;

return ret;
}
Expand Down

0 comments on commit d976de2

Please sign in to comment.