Received: from eggs.gnu.org ([2001:4830:134:3::10]:41524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve1Ph-00084c-TG for qemu-devel@nongnu.org; Wed, 06 Nov 2013 06:36:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve1Pc-0001yh-WA for qemu-devel@nongnu.org; Wed, 06 Nov 2013 06:36:45 -0500 Date: Wed, 6 Nov 2013 12:36:16 +0100 From: Igor Mammedov Message-ID: <20131106123616.4e5b3b14@nial.usersys.redhat.com> In-Reply-To: <5278F84A.2010904@suse.de> References: <1380269200-8194-1-git-send-email-aik@ozlabs.ru> <67325DB7-EF06-49CD-BA79-6B44BCC20140@suse.de> <52496601.6040500@redhat.com> <5249754E.6070308@ozlabs.ru> <5278B4FC.6020503@redhat.com> <2B4B8088-FED7-43C5-A12F-2BDDDAB2A863@suse.de> <5278BFF0.8010004@redhat.com> <5278F84A.2010904@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] spapr: add "compat" machine option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: Peter Maydell , Nikunj A Dadhania , Alexey Kardashevskiy , Alexander Graf , QEMU Developers , Blue Swirl , qemu-ppc , Paolo Bonzini , Paul Mackerras On Tue, 05 Nov 2013 14:53:14 +0100 Andreas F=E4rber wrote: > Am 05.11.2013 10:52, schrieb Paolo Bonzini: > > Il 05/11/2013 10:16, Alexander Graf ha scritto: > >> > >> On 05.11.2013, at 10:06, Paolo Bonzini wrote: > >> > >>> Il 30/09/2013 14:57, Alexey Kardashevskiy ha scritto: > >>>>>> Why is the option under -machine instead of -cpu? > >>>> Because it is still the same CPU and the guest will still read the r= eal > >>>> PVR from the hardware (which it may not support but this is why we n= eed > >>>> compatibility mode). > >>> > >>> How do you support migration from a newer to an older CPU then? I th= ink > >>> the guest should never see anything about the hardware CPU model. > >> > >> POWER can't model that. It always leaks the host CPU information into = the guest. It's the guest kernel's responsibility to not expose that change= to user space. > >> > >> Yes, it's broken :). I'm not even sure there is any sensible way to do= live migration between different CPU types. > >=20 > > Still in my opinion it should be "-cpu", not "-machine". Even if it's > > just a "virtual" CPU model. >=20 > PowerPC currently does not have -cpu option parsing. If you need to > implement it, I would ask for a generic hook in CPUClass set by > TYPE_POWERPC_CPU, so that the logic does not get hardcoded in cpu_init, > and for the p=3Dv parsing logic to be so generic as to just set property p > to value v on the CPU instance. I.e. please make the compatibility > settings a static property or dynamic property of the CPU. Seconded, that's what is on my to-do list for x86 once x86 properties series is applied. moreover, all hook has to do is to translate -cpu to a set of global option= s, adding [CPUtype.foo, val] pairs to global option list. Then options will be automatically applied to any new instance of CPUtype and there won't be any need for accessing/storing cpu_model string during cpu creation and hotplug. >=20 > Maybe the parsing code could even live in generic qom/cpu.c, overridden > by x86/sparc and reused for arm? Somewhere down my to-do list but > patches appreciated... >=20 > Andreas >=20