qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/ppc: BHRB avoid using host pointer in translated code


From: Miles Glenn
Subject: Re: [PATCH] target/ppc: BHRB avoid using host pointer in translated code
Date: Tue, 27 Feb 2024 10:29:11 -0600

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 via email to

[Prev in Thread] Current Thread [Next in Thread]