Patch "KVM: s390: fix memory overwrites when vx is disabled" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
KVM: s390: fix memory overwrites when vx is disabled
to the 4.4-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-fix-memory-overwrites-when-vx-is-disabled.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
9abc2a08a7d665b02bdde974fd6c44aae86e923eMon Sep 17 00:00:00 2001
From: David Hildenbrand <[email protected]>
Date: Thu, 14 Jan 2016 22:12:47 +0100
Subject: KVM: s390: fix memory overwrites when vx is disabled
From: David Hildenbrand <[email protected]>
commit 9abc2a08a7d665b02bdde974fd6c44aae86e923e upstream.
The kernel now always uses vector registers when available, however KVM has special logic if support is really enabled for a guest. If support is disabled, guest_fpregs.fregs will only contain memory for the fpu. The kernel, however, will store vector registers into that area, resulting in crazy memory overwrites.
Simply extending that area is not enough, because the format of the registers also changes. We would have to do additional conversions, making the code even more complex. Therefore let's directly use one place for the vector/fpu registers + fpc (in kvm_run). We just have to convert the data properly when accessing it. This makes current code much easier.
Please note that vector/fpu registers are now always stored to vcpu->run->s.regs.vrs. Although this data is visible to QEMU and used for migration, we only guarantee valid values to user space when KVM_SYNC_VRS is set. As that is only the case when we have vector register support, we are on the safe side.
--- arch/s390/include/asm/kvm_host.h | 1 arch/s390/kvm/kvm-s390.c | 128 +++++++++++++-------------------------- 2 files changed, 43 insertions(+), 86 deletions(-)
arch/s390/include/asm/kvm_host.h +0 -1
@@ -506,7 +506,6 @@ struct kvm_vcpu_arch {struct kvm_s390_sie_block *sie_block;unsigned int host_acrs[NUM_ACRS ];struct fpu host_fpregs; -struct fpu guest_fpregs;struct kvm_s390_local_interrupt local_int;struct hrtimer ckc_timer;struct kvm_s390_pgm_info pgm;
arch/s390/kvm/kvm-s390.c +43 -85
209 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/kvm-s390-fix-memory-overwrites-when-vx-is-disabled.patch queue-4.4/kvm-s390-fix-guest-fprs-memory-leak.patch