From: Peter Maydell <peter.maydell@linaro.org>
To: Shusaku KURAMITSU <kuramitsu@ksl.ci.kyutech.ac.jp>
Cc: qemu-devel@nongnu.org
Subject: Re: tcg: Requesting clarification on return value of prepare_host_addr
Date: Mon, 8 Dec 2025 10:11:01 +0000 [thread overview]
Message-ID: <CAFEAcA8EE_HrLKCvwTYGxVUtNqiF9nRycPPihMoRyMSPzyZt4Q@mail.gmail.com> (raw)
In-Reply-To: <ca445bdd-297e-4e8d-9b44-06c1b44378e4@ksl.ci.kyutech.ac.jp>
On Mon, 8 Dec 2025 at 09:37, Shusaku KURAMITSU
<kuramitsu@ksl.ci.kyutech.ac.jp> wrote:
>
>
> On 2025/12/05 23:44, Peter Maydell wrote:
> > No; if tcg_use_softmmu is false and a_mask is zero then
> > we will not take either the if() or the else if() block,
> > and ldst will still be NULL when we return it.
> >
> > This is because:
> > * softmmu always requires a slowpath (because we might
> > look the guest address up in the TLB but not find it)
> > * linux-user mode needs a slowpath only if we need to
> > enforce alignment and atomicity checks for this
> > memory access (because linux-user always has "guest
> > address == host address + some constant", so most
> > simple loads and stores cannot fail or be complicated)
> >
> > If we don't have to do either, then we don't need the slowpath.
> Thanks for the reply! Perhaps the confusion is from what "requiring
> slowpath" means. Does that mean requiring emitting slowpath (which
> I suspect is what's happening here), or requiring jumping to
> slowpath (i.e. never using fastpath), on softmmu?
Here I meant that we must emit code for the slow path,
because we cannot guarantee that we do not need it at
runtime. (If we are in this function at all then we
know it's at least possible that we might be able to
take the fast path and handle the load/store entirely
with the inline generated code.)
The only case where we can guarantee that we do not
need a slow path and can always complete the load/store
inline is for linux-user mode when there are no alignment
or atomicity constraints.
thanks
-- PMM
next prev parent reply other threads:[~2025-12-08 10:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-05 8:38 tcg: Requesting clarification on return value of prepare_host_addr Shusaku KURAMITSU
2025-12-05 14:44 ` Peter Maydell
2025-12-08 9:37 ` Shusaku KURAMITSU
2025-12-08 10:11 ` Peter Maydell [this message]
2025-12-09 7:39 ` Shusaku KURAMITSU
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=CAFEAcA8EE_HrLKCvwTYGxVUtNqiF9nRycPPihMoRyMSPzyZt4Q@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=kuramitsu@ksl.ci.kyutech.ac.jp \
--cc=qemu-devel@nongnu.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).