qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] KVM: PPC: Override host vmx/vsx/dfp only when information known
@ 2011-10-24 18:53 Alexander Graf
  2011-10-24 23:01 ` [Qemu-devel] [Qemu-ppc] " David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2011-10-24 18:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, David Gibson

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.

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;
 }
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-24 23:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] [Qemu-ppc] " David Gibson

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).