From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:53240 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754652AbbLGNni (ORCPT ); Mon, 7 Dec 2015 08:43:38 -0500 Subject: Patch "KVM: s390: enable SIMD only when no VCPUs were created" has been added to the 4.2-stable tree To: dahi@linux.vnet.ibm.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 07 Dec 2015 08:43:31 -0500 Message-ID: <14494958117019@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled KVM: s390: enable SIMD only when no VCPUs were created to the 4.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-s390-enable-simd-only-when-no-vcpus-were-created.patch and it can be found in the queue-4.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 5967c17b118a2bd1dd1d554cc4eee16233e52bec Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Fri, 6 Nov 2015 12:08:48 +0100 Subject: KVM: s390: enable SIMD only when no VCPUs were created From: David Hildenbrand commit 5967c17b118a2bd1dd1d554cc4eee16233e52bec upstream. We should never allow to enable/disable any facilities for the guest when other VCPUs were already created. kvm_arch_vcpu_(load|put) relies on SIMD not changing during runtime. If somebody would create and run VCPUs and then decides to enable SIMD, undefined behaviour could be possible (e.g. vector save area not being set up). Acked-by: Christian Borntraeger Acked-by: Cornelia Huck Signed-off-by: David Hildenbrand Signed-off-by: Christian Borntraeger Signed-off-by: Greg Kroah-Hartman --- arch/s390/kvm/kvm-s390.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -289,12 +289,16 @@ static int kvm_vm_ioctl_enable_cap(struc r = 0; break; case KVM_CAP_S390_VECTOR_REGISTERS: - if (MACHINE_HAS_VX) { + mutex_lock(&kvm->lock); + if (atomic_read(&kvm->online_vcpus)) { + r = -EBUSY; + } else if (MACHINE_HAS_VX) { set_kvm_facility(kvm->arch.model.fac->mask, 129); set_kvm_facility(kvm->arch.model.fac->list, 129); r = 0; } else r = -EINVAL; + mutex_unlock(&kvm->lock); break; case KVM_CAP_S390_USER_STSI: kvm->arch.user_stsi = 1; Patches currently in stable-queue which might be from dahi@linux.vnet.ibm.com are queue-4.2/kvm-s390-sca-must-not-cross-page-boundaries.patch queue-4.2/kvm-s390-enable-simd-only-when-no-vcpus-were-created.patch queue-4.2/kvm-s390-fix-wrong-lookup-of-vcpus-by-array-index.patch queue-4.2/kvm-s390-avoid-memory-overwrites-on-emergency-signal-injection.patch