All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: ravi.bangoria@linux.ibm.com, ananth@linux.ibm.com,
	jniethe5@gmail.com, paulus@samba.org,
	Sandipan Das <sandipan@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, dja@axtens.net
Subject: Re: [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation
Date: Thu, 4 Mar 2021 06:36:20 +0530	[thread overview]
Message-ID: <20210304010620.GF1913@DESKTOP-TDPLP67.localdomain> (raw)
In-Reply-To: <20210304154535.GS29191@gate.crashing.org>

On 2021/03/04 09:45AM, Segher Boessenkool wrote:
> On Wed, Mar 03, 2021 at 10:01:27PM +0530, Naveen N. Rao wrote:
> > On 2021/03/01 08:37PM, Segher Boessenkool wrote:
> > > > And, r6 always ends up with 0xaea. It changes with the value I put into 
> > > > r6 though.
> > > 
> > > That is exactly the behaviour specified for p8.  0aaa+0040=0aea.
> > > 
> > > > Granted, this is all up in the air, but it does look like there is more 
> > > > going on and the value isn't the EA or the value at the address.
> > > 
> > > That *is* the EA.  The EA is the address the insn does the access at.
> > 
> > I'm probably missing something here. 0xaaa is the value I stored at an 
> > offset of 64 bytes from the stack pointer (r1 is copied into r6). In the 
> > ldu instruction above, the EA is 64(r6), which should translate to 
> > r1+64.  The data returned by the load would be 0xaaa, which should be 
> > discarded per the description you provided above. So, I would expect to 
> > see a 0xc0.. address in r6.
> 
> Yes, I misread your code it seems.
> 
> > In fact, this looks to be the behavior documented for P9:
> > 
> > > > Power9 does:
> > > >
> > > >   Load with Update Instructions (RA = 0)
> > > >     EA is placed into R0.
> > > >   Load with Update Instructions (RA = RT)
> > > >     The storage operand addressed by EA is accessed. The 
> > > >     displacement
> > > >     field is added to the data returned by the load and placed into 
> > > >     RT.
> 
> Yup.  So on what cpu did you test?

I tested this on two processors:
2.0 (pvr 004d 0200)
2.1 (pvr 004b 0201)

I guess the behavior changed some time during P8, but I don't have a P9 
to test this on.

In any case, this souldn't matter too much for us as you rightly point 
out:

> 
> Either way, the kernel should not emulate any particular cpu here, I'd
> say, esp. since recent cpus do different things for this invalid form.

Ack.


Thanks!
- Naveen

  reply	other threads:[~2021-03-05 10:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  6:38 [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation Sandipan Das
2021-02-03  6:38 ` [PATCH v2 2/3] powerpc: sstep: Fix store " Sandipan Das
2021-02-03  6:38 ` [PATCH v2 3/3] powerpc: sstep: Fix darn emulation Sandipan Das
2021-02-03  9:49 ` [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation Naveen N. Rao
2021-02-03 10:35   ` Sandipan Das
2021-02-03 11:37   ` Sandipan Das
2021-02-04  0:53     ` Michael Ellerman
2021-02-03 21:17   ` Segher Boessenkool
2021-02-04  8:27     ` Naveen N. Rao
2021-03-02  2:37       ` Segher Boessenkool
2021-03-03 16:31         ` Naveen N. Rao
2021-03-04 15:45           ` Segher Boessenkool
2021-03-04  1:06             ` Naveen N. Rao [this message]
2021-02-04 10:29     ` David Laight

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=20210304010620.GF1913@DESKTOP-TDPLP67.localdomain \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@linux.ibm.com \
    --cc=dja@axtens.net \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sandipan@linux.ibm.com \
    --cc=segher@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.