From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Wanpeng Li" <wanpeng.li@hotmail.com>
Subject: Re: [PATCH] KVM: x86: Fix load damaged SSEx MXCSR register
Date: Wed, 10 May 2017 17:35:53 +0200 [thread overview]
Message-ID: <6d515b93-e7e2-fbae-a91c-12b98fe923de@redhat.com> (raw)
In-Reply-To: <1494411564-76243-1-git-send-email-wanpeng.li@hotmail.com>
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@vger.kernel.org.
Paolo
next prev parent reply other threads:[~2017-05-10 15:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 10:19 [PATCH] KVM: x86: Fix load damaged SSEx MXCSR register Wanpeng Li
2017-05-10 15:34 ` Paolo Bonzini
2017-05-10 15:35 ` Paolo Bonzini [this message]
2017-05-11 0:56 ` Wanpeng Li
2017-05-11 7:44 ` Paolo Bonzini
2017-05-11 10:00 ` Wanpeng Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d515b93-e7e2-fbae-a91c-12b98fe923de@redhat.com \
--to=pbonzini@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=wanpeng.li@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox