Received: from eggs.gnu.org ([2001:4830:134:3::10]:40968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9xgf-0005Oy-7E for qemu-devel@nongnu.org; Thu, 15 Aug 2013 09:34:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9xgS-0004Ob-9V for qemu-devel@nongnu.org; Thu, 15 Aug 2013 09:34:01 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <87vc37qerm.fsf@codemonkey.ws> Date: Thu, 15 Aug 2013 15:33:43 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <90CC2F22-E933-47BB-82DC-CB4931A7EC93@suse.de> References: <1376537732-29300-1-git-send-email-aik@ozlabs.ru> <283AA2CE-F23C-4218-B28A-3779D6BA549B@suse.de> <520C6AC6.6010708@ozlabs.ru> <25583D8C-4023-4E78-9B5E-2E3970FB301E@suse.de> <1376548221.4255.103.camel@pasglop> <87vc37qerm.fsf@codemonkey.ws> Subject: Re: [Qemu-devel] [RFC PATCH] powerpc: add PVR mask support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alexey Kardashevskiy , "qemu-devel@nongnu.org" , "qemu-ppc@nongnu.org" , Paul Mackerras , =?iso-8859-1?Q?Andreas_F=E4rber?= On 15.08.2013, at 15:12, Anthony Liguori wrote: > Benjamin Herrenschmidt writes: >=20 >> On Thu, 2013-08-15 at 08:03 +0200, Alexander Graf wrote: >>=20 >>>>> How does the user select that he wants a v2.3 p7 cpu with this >>> patch? >>>>=20 >>>> Why would he want that? The behaviour would not change because of >>> the >>>> version - all definitions use the same POWERPC_FAMILY(POWER7) and >>> PVR is >>>> not virtualized anyway. >>>=20 >>> Quite frankly I don't know what to say here. Are you trying to play >>> dumb or are you just one of those totally sloppy people who don't = care >>> about anything outside of their own scope of work? >>=20 >> Can you stop the bloody personal attacks on Alexey ? It's becoming >> tiresome. >=20 >=20 > First, everyone needs to tone it down a couple levels. This isn't = LKML > and Jonathan Corbet doesn't read qemu-devel so pithy remarks aren't > going to get you a quote of the week. >=20 > Everyone is talking past each other and no one is addressing the real > problem. There are two distinct issues here: >=20 > 1) We have two ABIs that cannot be changed unless there's a very good > reason to. Alexey's original patch breaks both. The guest ABI > cannot change given a fixed command line. >=20 > IOW, the exposed PVR value for -cpu POWER7 cannot change across > versions of QEMU or when running on different hardware. This breaks > live migration and save/resume. >=20 > We also cannot break the command line interface. If the last = version > of QEMU supported -cpu POWER7_v2.1, then we must continue to support > that. >=20 > If there's a good reason to break either of these, that's fine but > that justification needs be up front in the patch commit message. >=20 > 2) The only "-cpu" that makes sense is "-cpu host" for KVM on HV (or > whatever ya'll call it). POWER does not have the ability to > virtualize the hardware PVR value. There is a virtual PVR in the > device tree but that's orthogonal to what we think of as the VCPU = (it > essentially means IIUC that the cpu is compatible with that PVR). >=20 > We should explicitly disallow any -cpu value when KVM on HV is > enabled other than host. With Paulus' latest patches we can support HV and PR dynamically on the = same host kernel, so there's no way to figure out whether we are in an = HV or PR environment. The semantic we probably want there is that -cpu host (and anything that = looks the same from KVM's point of view, basically guest_pvr =3D=3D = host_pvr) and PAPR enabled triggers HV KVM. If we ever support compat = mode with HV KVM, that PVR will also enable HV KVM. What we need in addition is a query interface so that QEMU can find out = whether we are in HV or PR mode. That way we can add a machine force = option that allows us to bail out when we're falling back to PR mode in = case that's not what the user wanted. > The implementation of "-cpu host" is also goofy on PPC. -cpu host > does a match on existing CPU models meaning that we have to define a > CPU model for any possible CPU we run on. This would require having > every possible CPU model implemented in QEMU which is silly. > Instead, we should have a passthrough CPU model for use with "-cpu > host" which is essentially what Alexey's patch turns -cpu POWER7 > into. The world isn't that easy unfortunately. We basically need one = "passthrough CPU model" for each CPU class, since different CPUs can = have different features and MMU implementations which QEMU does care = about. That's basically what the conclusion of the discussion was too. That we = need to be able to instantiate the CPU family class (which currently is = abstract) which then serves as entry point for -cpu host (and -cpu = hopefully). Alex