Received: from eggs.gnu.org ([2001:4830:134:3::10]:50300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA0Es-0004vJ-4d for qemu-devel@nongnu.org; Thu, 15 Aug 2013 12:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VA0Ek-0000YD-QN for qemu-devel@nongnu.org; Thu, 15 Aug 2013 12:17:30 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Alexander Graf In-Reply-To: <520CFCE1.1020808@suse.de> Date: Thu, 15 Aug 2013 18:17:18 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7AAF2DA2-1FEF-4ECA-B220-366D94EC70C4@suse.de> <1376552735-2953-1-git-send-email-aik@ozlabs.ru> <520C8C11.6080905@ozlabs.ru> <98FAFA62-3B3A-40E9-8973-705C5F569CEE@suse.de> <520CB2EC.8060105@suse.de> <471DDE4C-6C6F-4F07-BCFB-8765AC88FEF4@suse.de> <520CBFFD.5040100@suse.de> <520CDDBF.9070909@ozlabs.ru> <520CEA00.2020404@suse.de> <520CF721.6060809@suse.de> <1964019E-D2A0-4246-82F1-E477AF891C78@suse.de> <520CFCE1.1020808@suse.de> Subject: Re: [Qemu-devel] [RFC PATCH v3] powerpc: add PVR mask support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Andreas_F=E4rber?= Cc: Anthony Liguori , Alexey Kardashevskiy , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Paul Mackerras On 15.08.2013, at 18:08, Andreas F=E4rber wrote: > Am 15.08.2013 17:51, schrieb Alexander Graf: >>=20 >> On 15.08.2013, at 17:43, Andreas F=E4rber wrote: >>=20 >>> Am 15.08.2013 17:29, schrieb Alexander Graf: >>>>=20 >>>> On 15.08.2013, at 16:47, Andreas F=E4rber wrote: >>>>=20 >>>>> There is nothing wrong with finding a mask or wildcard solution to = that >>>>> problem, I already indicated so on the original POWER+ patch. The = point >>>>> of the whole discussion is how to get there in the least invasive = way. >>>>> Not whether, just how. >>>>>=20 >>>>> I think - unlike Alex apparently - that the least invasive way is = to >>>>> leave models as they are and to add masking support to families = and KVM >>>>> code only. >>>>=20 >>>> Not sure I understand. What is KVM specific about this? >>>=20 >>> -cpu host is, it's in kvm.c. >>>=20 >>> These patches are changing sort comparison code in translate_ppc.c >>> though, which is used in multiple places. >>>=20 >>>>=20 >>>>> I'm already trying to get away from extending the >>>>> POWERPC_DEF* macros for Prerna's fw_name, which are starting to = get a >>>>> big conflict point these days and a future pain if everyone = extends them >>>>> for the feature of the day. Note that I started with reading v3, = not >>>>> everything from the start, and am therefore not pointing fingers = at >>>>> anyone. It may be that you were given some unfortunate suggestions = and >>>>> too quick in implementing them. >>>>>=20 >>>>> When we instantiate a -cpu POWER9 then having one POWER9_vX.Y = around to >>>>> back it doesn't really hurt. Unlike ARM's MIDR there doesn't seem = to be >>>>> an encoding of IBM vendor or POWER family in the PVR. The macros = and >>>>> their new implementation are not the way they are because I = consider >>>>> them the nicest thing in the world but because the = name+pvr+svr+family >>>>> combination made them work for the whole zoo of models we carry = around >>>>> and started to give us some inheritance through QOM. Making the = POWER7 >>>>> family non-abstract would require the same kind of macro = "overloading" >>>>> for POWERPC_FAMILY that I'm trying to contain for POWERPC_DEF ATM. = So >>>>> what I am still thinking about is how to handle there being = multiple >>>>> matches for a PVR - I am considering putting them into a list and >>>>> comparing values for closest match. So that if you have a v2.4 and = QEMU >>>>> knows v2.1 and v2.3 we take v2.3 and fill in the v2.4 PVR. >>>>=20 >>>> I think this goes into the wrong direction. We should have one = single unified scheme to model core versions and -cpu host should be = able to override them for a family, no? I don't see how instantiating a = POWER7_v20 object on a POWER7_v23 system is any improvement over = instantiating a POWER7 object. >>>=20 >>> There is no one unified scheme, as we have discussed in your = absence. >>>=20 >>> My point is, a) -cpu POWER7 should result in valid values >>=20 >> Yes :) >=20 > ...which requires a specific vX.Y PVR in addition to the mask, i.e. a > model in our current terms. :) >=20 > Consider that there may be differences between models within one = family, > otherwise there would be little point to distinguish them. >=20 >>> and b) you >>> asked to have a unified macro scheme that works for all CPUs, you = got >>> it, now instead you are asking for something that is nice to POWERx, = and >>> we cannot make POWERx family different from the rest wrt macros = unless >>> we break the scheme, which you specifically wanted to have, to avoid >>> boilerplate QOM code you said. Now you want the full customization >>> goodness that you were against just before! :) >>=20 >> Ah, nonono, I don't want POWER to be any different. I want things = unified and consistent. Any time I mention "POWER7" I also mean "e500" = or "440" or any other family class we have out there. >>=20 >> What I was proposing was to make _all_ families non-abstract and have = _all_ families support major/minor parameters. >=20 > Again, I pointed out looong ago on the POWER7+ patch > http://patchwork.ozlabs.org/patch/264176/ > (which you really could've looked up yourself by now!) > that major/minor does not apply to all CPUs. It works for POWER and = for > e500, but that's about it. I specifically gave 440 as an example where > it doesn't! Even 440 cores seem to have a matching mask, at least in Linux: { .pvr_mask =3D 0xf0000fff, .pvr_value =3D 0x40000850, .cpu_name =3D "440GR Rev. A", .cpu_features =3D CPU_FTRS_44X, .cpu_user_features =3D COMMON_USER_BOOKE, .mmu_features =3D MMU_FTR_TYPE_44x, .icache_bsize =3D 32, .dcache_bsize =3D 32, .machine_check =3D machine_check_4xx, .platform =3D "ppc440", }, But you're right, there isn't as much of a scheme to them as with the = others. So for 440 we would need the intermediate level to allow for = multiple PVR matches. So you're saying you'd just always make families abstract and have the = pvr mask matching happen on actual core revisions? That just feels gross = somehow. Meh. > Note that there's no strict necessity for "host" to be derived from = any > existing model, it seemed convenient to me at the time. It could just = as > well be created in-place in KVM code iff you can figure out via ioctls > or assembly code what MMU, flags, etc. to fill in beyond PVR - not = sure > which fields are even relevant for KVM, I just looked for patterns and > possible OOD / build-time optimizations in that code. :) I think it makes a lot of sense to share the existing CPU table = infrastructure. Alex