qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH 1/3] target/ppc: always set PPC_MEM_TLBIE in pre 2


From: Greg Kurz
Subject: Re: [Qemu-ppc] [PATCH 1/3] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack
Date: Fri, 4 May 2018 07:54:19 +0200

On Fri, 4 May 2018 10:12:23 +1000
David Gibson <address@hidden> wrote:

> On Thu, May 03, 2018 at 11:16:29PM +0200, Greg Kurz wrote:
> > The pseries-2.7 and older machine types require CPUPPCState::insns_flags
> > to be strictly equal between source and destination. This checking is
> > abusive and breaks migration of KVM guests when the host CPU models
> > are different, even if they are compatible enough to allow the guest
> > to run transparently. This buggy behaviour was fixed for pseries-2.8
> > and we added some hacks to allow backward migration of older machine
> > types. These hacks assume that the CPU belongs to the POWER8 family,
> > which was true for most KVM based setup we cared about at the time.
> > But now POWER9 systems are coming, and backward migration of pre 2.8
> > guests running in POWER8 architected mode from a POWER9 host to a
> > POWER8 host is broken:
> > 
> > qemu-system-ppc64: error while loading state for instance 0x0 of device
> >  'cpu'
> > qemu-system-ppc64: load of migration failed: Invalid argument
> > 
> > This happens because POWER9 doesn't set PPC_MEM_TLBIE in insns_flags,
> > while POWER8 does. Let's force PPC_MEM_TLBIE in the migration hack to
> > fix the issue. This is an acceptable hack because these old machine
> > types only support CPU models that do set PPC_MEM_TLBIE.
> > 
> > Signed-off-by: Greg Kurz <address@hidden>
> > ---
> >  target/ppc/machine.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> > index 3d6434a006fa..ba1b9e531f97 100644
> > --- a/target/ppc/machine.c
> > +++ b/target/ppc/machine.c
> > @@ -212,6 +212,11 @@ static int cpu_pre_save(void *opaque)
> >              ;
> >          cpu->mig_msr_mask = env->msr_mask & ~metamask;
> >          cpu->mig_insns_flags = env->insns_flags & insns_compat_mask;
> > +        /* CPU models supported by old machines all have PPC_MEM_TLBIE,
> > +         * so we set it unconditionally to allow backward migration from
> > +         * a POWER9 host to a POWER8 host.  
> 
> So.. the comment's slightly misleading.  This code is common to all
> cpus, not just those used on pseries, so across that set it's not
> really accurate.  But pseries is the only machine we support migration
> to/from old versions with so it doesn't really matter.
> 

Oh... I was assuming that we only supported migration for pseries
machine, irrespective of the versions.

> > +         */
> > +        cpu->mig_insns_flags |= PPC_MEM_TLBIE;
> >          cpu->mig_insns_flags2 = env->insns_flags2 & insns_compat_mask2;
> >          cpu->mig_nb_BATs = env->nb_BATs;
> >      }
> >   
> 

Attachment: pgpcDdy2nI6kc.pgp
Description: OpenPGP digital signature


reply via email to

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