From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Richard Henderson" <richard.henderson@linaro.org>,
<qemu-ppc@nongnu.org>
Cc: "Daniel Henrique Barboza" <danielhb413@gmail.com>,
<qemu-devel@nongnu.org>
Subject: Re: [PATCH 0/2] target/ppc: Fix PMU instruction counting
Date: Fri, 24 May 2024 09:27:29 +1000 [thread overview]
Message-ID: <D1HEW8JJFC0I.3CUC58PW2DTFB@gmail.com> (raw)
In-Reply-To: <39f33a5d-a9fd-4469-ad6d-ca0fe844f571@linaro.org>
On Thu May 23, 2024 at 8:46 AM AEST, Richard Henderson wrote:
> On 5/21/24 21:04, Nicholas Piggin wrote:
> > The crux of the problem being that dynamic exits from a TB would
> > not count instructions previously executed in the TB. I don't
> > know how important it is for PMU to count instructions exactly,
> > however for instruction replay this can lead to different counts
> > for the same execution (e.g., because TBs can be different sized)
> > and that blows up reverse debugging.
> >
> > I posted something on this out before, but missed a few things
> > (most notably faulting memory access). And found that forcing 1
> > insn per TB seems to be the only feasible way to do this.
> >
> > Sorry to ping you on this again Richard, it's not urgent but
> > you're the guru with this stuff and I'm hesitant to change it
> > without a better opinion ... Simple band aid for the meanwhile
> > could be leave it as is but just disable counting if
> > record/replay is in use.
>
> When we unwind, we know how many insns remain in the tb.
> With icount, we adjust cpu->neg.icount_decr.u16.low.
>
> My suggestion is to change restore_state_to_opc to pass in either the raw insns_left, or
> the inverse: tb->icount - insns_left.
>
> That'll be a trivial mechanical change for the signature of the hook, first.
That gives me a better place to start looking.
Thanks,
Nick
prev parent reply other threads:[~2024-05-23 23:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 4:04 [PATCH 0/2] target/ppc: Fix PMU instruction counting Nicholas Piggin
2024-05-22 4:04 ` [PATCH 1/2] target/ppc: Fix PMC5 " Nicholas Piggin
2024-05-22 4:04 ` [PATCH 2/2] target/ppc: Tidy pmu_count_insns implementation Nicholas Piggin
2024-05-22 22:46 ` [PATCH 0/2] target/ppc: Fix PMU instruction counting Richard Henderson
2024-05-23 23:27 ` Nicholas Piggin [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=D1HEW8JJFC0I.3CUC58PW2DTFB@gmail.com \
--to=npiggin@gmail.com \
--cc=danielhb413@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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.