lkml.org 
[lkml]   [2012]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 007/117] KVM: s390: Sanitize fpc registers for KVM_SET_FPU
    3.2-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Marcelo Tosatti <mtosatti@redhat.com>

    From: Christian Borntraeger <borntraeger@de.ibm.com>

    (cherry picked from commit 851755871c1f3184f4124c466e85881f17fa3226)

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    arch/s390/kvm/kvm-s390.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
    index d1c44573..d3cb86c 100644
    --- a/arch/s390/kvm/kvm-s390.c
    +++ b/arch/s390/kvm/kvm-s390.c
    @@ -418,7 +418,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
    int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
    {
    memcpy(&vcpu->arch.guest_fpregs.fprs, &fpu->fprs, sizeof(fpu->fprs));
    - vcpu->arch.guest_fpregs.fpc = fpu->fpc;
    + vcpu->arch.guest_fpregs.fpc = fpu->fpc & FPC_VALID_MASK;
    restore_fp_regs(&vcpu->arch.guest_fpregs);
    return 0;
    }



    \
     
     \ /
      Last update: 2012-05-28 08:21    [W:4.284 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site