From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcce5-000602-HF for qemu-devel@nongnu.org; Wed, 24 Aug 2016 14:11:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcce1-0006N9-T9 for qemu-devel@nongnu.org; Wed, 24 Aug 2016 14:11:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcce1-0006MM-KH for qemu-devel@nongnu.org; Wed, 24 Aug 2016 14:11:21 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7OI9Ewt018895 for ; Wed, 24 Aug 2016 14:11:21 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 250qp4wknd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 Aug 2016 14:11:20 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Aug 2016 19:11:18 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 60D161B08023 for ; Wed, 24 Aug 2016 19:12:56 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7OIBGA945220030 for ; Wed, 24 Aug 2016 18:11:16 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7OIBGl9006553 for ; Wed, 24 Aug 2016 12:11:16 -0600 From: David Hildenbrand Date: Wed, 24 Aug 2016 20:11:00 +0200 In-Reply-To: <1472062266-53206-1-git-send-email-dahi@linux.vnet.ibm.com> References: <1472062266-53206-1-git-send-email-dahi@linux.vnet.ibm.com> Message-Id: <1472062266-53206-25-git-send-email-dahi@linux.vnet.ibm.com> Subject: [Qemu-devel] [Patch v3 24/30] s390x/kvm: don't enable key wrapping if msa3 is disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, jdenemar@redhat.com, imammedo@redhat.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, fiuczy@linux.vnet.ibm.com, mimu@linux.vnet.ibm.com 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 --- target-s390x/cpu_models.c | 3 +++ target-s390x/kvm.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c index abe35e1..7419bd0 100644 --- a/target-s390x/cpu_models.c +++ b/target-s390x/cpu_models.c @@ -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; diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 5de4490..8fa50f0 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -259,8 +259,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) -- 2.6.6