qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [RFC] powernv: CPU compatibility modes don't


From: David Gibson
Subject: Re: [Qemu-ppc] [Qemu-devel] [RFC] powernv: CPU compatibility modes don't make sense for powernv
Date: Fri, 28 Oct 2016 22:14:12 +1100
User-agent: Mutt/1.7.1 (2016-10-04)

On Fri, Oct 28, 2016 at 11:32:43AM +0200, Greg Kurz wrote:
> On Fri, 28 Oct 2016 13:05:01 +1100
> David Gibson <address@hidden> wrote:
> 
> > powernv has some code (derived from the spapr equivalent) used in device
> > tree generation which depends on the CPU's compatibility mode / logical
> > PVR.  However, compatibility modes don't make sense on powernv - at least
> > not as a property controlled by the host - because the guest in powernv
> > has full hypervisor level access to the virtual system, and so owns the
> > PCR (Processor Compatibility Register) which implements compatiblity modes.
> > 
> 
> This makes a lot of sense indeed.
> 
> > Signed-off-by: David Gibson <address@hidden>
> > ---
> >  hw/ppc/pnv.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > Hi Cédric, I'd appreciate it if you can double check my reasoning
> > here.  This patch gets powernv out of the way of a bunch of
> > compatibility mode cleanups I have in the works.
> > 
> > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> > index 82276e0..6af3424 100644
> > --- a/hw/ppc/pnv.c
> > +++ b/hw/ppc/pnv.c
> > @@ -110,7 +110,7 @@ static void powernv_create_core_node(PnvChip *chip, 
> > PnvCore *pc, void *fdt)
> >      CPUState *cs = CPU(DEVICE(pc->threads));
> >      DeviceClass *dc = DEVICE_GET_CLASS(cs);
> >      PowerPCCPU *cpu = POWERPC_CPU(cs);
> > -    int smt_threads = ppc_get_compat_smt_threads(cpu);
> > +    int smt_threads = CPU_CORE(pc)->nr_threads;
> 
> Not speaking of the PCR, this has also another effect since 
> ppc_get_compat_smt_threads() also take the KVM smt capability
> into account:
> 
>     int ret = MIN(cs->nr_threads, kvmppc_smt_threads());
> 
> Shouldn't you do the same here ?

Actually, no, though possible that needs mention in the commit
message.  I'm pretty sure there are checks elsewhere that ensure
nr_threads <= kvmppc_smt_threads().  If not, having more virtual
threads than kvmppc allows certainly can't work, so we're no more
broken than before.

Plus, kvmppc_smt_threads() is really only relevant for KVM HV which
doesn't, and can't support the powernv machine type anyway.

-- 
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: signature.asc
Description: PGP signature


reply via email to

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