qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] KVM: PPC: Override host vmx/vsx/dfp only when information known
Date: Tue, 25 Oct 2011 10:01:40 +1100	[thread overview]
Message-ID: <20111024230140.GA4191@truffala.fritz.box> (raw)
In-Reply-To: <1319482434-21185-1-git-send-email-agraf@suse.de>

On Mon, Oct 24, 2011 at 08:53:54PM +0200, Alexander Graf wrote:
> The -cpu host feature tries to find out the host capabilities based
> on device tree information. However, we don't always have that available
> because it's an optional property in dt.
> 
> So instead of force unsetting values depending on an unreliable source
> of information, let's just try to be clever about it and not override
> capabilities when we don't know the device tree pieces.
> 
> This fixes altivec with -cpu host on YDL PowerStations.

Yeah, this is probably the best we can do.  I forgot that we can only
really rely on the ibm,vmx property on systems with IBM firmware.  On
those it does indicate that there is no VMX if the property is
missing, but other firmwares just don't provide it at all.

> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  target-ppc/kvm.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index a090d79..f3d0861 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -912,9 +912,15 @@ const ppc_def_t *kvmppc_host_cpu_def(void)
>  
>      /* Now fix up the spec with information we can query from the host */
>  
> -    alter_insns(&spec->insns_flags, PPC_ALTIVEC, vmx > 0);
> -    alter_insns(&spec->insns_flags2, PPC2_VSX, vmx > 1);
> -    alter_insns(&spec->insns_flags2, PPC2_DFP, dfp);
> +    if (vmx != -1) {
> +        /* Only override when we know what the host supports */
> +        alter_insns(&spec->insns_flags, PPC_ALTIVEC, vmx > 0);
> +        alter_insns(&spec->insns_flags2, PPC2_VSX, vmx > 1);
> +    }
> +    if (dfp != -1) {
> +        /* Only override when we know what the host supports */
> +        alter_insns(&spec->insns_flags2, PPC2_DFP, dfp);
> +    }
>  
>      return spec;
>  }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

      reply	other threads:[~2011-10-24 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 18:53 [Qemu-devel] [PATCH] KVM: PPC: Override host vmx/vsx/dfp only when information known Alexander Graf
2011-10-24 23:01 ` David Gibson [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=20111024230140.GA4191@truffala.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).