All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Taylor Simpson <tsimpson@quicinc.com>, qemu-devel@nongnu.org
Cc: ale@rev.ng, bcain@quicinc.com, f4bug@amsat.org
Subject: Re: [PATCH] Hexagon (target/hexagon) probe the stores in a packet at start of commit
Date: Thu, 23 Sep 2021 10:05:19 -0700	[thread overview]
Message-ID: <45c6326b-2b01-1ef3-c362-dcb5a11a3d02@linaro.org> (raw)
In-Reply-To: <1632335718-13541-1-git-send-email-tsimpson@quicinc.com>

On 9/22/21 11:35 AM, Taylor Simpson wrote:
> +static inline void probe_store(CPUHexagonState *env, int slot, int mmu_idx)
> +{
> +    if (!(env->slot_cancelled & (1 << slot))) {
> +        size1u_t width = env->mem_log_stores[slot].width;
> +        target_ulong va = env->mem_log_stores[slot].va;
> +        uintptr_t ra = GETPC();
> +        probe_write(env, va, width, mmu_idx, ra);
> +    }
> +}
> +
> +void HELPER(probe_pkt_stores)(CPUHexagonState *env, int has_st0, int has_st1,
> +                              int has_dczeroa, int mmu_idx)
> +{
> +    if (has_st0 && !has_dczeroa) {
> +        probe_store(env, 0, mmu_idx);
> +    }
> +    if (has_st1 && !has_dczeroa) {
> +        probe_store(env, 1, mmu_idx);
> +    }
> +    if (has_dczeroa) {
> +        /* Probe 32 bytes starting at (dczero_addr & ~0x1f) */
> +        target_ulong va = env->dczero_addr & ~0x1f;
> +        uintptr_t ra = GETPC();
> +        probe_write(env, va +  0, 8, mmu_idx, ra);
> +        probe_write(env, va +  8, 8, mmu_idx, ra);
> +        probe_write(env, va + 16, 8, mmu_idx, ra);
> +        probe_write(env, va + 24, 8, mmu_idx, ra);
> +    }
> +}

You know at translate time the value of all of these has_* variables.

Since has_dczeroa disables the other two probes, surely probe_pkt_dczeroa should be its 
own helper.

That said, if dczeroa (apparently) cannot be paired with other stores, why do you need to 
probe for it at all?  Since the operation is 32-byte aligned, surely the first real store 
will validate the write for the entire block.

Once you eliminate dczeroa from this helper, the only time it will be called is with both 
has_st0 and has_st1 true, at which point you don't need to pass the arguments in at all.


r~


  reply	other threads:[~2021-09-24 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 18:35 [PATCH] Hexagon (target/hexagon) probe the stores in a packet at start of commit Taylor Simpson
2021-09-23 17:05 ` Richard Henderson [this message]
2021-09-24 14:19   ` Taylor Simpson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45c6326b-2b01-1ef3-c362-dcb5a11a3d02@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ale@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tsimpson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.