qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [QEMU-PPC] [PATCH V4 10/11] target/ppc/POWER9: Add cpu_ha


From: Suraj Jitindar Singh
Subject: Re: [Qemu-ppc] [QEMU-PPC] [PATCH V4 10/11] target/ppc/POWER9: Add cpu_has_work function for POWER9
Date: Mon, 27 Feb 2017 17:09:05 +1100

On Mon, 2017-02-27 at 12:48 +1100, Balbir Singh wrote:
> On Fri, Feb 24, 2017 at 12:05:16PM +1100, Suraj Jitindar Singh wrote:
> > 
> > The cpu has work function is used to mask interrupts used to
> > determine
> > if there is work for the cpu based on the LPCR. Add a function to
> > do this
> > for POWER9 and add it to the POWER9 cpu definition. This is similar
> > to that
> > for POWER8 except using the LPCR bits as defined for POWER9.
> > 
> > Signed-off-by: Suraj Jitindar Singh <address@hidden>
> > Reviewed-by: David Gibson <address@hidden>
> > ---
> >  target/ppc/translate_init.c | 45
> > +++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> > 
> > diff --git a/target/ppc/translate_init.c
> > b/target/ppc/translate_init.c
> > index 2d04ea7..d8f5b61 100644
> > --- a/target/ppc/translate_init.c
> > +++ b/target/ppc/translate_init.c
> > @@ -8858,10 +8858,54 @@ static bool
> > ppc_pvr_match_power9(PowerPCCPUClass *pcc, uint32_t pvr)
> >      return false;
> >  }
> >  
> > +static bool cpu_has_work_POWER9(CPUState *cs)
> > +{
> > +    PowerPCCPU *cpu = POWERPC_CPU(cs);
> > +    CPUPPCState *env = &cpu->env;
> > +
> > +    if (cs->halted) {
> > +        if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) {
> > +            return false;
> > +        }
> Do we need to check for msr_ee as well? Can we have interrupt_request
> & CPU_INTERRUPT_HARD and this function return false, looks like we
> do.

I'm not that familiar with this, I based it off the POWER8 function
very closely. But I think what you're getting at is this should be:

if (!((cs->interrupt_request & CPU_INTERRUPT_HARD) || msr_ee)) {
        return false;
}

Am I understanding correctly?


> 
> Balbir



reply via email to

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