public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, ehabkost@redhat.com,
	Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	PowerPC <qemu-ppc@nongnu.org>, Overall <kvm@vger.kernel.org>,
	imammedo@redhat.com
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	[thread overview]
Message-ID: <51292DD5.8020300@suse.de> (raw)
In-Reply-To: <1361635219-13353-1-git-send-email-afaerber@suse.de>

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 <afaerber@suse.de>
> ---
>  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:

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());
 }


Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

      reply	other threads:[~2013-02-23 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23 16:00 [PATCH RFT ppc-next] target-ppc: Make host CPU a subclass of the host's CPU model Andreas Färber
2013-02-23 21:00 ` Andreas Färber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51292DD5.8020300@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=gleb@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox