diff mbox

[v2,22/29] s390x/kvm: disable host model for existing compat machines

Message ID 1470670378-53732-23-git-send-email-dahi@linux.vnet.ibm.com
State New
Headers show

Commit Message

David Hildenbrand Aug. 8, 2016, 3:32 p.m. UTC
Compatibility machines that touch runtime-instrumentation should not
be used with the CPU model. Otherwise the host model will look different,
depending on the QEMU machine QEMU has been started with.

So let's simply disable the host model for existing compatibility machines
that all disable ri.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
---
 target-s390x/kvm.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 2cc0357..3c0929b 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -2451,6 +2451,10 @@  static int configure_cpu_feat(const S390FeatBitmap features)
 
 bool kvm_s390_cpu_models_supported(void)
 {
+    if (!ri_allowed()) {
+        /* compatibility machines interfere with the cpu model */
+        return false;
+    }
     return kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,
                              KVM_S390_VM_CPU_MACHINE) &&
            kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,