Skip to content

Commit 9522b37

Browse files
David Hildenbrandbonzini
authored andcommitted
KVM: s390: correct fprs on SIGP (STOP AND) STORE STATUS
With MACHINE_HAS_VX, we convert the floating point registers from the vector registeres when storing the status. For other VCPUs, these are stored to vcpu->run->s.regs.vrs, but we are using current->thread.fpu.vxrs, which resolves to the currently loaded VCPU. So kvm_s390_store_status_unloaded() currently writes the wrong floating point registers (converted from the vector registers) when called from another VCPU on a z13. This is only the case for old user space not handling SIGP STORE STATUS and SIGP STOP AND STORE STATUS, but relying on the kernel implementation. All other calls come from the loaded VCPU via kvm_s390_store_status(). Fixes: 9abc2a0 (KVM: s390: fix memory overwrites when vx is disabled) Reviewed-by: Christian Borntraeger <[email protected]> Cc: [email protected] # v4.4+ Signed-off-by: David Hildenbrand <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 8bb9b9c commit 9522b37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long gpa)
23812381

23822382
/* manually convert vector registers if necessary */
23832383
if (MACHINE_HAS_VX) {
2384-
convert_vx_to_fp(fprs, current->thread.fpu.vxrs);
2384+
convert_vx_to_fp(fprs, (__vector128 *) vcpu->run->s.regs.vrs);
23852385
rc = write_guest_abs(vcpu, gpa + __LC_FPREGS_SAVE_AREA,
23862386
fprs, 128);
23872387
} else {

0 commit comments

Comments
 (0)