qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [PATCH v3 4/4] target-ppc: Handle ibm, nmi-


From: David Gibson
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH v3 4/4] target-ppc: Handle ibm, nmi-register RTAS call
Date: Tue, 11 Nov 2014 22:30:28 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Nov 11, 2014 at 12:21:49PM +0530, Aravinda Prasad wrote:
> 
> 
> On Tuesday 11 November 2014 11:41 AM, David Gibson wrote:
> > On Tue, Nov 11, 2014 at 11:18:05AM +0530, Aravinda Prasad wrote:
> >>
> >>
> >> On Tuesday 11 November 2014 08:49 AM, David Gibson wrote:
> >>> On Thu, Nov 06, 2014 at 03:30:01PM +0530, Aravinda Prasad wrote:
> >>>> On Wednesday 05 November 2014 09:16 PM, Tom Musta wrote:
> >>>>> On 11/5/2014 2:32 AM, Alexander Graf wrote:
> >>>>>> On 05.11.14 08:13, Aravinda Prasad wrote:
> >>>
> >>> [snip]
> >>>>>>> +     /*
> >>>>>>> +      * ori r3,r3,KVMPPC_H_REPORT_MC_ERR. The KVMPPC_H_REPORT_MC_ERR
> >>>>>>> +      * value is patched below
> >>>>>>> +      */
> >>>>>>> +1:   ori     3,3,0
> >>>>>
> >>>>> Why do "li 3,0" followed by "ori 3,3,X"?  Isn't this just "li 3,X" ?  
> >>>>> (aka "addi 3,0,X")
> >>>>
> >>>> I remember I first tried doing li r3,X but faced some problem (but not
> >>>> able to exactly recall what was the problem) may be due to not familiar
> >>>> with ppc assembly.
> >>>
> >>> This would be because with the offset to the private hcalls, the
> >>> actual hcall number is 0xf003, which means an li instruction will sign
> >>> extend it incorrectly. So you will need two instructions to load the
> >>> number.
> >>
> >> hmm.. ok
> > 
> > At least, I think you'll need to instructions.  I don't remember for
> > certain if 'ori 3,0,X' will OR X with literal 0 or the contents of r0.
> 
> It is ORed with r0
> 
> >From ISA:
> 
> ori RA,RS,UI
> 
> (RA) <- (RS) | (0 || UI)
> 
> The contents of register RS are ORed with 0 || UI and
> the result is placed into register RA.

Right, thought so.  So unless there's some instruction I haven't
thought of, you'll need two instructions to load the value.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpV2E7bzqRBv.pgp
Description: PGP signature


reply via email to

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