[Pdbg] [PATCH 1/2] libpdbg: Fix address translation for p9 chiplet

Amitay Isaacs amitay at ozlabs.org
Tue Mar 10 17:10:10 AEDT 2020


On Tue, 2020-03-10 at 16:51 +1100, Alistair Popple wrote:
> On Friday, 6 March 2020 3:55:15 PM AEDT Amitay Isaacs wrote:
> > Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> > ---
> >  libpdbg/p9chip.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
> > index da7ed00..c82f00e 100644
> > --- a/libpdbg/p9chip.c
> > +++ b/libpdbg/p9chip.c
> > @@ -599,7 +599,7 @@ static int p9_chiplet_probe(struct pdbg_target
> > *target)
> > 
> >  static uint64_t p9_chiplet_translate(struct pdbg_target *target,
> > uint64_t
> > addr) {
> > -	return addr + pdbg_target_address(target, NULL);
> > +	return (addr & 0xc0ffffff) + pdbg_target_address(target, NULL);
> 
> Any reason you didn't use 0xffffffffc0ffffff to match what
> p9_scom_addr.H does? Not 
> sure if any of the other bits are used in this context, but it
> wouldn't be the 
> first time we have been burnt with mismatched address translation.

Well our tests only used the addresses up to 0xffffffff and nothing
beyond that.  And up to those addressess the 32-bit mask was good
enough.  I was trying to figure out how the addressing worked, but
figured out the mask by trial and error. :-)

Let's use the 64-bit mask as is supposed to be.

> 
> - Alistair
> 
> >  }
> > 
> >  static struct chiplet p9_chiplet = {
> 
> 
> 

Amitay.
-- 

Many a man owes his success to his first wife and his second wife to his 
success. - Jim Backus



More information about the Pdbg mailing list