Commit 851755871c1f3184f4124c466e85881f17fa3226

Authored by Christian Borntraeger
Committed by Avi Kivity
1 parent 6dbf79e716

KVM: s390: Sanitize fpc registers for KVM_SET_FPU

commit 7eef87dc99e419b1cc051e4417c37e4744d7b661 (KVM: s390: fix
register setting) added a load of the floating point control register
to the KVM_SET_FPU path. Lets make sure that the fpc is valid.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/s390/kvm/kvm-s390.c
... ... @@ -460,7 +460,7 @@
460 460 int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
461 461 {
462 462 memcpy(&vcpu->arch.guest_fpregs.fprs, &fpu->fprs, sizeof(fpu->fprs));
463   - vcpu->arch.guest_fpregs.fpc = fpu->fpc;
  463 + vcpu->arch.guest_fpregs.fpc = fpu->fpc & FPC_VALID_MASK;
464 464 restore_fp_regs(&vcpu->arch.guest_fpregs);
465 465 return 0;
466 466 }