From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXV0A-0000Tq-Hu for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXV02-0003qS-F2 for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:19:42 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:49600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXV02-0003px-5A for qemu-devel@nongnu.org; Tue, 08 Apr 2014 08:19:34 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Apr 2014 13:19:30 +0100 Date: Tue, 8 Apr 2014 14:19:23 +0200 From: Michael Mueller Message-ID: <20140408141923.22e780a7@bee> In-Reply-To: <5343E1DB.6010302@ozlabs.ru> References: <1395638892-24481-1-git-send-email-aik@ozlabs.ru> <533E4050.3030705@ozlabs.ru> <533EA582.4090206@suse.de> <53421B2E.2060301@ozlabs.ru> <5342F446.6040303@suse.de> <53434F82.80703@ozlabs.ru> <20140408114716.2893645e@bee> <5343C9BA.2030806@ozlabs.ru> <20140408123252.67fc7ce3@bee> <5343E1DB.6010302@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH] target-ppc: enable migration within the same CPU family List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-devel@nongnu.org, Alexander Graf , qemu-ppc@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= , Bharata B Rao On Tue, 08 Apr 2014 21:47:39 +1000 Alexey Kardashevskiy wrote: > On 04/08/2014 08:32 PM, Michael Mueller wrote: > > On Tue, 08 Apr 2014 20:04:42 +1000 > > Alexey Kardashevskiy wrote: > >=20 > >> On 04/08/2014 07:47 PM, Michael Mueller wrote: > >>> On Tue, 08 Apr 2014 11:23:14 +1000 > >>> Alexey Kardashevskiy wrote: > >>> > >>>> On 04/08/2014 04:53 AM, Andreas F=C3=A4rber wrote: > >>>>> Am 07.04.2014 05:27, schrieb Alexey Kardashevskiy: > >>>>>> On 04/04/2014 11:28 PM, Alexander Graf wrote: > >>>>>>> On 04/04/2014 07:17 AM, Alexey Kardashevskiy wrote: > >>>>>>>> On 03/24/2014 04:28 PM, Alexey Kardashevskiy wrote: > >>>>>>>>> Currently only migration fails if CPU version is different even= a bit. > >>>>>>>>> For example, migration from POWER7 v2.0 to POWER7 v2.1 fails be= cause of > >>>>>>>>> that. Since there is no difference between CPU versions which c= ould > >>>>>>>>> affect migration stream, we can safely enable it. > >>>>>>>>> > >>>>>>>>> This adds a helper to find the closest POWERPC family class (i.= e. first > >>>>>>>>> abstract class in hierarchy). > >>>>>>>>> > >>>>>>>>> This replaces VMSTATE_UINTTL_EQUAL statement with a custom hand= ler which > >>>>>>>>> checks if the source and destination CPUs belong to the same fa= mily and > >>>>>>>>> fails if they are not. > >>>>>>>>> > >>>>>>>>> This adds a PVR reset to the default value as it will be overwr= itten > >>>>>>>>> by VMSTATE_UINTTL_ARRAY(env.spr, PowerPCCPU, 1024). > >>>>>>>>> > >>>>>>>>> Since the actual migration format is not changed by this patch, > >>>>>>>>> @version_id of vmstate_ppc_cpu does not have to be changed eith= er. > >>>>>>>>> > >>>>>>>>> Signed-off-by: Bharata B Rao > >>>>>>>>> Signed-off-by: Alexey Kardashevskiy > >>>>>>>> > >>>>>>>> Ping? > >>>>>>> > >>>>>>> Can't we just always allow migration to succeed? It's a problem o= f the tool > >>>>>>> stack above if it allows migration to an incompatible host, no? > >>>>>> > >>>>>> This is not how libvirt works. It simply sends the source XML, rec= onstructs > >>>>>> a guest on the destination side and then migrates. hoping that the > >>>>>> migration will fail is something (which only QEMU has knowledge of= ) is > >>>>>> incompatible. The new guest will start with "-cpu host" (as the so= urce) but > >>>>>> it will create diffrent CPU class and do different things. If we d= o not > >>>>>> check PVR (and cpu_dt_id and chip_id - the latter is coming soon) = and > >>>>>> migrate power8->power7, we can easily get a broken guest. > >>>>> > >>>>> The response is very simple: -cpu host is not supported for migrati= on. > >>>>> Same as for x86 hosts. > >>>> > >>>> Is there any good reason to limit ourselves on POWERPC? > >>>> > >>>>> As you say, the domain config is transferred by libvirt: > >>>>> If you use -cpu POWER7, you can migrate from POWER7 to POWER8 and b= ack; > >>>>> if you use -cpu POWER8, you can only migrate on POWER8. > >>>> > >>>> -cpu other that "host" is not supported by HV KVM, only "compat" whi= ch > >>>> upstream QEMU does not have yet. So you are saying that the migratio= n is > >>>> not supported by upstream QEMU for at least SPAPR. Well, ok, it is d= ead > >>>> anyway so I am fine :) > >>>> > >>> > >>> With s390x we have a similar situation. Thus we came up with a mechan= ism to limit > >>> the CPU functionality of a possible target system. Our patch implemen= ts CPU models > >>> based on TYPE and GA like 2817-ga1, etc. (GA represents a CPU facilit= y set and an IBC > >>> value (Instruction Blocking Control, reduces the instruction set to t= he requested > >>> level)) When a guest is started, it receives its CPU model by means o= f option -cpu. > >>> "host" equates the configuration of the current system. We implemente= d "query-cpu-model" > >>> returning the actual model, here maybe { name: "2817-ga1" }. To find = a suitable > >>> migration target in a remote CEC, libvirt has to "query-cpu-definitio= ns" returning a > >>> list of models supported by the target system "{{name: "2827-ga2"}, {= name: "2827-ga1"}, > >>> {name: "2817-ga2"},...]. A match means the system is suitable and can= be used > >>> as migration target. > >> > >> Sorry, I do not follow you. You hacked libvirt to run the destination = QEMU > >> with a specific CPU model? Or it is in QEMU? Where? What I see now is = this: > >> > >> static const VMStateDescription vmstate_s390_cpu =3D { > >> .name =3D "cpu", > >> .unmigratable =3D 1, > >> }; > >> > >> Does not look like it supports migration :) Thanks! > >> > >=20 > > The code you're missing is not upstream yet. The s390x guest can be mig= rated in the meantime. > > Yes, libvirt currently gets an extension to be able to identify and sta= rtup suitable migration > > targets for s390x on behalf of the mentioned qemu cpu model. BTW can yo= u point me to the above > > mentioned SPAPR stuff... >=20 >=20 > Mmm. What stuff? :) At the moment POWERPC guests migrate if PVR (processor > version register) value is exactly the same. I am trying to relax this > limitation to any version within same CPU family, like power7 v1.0 and v2= .1. With stuff I referred to to term sPAPR not realizing it relates to the Power Architecture Platform Requirements, got it now. :-) I see, ppc currently has this limitation to enforce compatibility VMSTATE_UINTTL_EQUAL(env.spr[SPR_PVR], PowerPCCPU), Thanks Michael >=20 >=20 >=20