* Patch "KVM: s390: enable SIMD only when no VCPUs were created" has been added to the 4.2-stable tree
@ 2015-12-07 13:43 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-12-07 13:43 UTC (permalink / raw)
To: dahi, borntraeger, cornelia.huck, gregkh; +Cc: stable, stable-commits
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 <stable@vger.kernel.org> know about it.
>From 5967c17b118a2bd1dd1d554cc4eee16233e52bec Mon Sep 17 00:00:00 2001
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
Date: Fri, 6 Nov 2015 12:08:48 +0100
Subject: KVM: s390: enable SIMD only when no VCPUs were created
From: David Hildenbrand <dahi@linux.vnet.ibm.com>
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 <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-07 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 13:43 Patch "KVM: s390: enable SIMD only when no VCPUs were created" has been added to the 4.2-stable tree gregkh
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).