mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: do not save guest-unsupported XSAVE state
Date: Wed, 1 Feb 2017 16:13:36 -0800	[thread overview]
Message-ID: <42ae50e8-444c-5b0b-e13b-266e3bf80ca3@redhat.com> (raw)
In-Reply-To: <20170201131953.30098-1-rkrcmar@redhat.com>



On 01/02/2017 05:19, Radim Krčmář wrote:
> Saving unsupported state prevents migration when the new host does not
> support a XSAVE feature of the original host, even if the feature is not
> exposed to the guest.
> 
> We've masked host features with guest-visible features before, with
> 4344ee981e21 ("KVM: x86: only copy XSAVE state for the supported
> features") and dropped it when implementing XSAVES.  Do it again.
> 
> Fixes: df1daba7d1cb ("KVM: x86: support XSAVES usage in the host")
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

Cc: stable@vger.kernel.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Please apply to kvm/master and send it yourself to Linus since I don't
have access to my machine this week.

Paolo

> ---
>  arch/x86/kvm/x86.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 96dd7dd13ee6..5f013ad89b57 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3221,6 +3221,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
>  	memcpy(dest, xsave, XSAVE_HDR_OFFSET);
>  
>  	/* Set XSTATE_BV */
> +	xstate_bv &= vcpu->arch.guest_supported_xcr0 | XFEATURE_MASK_FPSSE;
>  	*(u64 *)(dest + XSAVE_HDR_OFFSET) = xstate_bv;
>  
>  	/*
> 

  reply	other threads:[~2017-02-02  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 13:19 Radim Krčmář
2017-02-02  0:13 ` Paolo Bonzini [this message]
2017-02-04 16:26   ` Radim Krčmář

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=42ae50e8-444c-5b0b-e13b-266e3bf80ca3@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®