Message ID | 20200225031222.15434-2-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | target/arm: Misc cleanups surrounding TBI | expand |
On Tue, 25 Feb 2020 at 03:12, Richard Henderson <richard.henderson@linaro.org> wrote: > > Replicate the single TBI bit from TCR_EL2 and TCR_EL3 so that > we can unconditionally use pointer bit 55 to index into our > composite TBI1:TBI0 field. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > target/arm/helper.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/target/arm/helper.c b/target/arm/helper.c index 79db169e04..c1dae83700 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10297,7 +10297,8 @@ static int aa64_va_parameter_tbi(uint64_t tcr, ARMMMUIdx mmu_idx) } else if (mmu_idx == ARMMMUIdx_Stage2) { return 0; /* VTCR_EL2 */ } else { - return extract32(tcr, 20, 1); + /* Replicate the single TBI bit so we always have 2 bits. */ + return extract32(tcr, 20, 1) * 3; } } @@ -10308,7 +10309,8 @@ static int aa64_va_parameter_tbid(uint64_t tcr, ARMMMUIdx mmu_idx) } else if (mmu_idx == ARMMMUIdx_Stage2) { return 0; /* VTCR_EL2 */ } else { - return extract32(tcr, 29, 1); + /* Replicate the single TBID bit so we always have 2 bits. */ + return extract32(tcr, 29, 1) * 3; } }
Replicate the single TBI bit from TCR_EL2 and TCR_EL3 so that we can unconditionally use pointer bit 55 to index into our composite TBI1:TBI0 field. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/arm/helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1