From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Kardashevskiy Subject: Re: [PATCH] Revert "target-ppc: Create versionless CPU class per family if KVM" Date: Thu, 05 Mar 2015 10:50:26 +1100 Message-ID: <54F79A42.5030604@ozlabs.ru> References: <1425169895-10783-1-git-send-email-afaerber@suse.de> <54F4678D.20909@suse.de> <54F468D5.2060407@suse.de> <54F46AF7.60209@suse.de> <54F50366.6080105@ozlabs.ru> <54F61D09.2020601@suse.de> <54F63232.9090202@ozlabs.ru> <54F71CDC.7000102@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-stable@nongnu.org, Paolo Bonzini , qemu-ppc , kvm To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Alexander Graf , qemu-devel@nongnu.org Return-path: Received: from mail-pd0-f169.google.com ([209.85.192.169]:43345 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbbCDXud (ORCPT ); Wed, 4 Mar 2015 18:50:33 -0500 Received: by pdjp10 with SMTP id p10so24211128pdj.10 for ; Wed, 04 Mar 2015 15:50:33 -0800 (PST) In-Reply-To: <54F71CDC.7000102@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 03/05/2015 01:55 AM, Andreas F=C3=A4rber wrote: > Am 03.03.2015 um 23:14 schrieb Alexey Kardashevskiy: >> On 03/04/2015 07:43 AM, Alexander Graf wrote: >>> On 03.03.15 01:42, Alexey Kardashevskiy wrote: >>>> On 03/03/2015 12:51 AM, Alexander Graf wrote: >>>>> On 02.03.15 14:42, Andreas F=C3=A4rber wrote: >>>>>> Am 02.03.2015 um 14:37 schrieb Alexander Graf: >>>>>>> On 01.03.15 01:31, Andreas F=C3=A4rber wrote: >>>>>>>> This reverts commit 5b79b1cadd3e565b6d1a5ba59764bd47af58b271 t= o >>>>>>>> avoid >>>>>>>> double-registration of types: >>>>>>>> >>>>>>>> Registering `POWER5+-powerpc64-cpu' which already exists >>>>>>>> >>>>>>>> Taking the textual description of a CPU type as part of a new = type >>>>>>>> name >>>>>>>> is plain wrong, and so is unconditionally registering a new ty= pe >>>>>>>> here. >>>>>>>> >>>>>>>> Cc: Alexey Kardashevskiy >>>>>>>> Cc: qemu-stable@nongnu.org >>>>>>>> Signed-off-by: Andreas F=C3=A4rber >>>>>>> >>>>>>> Doesn't this break p8 support? >>>>>> >>>>>> Maybe, but p5 support was in longer and this is definitely a >>>>>> regression >>>>>> and really really wrong. If you know a way to fix it without >>>>>> handing it >>>>>> back to the IBM guys for more thought, feel free to give it a sh= ot. >>>>> >>>>> I honestly don't fully remember what this was about. Wasn't this = our >>>>> special KVM class that we use to create a compatible cpu type on = the >>>>> fly? >>>>> >>>>> Alexey, please take a look at it. >>>> >>>> >>>> I sent a note yesterday :-/ Here it is again: >>>> >>>> With this revert, running qemu with HV KVM and -cpu POWER7 fails o= n real >>>> POWER7 machine as my machine has pvr 003f 0201 and POWER7 is an al= ias of >>>> POWER7_v2.3 (pvr 003f 0203); and this is what I tried to fix at th= e >>>> first place. QEMU looks at classes first, and if not found - at al= iases, >>>> so this worked. >>>> >>>> I would rename "POWER5+" to "POWER5+_0.0" and make "POWER5+" an al= ias >>>> for POWER5+_v2.1 (or POWER5+_0.0). >>> >>> Care to send a patch? >> >> I wonder if Andreas has a better solution to my initial problem - he >> obviously won't like the proposed patch :) > > Quite predictable, am I? ;) > > Could you please explain in detail what problem you are seeing on POW= ER8 > without this patch? > > From your new patch it rather sounds as if this was totally unrelate= d to > -cpu host and a new KVM-only feature, reinforcing my feeling that my > function is the wrong place for your code. > > Also, as I pointed out, the description cannot safely be used as part= of > the type name, as it may contain prohibited characters, so this still > needs fixing. So I can duplicate the CPU family name in PowerPCCPUClass. Which will=20 always be the same as DeviceClass::desc. Well, it may be the right thin= g to do. > And for sure, if registering new types is indeed needed here, then a > check is needed for whether that type already exists and appropriate > error handling. I'll cook a patch for this. > I just don't understand why that is needed at all with > -cpu host taking the PVR as you say is needed here. > > If you can precisely tell me what it is that you need then I'd be hap= py > to cook up a patch. I thought I did... I need a way to run QEMU under HV KVM with a CPU nam= e,=20 just like this - -cpu POWER7 on _any_ real POWER7 CPU (v2.1, v2.3 or ev= en=20 POWER7+). Simply because all CPUs from the family behave the same. But = HV=20 KVM cannot virtualize PVR, it is a hardware limitation. So this is what= my=20 original patch fixed/bandaid'd. The original request for -cpu POWER7 vs. -cpu host came from libvirt fo= r=20 migration purposes - afair the issue was that the destination QEMU must= not=20 start if it is POWER8-host and the source is POWER7-host so trying -cpu= =20 POWER7 will fail on POWER8 (but -cpu host would work and this would be=20 wrong); but migration between POWER7 2.1 and POWER7 2.3 should still wo= rk. And in general there is no good reason why -cpu POWER7 cannot work on a= ny=20 POWER7 CPU. I could try adding a dynamic alias for "POWER7" to "host" but at the mo= ment=20 aliases are static so new dynamic class seemed simpler. --=20 Alexey