[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d515b93-e7e2-fbae-a91c-12b98fe923de@redhat.com>
Date: Wed, 10 May 2017 17:35:53 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Wanpeng Li <kernellwp@...il.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH] KVM: x86: Fix load damaged SSEx MXCSR register
On 10/05/2017 12:19, Wanpeng Li wrote:
> * with old userspace.
> */
> - if (xstate_bv & ~kvm_supported_xcr0())
> + if (xstate_bv & ~kvm_supported_xcr0() ||
> + mxcsr & ~vcpu->arch.guest_fpu.state.xsave.i387.mxcsr_mask)
> return -EINVAL;
> load_xsave(vcpu, (u8 *)guest_xsave->region);
> } else {
> - if (xstate_bv & ~XFEATURE_MASK_FPSSE)
> + if (xstate_bv & ~XFEATURE_MASK_FPSSE ||
> + mxcsr & ~vcpu->arch.guest_fpu.state.fxsave.mxcsr_mask)
> return -EINVAL;
> memcpy(&vcpu->arch.guest_fpu.state.fxsave,
> guest_xsave->region, sizeof(struct fxregs_state));
Hmm, thinking more about it, maybe use mxcsr_feature_mask instead of
digging into vcpu->arch.guest_fpu? If you send v2, please remember to
Cc stable@...r.kernel.org.
Paolo
Powered by blists - more mailing lists