From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Subject: Re: [Qemu-devel] [PATCH RFT ppc-next] target-ppc: Make host CPU a subclass of the host's CPU model Date: Sat, 23 Feb 2013 22:00:05 +0100 Message-ID: <51292DD5.8020300@suse.de> References: <1361635219-13353-1-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, Gleb Natapov , Marcelo Tosatti , PowerPC , Overall , imammedo@redhat.com To: Alexander Graf Return-path: Received: from cantor2.suse.de ([195.135.220.15]:48682 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757698Ab3BWVAK (ORCPT ); Sat, 23 Feb 2013 16:00:10 -0500 In-Reply-To: <1361635219-13353-1-git-send-email-afaerber@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Am 23.02.2013 17:00, schrieb Andreas F=C3=A4rber: > This avoids assigning individual class fields and contributors > forgetting to add field assignments in KVM-only code. >=20 > ppc_cpu_class_find_by_pvr() requires the CPU model classes to be > registered, so defer host CPU type registration to kvm_arch_init(). >=20 > Only register the host CPU type if there is a class with matching PVR= =2E > This lets us drop error handling from instance_init. >=20 > Signed-off-by: Andreas F=C3=A4rber > --- > target-ppc/kvm.c | 64 ++++++++++++++++-----------------= ---------- > target-ppc/translate_init.c | 15 +++++----- > 2 Dateien ge=C3=A4ndert, 31 Zeilen hinzugef=C3=BCgt(+), 48 Zeilen en= tfernt(-) >=20 > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index e601059..0e892d0 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c [...] > @@ -1262,41 +1266,14 @@ static void kvmppc_host_cpu_initfn(Object *ob= j) > PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(obj); > =20 > assert(kvm_enabled()); > - > - if (pcc->pvr !=3D mfpvr()) { > - fprintf(stderr, "Your host CPU is unsupported.\n" > - "Please choose a supported model instead, see -cpu ?= =2E\n"); > - exit(1); > - } > } [snip] Managed to screw this one up by last minute cleanup: diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 0e892d0..994bf6d 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -1263,8 +1263,6 @@ static void alter_insns(uint64_t *word, uint64_t flags, bool on) static void kvmppc_host_cpu_initfn(Object *obj) { - PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(obj); - assert(kvm_enabled()); } Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3= =BCrnberg