qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Simpson <tsimpson@quicinc.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "ale@rev.ng" <ale@rev.ng>, Brian Cain <bcain@quicinc.com>,
	"f4bug@amsat.org" <f4bug@amsat.org>
Subject: RE: [PATCH] Hexagon (target/hexagon) probe the stores in a packet at start of commit
Date: Fri, 24 Sep 2021 14:19:57 +0000	[thread overview]
Message-ID: <BYAPR02MB4886147231A21C04ACD1AB66DEA49@BYAPR02MB4886.namprd02.prod.outlook.com> (raw)
In-Reply-To: <45c6326b-2b01-1ef3-c362-dcb5a11a3d02@linaro.org>



> -----Original Message-----
> From: Richard Henderson <richard.henderson@linaro.org>
> Sent: Thursday, September 23, 2021 12:05 PM
> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
> Cc: f4bug@amsat.org; ale@rev.ng; Brian Cain <bcain@quicinc.com>
> Subject: Re: [PATCH] Hexagon (target/hexagon) probe the stores in a packet
> at start of commit
> 
> 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.

You are correct, dczeroa can't be in a packet with any other memory op, so it could be its own helper.

We also need to account for HVX stores in the other patch series under review.  With HVX, we could have an HVX store and a scalar store in the same packet.  I'll go ahead and make the changes you suggest here.  I'll create a more general helper in the HVX series.  For efficiency, I'd like to only call a single helper that will do all the probes.  So, we'll either end up with one for each possible combination or a one for scalar only and one for the other combinations with a mask.


Thanks,
Taylor

      reply	other threads:[~2021-09-24 14:21 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
2021-09-24 14:19   ` Taylor Simpson [this message]

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=BYAPR02MB4886147231A21C04ACD1AB66DEA49@BYAPR02MB4886.namprd02.prod.outlook.com \
    --to=tsimpson@quicinc.com \
    --cc=ale@rev.ng \
    --cc=bcain@quicinc.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).