From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCizx-0006YK-FM for qemu-devel@nongnu.org; Wed, 08 Jul 2015 02:38:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCizr-0006xw-LK for qemu-devel@nongnu.org; Wed, 08 Jul 2015 02:38:25 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:33236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCizr-0006xp-Gb for qemu-devel@nongnu.org; Wed, 08 Jul 2015 02:38:19 -0400 Received: by pdbdz6 with SMTP id dz6so45437887pdb.0 for ; Tue, 07 Jul 2015 23:38:18 -0700 (PDT) References: <1425520601-3610-1-git-send-email-aik@ozlabs.ru> <54F85756.6040904@suse.de> <55066306.9060906@ozlabs.ru> <5506B31D.1060504@suse.de> <55075D7E.8060104@ozlabs.ru> From: Alexey Kardashevskiy Message-ID: <559CC538.8080801@ozlabs.ru> Date: Wed, 8 Jul 2015 16:37:44 +1000 MIME-Version: 1.0 In-Reply-To: <55075D7E.8060104@ozlabs.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH] target-ppc: Register CPU class per family only when needed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=c3=a4rber?= , Alexander Graf , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, David Gibson Adding David to this old conversation. On 03/17/2015 09:47 AM, Alexey Kardashevskiy wrote: > On 03/16/2015 09:40 PM, Andreas Färber wrote: >> Am 16.03.2015 um 05:58 schrieb Alexey Kardashevskiy: >>> On 03/06/2015 12:17 AM, Alexander Graf wrote: >>>> On 05.03.15 02:56, Alexey Kardashevskiy wrote: >>>>> At the moment when running in KVM mode, QEMU registers "host" class to >>>>> match the current CPU PVR value. It also registers another CPU class >>>>> with a CPU family name os if we run QEMU on POWER7 machine, "host" and >>>>> "POWER7" classes are created, this way we can always use "-cpu POWER7" >>>>> on the actual POWER7 machine. >>>>> >>>>> The existing code uses DeviceClass::desc field of the CPU class as >>>>> a source for the class name; it was pointed out that it is wrong to use >>>>> user-visible string as a type name. >>>>> >>>>> This adds a common CPU class name into PowerPCCPUClass struct. >>>>> This makes registration of a CPU named after the family conditional - >>>>> PowerPCCPUClass::common_cpu_name has to be non-zero. Only POWER7/POWER8 >>>>> families have this field initialized by now. >>>>> >>>>> Signed-off-by: Alexey Kardashevskiy >>>> >>>> LGTM. Andreas, do you agree? >>> >>> >>> Ping? >> >> No, I don't agree. Inventing a new class field just to distinguish >> POWER7/POWER8 here seems like a weird idea, > > As weird as PVR itself :) > >> and the code placement is not fixed either. > > What is wrong with the code placement? > > >> I gathered that you want -cpu POWER7 and -cpu POWER8 to work on POWER8 >> hardware and -cpu POWER7 on POWER7, for migration purposes, correct? >> >> What exact PVRs have you tested on and why does it not work without >> those types despite the PVR masking? To investigate I need a test case. > > The real host is 003f 0201. -cpu POWER7 will fail without my patches as > POWER7 is alias of 003f 0203. > > Or real host 004b 0201 - -cpu POWER8 will try 004d 0100 and fail. > > >> Is this just a question of the generic family type being abstract and >> needing an updated PVR value? > > May be. That could help too I suppose. > >> Which other fields are actually used? > > Sorry, used where? :) > > > -- Alexey