qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] target/arm: Fix select for aa64_va_parameters_both


From: Peter Maydell
Subject: Re: [PATCH v2 1/2] target/arm: Fix select for aa64_va_parameters_both
Date: Thu, 13 Feb 2020 13:12:11 +0000

On Tue, 11 Feb 2020 at 19:42, Richard Henderson
<address@hidden> wrote:
>
> Select should always be 0 for a regime with one range.
>
> Signed-off-by: Richard Henderson <address@hidden>

This change makes sense, and matches what aa32_va_parameters() does,
but I think we need to update some of the callsites.

(1) In get_phys_addr_lpae() we have the check:

        if (-top_bits != param.select || (param.select && !ttbr1_valid)) {

where ttbr1_valid is the return value of (effectively)
 aarch64 ? regime_has_2_ranges() : (el != 2);
but I think it's no longer possible to get here with param.select == 1
and !ttbr1_valid, so this becomes a dead check.
(Side note, could we pull "ttbr1_valid = regime_has_2_ranges(mmu_idx);"
out of the "if (aarch64) {...} else {...}"  ? -- I think it works for
aarch32 too, right?)

(2) in pauth_original_ptr() we do
    uint64_t extfield = -param.select;
but in the pseudocode Auth() function the extfield is unconditionally
calculated based on bit 55 of the address, regardless of whether
the regime has 1 range or 2. So I think this code can't use
param.select any more but should simply pull out and replicate
bit 55 of its 'ptr' argument, now that param.select is not simply
the value of bit 55.


Change 1 would need to be done after this patch and change 2 before it.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]