qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r


From: Peter Maydell
Subject: Re: [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r
Date: Thu, 16 Apr 2020 14:26:32 +0100

On Wed, 11 Mar 2020 at 06:44, Richard Henderson
<address@hidden> wrote:
>
> First use of the new helper functions, so we can remove the
> unused markup.  No longer need a scratch for user-only, as
> we completely probe the page set before reading; system mode
> still requires a scratch for MMIO.
>
> Signed-off-by: Richard Henderson <address@hidden>

> +    /* The entire operation is in RAM, on valid pages. */
> +
> +    memset(vd, 0, reg_max);
> +    mem_off = info.mem_off_first[0];
> +    reg_off = info.reg_off_first[0];
> +    reg_last = info.reg_off_last[0];
> +    host = info.page[0].host;
> +
> +    while (reg_off <= reg_last) {
> +        uint64_t pg = vg[reg_off >> 6];
> +        do {
> +            if ((pg >> (reg_off & 63)) & 1) {
> +                host_fn(vd, reg_off, host + mem_off);
> +            }
> +            reg_off += 1 << esz;
> +            mem_off += 1 << msz;
> +        } while (reg_off <= reg_last && (reg_off & 63));
> +    }
> +
> +    /*
> +     * Use the slow path to manage the cross-page misalignment.
> +     * But we know this is RAM and cannot trap.
> +     */
> +    mem_off = info.mem_off_split;
> +    if (unlikely(mem_off >= 0)) {
> +        tlb_fn(env, vd, info.reg_off_split, addr + mem_off, retaddr);
> +    }
> +
> +    mem_off = info.mem_off_first[1];
> +    if (unlikely(mem_off >= 0)) {
> +        reg_off = info.reg_off_first[1];
> +        reg_last = info.reg_off_last[1];
> +        host = info.page[1].host;
> +
> +        do {
> +            uint64_t pg = vg[reg_off >> 6];
> +            do {
> +                if ((pg >> (reg_off & 63)) & 1) {
> +                    host_fn(vd, reg_off, host + mem_off);
> +                }
> +                reg_off += 1 << esz;
> +                mem_off += 1 << msz;
> +            } while (reg_off & 63);
> +        } while (reg_off <= reg_last);

Does this loop for the second page need to be phrased
differently than the loop for the first page was? I was
expecting the two chunks of code to be identical, and they
almost are, but not quite...

Either way
Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

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