]> Git Repo - qemu.git/commitdiff
s390x/kvm: don't enable key wrapping if msa3 is disabled
authorDavid Hildenbrand <[email protected]>
Mon, 5 Sep 2016 08:52:38 +0000 (10:52 +0200)
committerCornelia Huck <[email protected]>
Tue, 6 Sep 2016 15:06:51 +0000 (17:06 +0200)
As the CPU model now controls msa3, trying to set wrapping keys without
msa3 being around/enable in the kernel will produce misleading errors.

So let's simply not configure key wrapping if msa3 is not enabled and
make compat machines with disabled CPU model work correctly.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20160905085244[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
target-s390x/cpu_models.c
target-s390x/kvm.c

index 5b9f35ee8757c67ac343b96c194926e7370bcf35..d1e1a5f7c07877c91ec719f8bec8d5c0f3dbde80 100644 (file)
@@ -155,6 +155,9 @@ bool s390_has_feat(S390Feat feat)
             if (feat == S390_FEAT_RUNTIME_INSTRUMENTATION) {
                 return kvm_s390_get_ri();
             }
+            if (feat == S390_FEAT_MSA_EXT_3) {
+                return true;
+            }
         }
 #endif
         return 0;
index 82a07ae49c3136288644e3a3312b0400cf5c1f1a..dfaf1ca8d1721c3310de9aac29167805100ed577 100644 (file)
@@ -260,8 +260,10 @@ static void kvm_s390_init_dea_kw(void)
 
 void kvm_s390_crypto_reset(void)
 {
-    kvm_s390_init_aes_kw();
-    kvm_s390_init_dea_kw();
+    if (s390_has_feat(S390_FEAT_MSA_EXT_3)) {
+        kvm_s390_init_aes_kw();
+        kvm_s390_init_dea_kw();
+    }
 }
 
 int kvm_arch_init(MachineState *ms, KVMState *s)
This page took 0.031062 seconds and 4 git commands to generate.