From patchwork Sat Feb 23 21:00:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 222747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3DF062C02B1 for ; Sun, 24 Feb 2013 08:00:41 +1100 (EST) Received: from localhost ([::1]:45256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9MD1-0000Y9-DI for incoming@patchwork.ozlabs.org; Sat, 23 Feb 2013 16:00:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9MCn-0000XS-R5 for qemu-devel@nongnu.org; Sat, 23 Feb 2013 16:00:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9MCb-0005Ti-J4 for qemu-devel@nongnu.org; Sat, 23 Feb 2013 16:00:25 -0500 Received: from cantor2.suse.de ([195.135.220.15]:48680 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9MCb-0005P3-9s; Sat, 23 Feb 2013 16:00:13 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2E624A520C; Sat, 23 Feb 2013 22:00:09 +0100 (CET) Message-ID: <51292DD5.8020300@suse.de> Date: Sat, 23 Feb 2013 22:00:05 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Organization: SUSE LINUX Products GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alexander Graf References: <1361635219-13353-1-git-send-email-afaerber@suse.de> In-Reply-To: <1361635219-13353-1-git-send-email-afaerber@suse.de> X-Enigmail-Version: 1.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Gleb Natapov , Overall , Marcelo Tosatti , qemu-devel@nongnu.org, PowerPC , imammedo@redhat.com, ehabkost@redhat.com Subject: Re: [Qemu-devel] [PATCH RFT ppc-next] target-ppc: Make host CPU a subclass of the host's CPU model X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 23.02.2013 17:00, schrieb Andreas Färber: > This avoids assigning individual class fields and contributors > forgetting to add field assignments in KVM-only code. > > ppc_cpu_class_find_by_pvr() requires the CPU model classes to be > registered, so defer host CPU type registration to kvm_arch_init(). > > Only register the host CPU type if there is a class with matching PVR. > This lets us drop error handling from instance_init. > > Signed-off-by: Andreas Färber > --- > target-ppc/kvm.c | 64 ++++++++++++++++--------------------------- > target-ppc/translate_init.c | 15 +++++----- > 2 Dateien geändert, 31 Zeilen hinzugefügt(+), 48 Zeilen entfernt(-) > > 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 *obj) > PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(obj); > > assert(kvm_enabled()); > - > - if (pcc->pvr != mfpvr()) { > - fprintf(stderr, "Your host CPU is unsupported.\n" > - "Please choose a supported model instead, see -cpu ?.\n"); > - exit(1); > - } > } [snip] Managed to screw this one up by last minute cleanup: Andreas 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 = POWERPC_CPU_GET_CLASS(obj); - assert(kvm_enabled()); }