qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.0 3/4] target/arm: Implement th


From: Peter Maydell
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH for-4.0 3/4] target/arm: Implement the ARMv8.1-HPD extension
Date: Thu, 15 Nov 2018 17:41:41 +0000

On 2 November 2018 at 13:41, Richard Henderson
<address@hidden> wrote:
> Since the TCR_*.HPD bits were RES0 in ARMv8.0, we can simply
> interpret the bits as if ARMv8.1-HPD is present without checking.
> We will need a slightly different check for hpd for aarch32.
>
> Signed-off-by: Richard Henderson <address@hidden>

Reviewed-by: Peter Maydell <address@hidden>

Another way to write the tail end of the loop would be
to move the nstable handling up, so:

        if (mmu_idx == ARMMMUIdx_S2NS) {
            /* Stage 2 table descriptors do not include any attribute fields */
            break;
        }
        /* Merge in attributes from table descriptors */
        attrs |= nstable << 3; /* NS */
        if (!hpd) {
            /* HPD disables all the table attributes except NSTable */
            break;
        }
        attrs |= extract32(tableattrs, 0, 2) << 11; /* XN, PXN */
        attrs |= extract32(tableattrs, 3, 1) << 5; /* APTable[1] => AP[2] */
        /* The sense of AP[1] vs APTable[0] is reversed, as APTable[0] == 1
         * means "force PL1 access only", which means forcing AP[1] to 0.
         */
        if (extract32(tableattrs, 2, 1)) {
            attrs &= ~(1 << 4);
        }
        attrs |= nstable << 3; /* NS */
        break;

which would then make the hpd handling use the same
approach we already have for "don't merge attributes if
this is a stage 2 table". But don't bother changing your
patch unless you think that's actually better.

thanks
-- PMM



reply via email to

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