qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Miles Glenn <milesg@linux.vnet.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/ppc: BHRB avoid using host pointer in translated code
Date: Tue, 27 Feb 2024 10:29:11 -0600	[thread overview]
Message-ID: <af7922a11d56827c097cadd9ba9a40a0f4fb62aa.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <CZ9HHCWQR3MT.1U5CJ7CBIR1EH@wheely>

On Tue, 2024-02-20 at 10:35 +1000, Nicholas Piggin wrote:
> On Fri Feb 16, 2024 at 3:50 AM AEST, Peter Maydell wrote:
> > On Thu, 15 Feb 2024 at 17:16, Nicholas Piggin <npiggin@gmail.com>
> > wrote:
> > > Calculate the BHRB base from arithmetic on the tcg_env target
> > > ptr.
> > > 
> > > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > > ---
> > > Hi Glenn,
> > > 
> > > I think I have to squash this into the BHRB series. 32-bit host
> > > compile shows up a size mismatch warning... I think it's not
> > > quite
> > > right to be using host pointer directly in target code. The
> > > change
> > > of offset and mask to 32-bit is needed due to to seemingly
> > > missing
> > > tl->ptr conversion helpers, but 32-bit is okay for those anyway.
> > 
> > There's nothing inherently wrong with it (depending on what the
> > pointer is pointing to!), but you need to use the right type.
> 
> Ah okay, thanks for the correction.
> 
> > target_ulong and the _tl suffix are for the type which
> > depends on the size of the target's 'long'. The TCG type which is
> > "size of a host pointer" is TCG_TYPE_PTR, and you want the _ptr
> > suffix functions and to pass it around with TCGv_ptr.
> 
> In that case, original approach may be better with small fixes
> for 32-bit host.
> 
> Thanks,
> Nick

Peter/Nick, thanks for looking into this.  I'll work on submitting
a v4 of the original BHRB series adding Peter's suggestions (and
probably a rebase) as soon as I have a chance.  Unfortunately, I have
some higher priority items to work on at the moment, so it could take
a week or two before I can get to it.

Thanks,
Glenn



  reply	other threads:[~2024-02-27 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 17:15 [PATCH] target/ppc: BHRB avoid using host pointer in translated code Nicholas Piggin
2024-02-15 17:50 ` Peter Maydell
2024-02-20  0:35   ` Nicholas Piggin
2024-02-27 16:29     ` Miles Glenn [this message]
2024-02-15 19:42 ` Richard Henderson
2024-02-20  0:28   ` Nicholas Piggin

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=af7922a11d56827c097cadd9ba9a40a0f4fb62aa.camel@linux.vnet.ibm.com \
    --to=milesg@linux.vnet.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).