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: Nicholas Piggin
Subject: Re: [PATCH] target/ppc: BHRB avoid using host pointer in translated code
Date: Tue, 20 Feb 2024 10:35:50 +1000

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



reply via email to

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