From: Stephane Duverger <stephane.duverger@free.fr>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: x86 TCG helpers clobbered registers
Date: Mon, 7 Dec 2020 11:10:29 +0100 [thread overview]
Message-ID: <20201207101029.GA96540@wise> (raw)
In-Reply-To: <5718f49e-8e17-17ae-45ec-94347f0a009d@linaro.org>
On Sat, Dec 05, 2020 at 06:38:25AM -0600, Richard Henderson wrote:
> The difference is that the slow path is aware that there are input registers
> that are live, containing data (addrlo, addrhi, datalo, datahi), which must be
> stored into the arguments for the slow path call. Those input registers (and
> all other call-clobbered registers) are dead *after* the slow path call.
>
> You are injecting your filter call while those input registers are still live.
> They will be next used by the fast-path store.
>
> That is a very significant difference.
Ok. That's why I saved REG_L1 (prepared by tlb_load) for both
st/ld_direct use, plus datalo for st_direct only. I saw datahi is only
used for MO_64 on 32bits tcg-target. And I better understand it thanks
to you.
This leads me to that simple reflection:
If we want to filter on every memory accesses, *out of the fast-path*,
the most natural place to do so would be in store_helper() and
load_helper() from accel/tcg/cputlb.c. By doing so, every target would
benefit from filtering, and even specific helpers using cpu_ldst
functions would be intercepted. No ?
For the remaining fast-path case, it could be interesting to generate
it this time at IR level (tlb_load, jne to slow_path, direct
load/store) ? Again every target would benefit from filtering without
the need for a specific fast-path implementation in
tcg/<arch>/tcg-target.c.inc
Wouldn't it be simplier than actual mem plugin implementation, which
generate fitler callback *after* load/store and has specific extra
work for tracking memory accesses performed from helpers (afaiu) ?
next prev parent reply other threads:[~2020-12-07 10:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 15:36 x86 TCG helpers clobbered registers Stephane Duverger
2020-12-04 19:35 ` Richard Henderson
2020-12-05 1:34 ` Stephane Duverger
2020-12-05 12:38 ` Richard Henderson
2020-12-07 10:10 ` Stephane Duverger [this message]
2020-12-08 21:18 ` Richard Henderson
2020-12-08 22:39 ` Stephane Duverger
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=20201207101029.GA96540@wise \
--to=stephane.duverger@free.fr \
--cc=pbonzini@redhat.com \
--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 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.