Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571556 > unrolled thread

[PATCH] KVM: x86: do not save guest-unsupported XSAVE state

Started byRadim Krčmář <rkrcmar@redhat.com>
First post2017-02-01 14:30 +0100
Last post2017-02-04 17:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] KVM: x86: do not save guest-unsupported XSAVE state Radim Krčmář <rkrcmar@redhat.com> - 2017-02-01 14:30 +0100
    Re: [PATCH] KVM: x86: do not save guest-unsupported XSAVE state Paolo Bonzini <pbonzini@redhat.com> - 2017-02-02 01:20 +0100
      Re: [PATCH] KVM: x86: do not save guest-unsupported XSAVE state Radim Krčmář <rkrcmar@redhat.com> - 2017-02-04 17:30 +0100

#1571556 — [PATCH] KVM: x86: do not save guest-unsupported XSAVE state

FromRadim Krčmář <rkrcmar@redhat.com>
Date2017-02-01 14:30 +0100
Subject[PATCH] KVM: x86: do not save guest-unsupported XSAVE state
Message-ID<t6390-6uR-7@gated-at.bofh.it>
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>
---
 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;
 
 	/*
-- 
2.11.0

[toc] | [next] | [standalone]


#1572086

FromPaolo Bonzini <pbonzini@redhat.com>
Date2017-02-02 01:20 +0100
Message-ID<t6di2-4Nn-5@gated-at.bofh.it>
In reply to#1571556

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;
>  
>  	/*
> 

[toc] | [prev] | [next] | [standalone]


#1573703

FromRadim Krčmář <rkrcmar@redhat.com>
Date2017-02-04 17:30 +0100
Message-ID<t7bnQ-2XG-35@gated-at.bofh.it>
In reply to#1572086
2017-02-01 16:13-0800, Paolo Bonzini:
> 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.

Done, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web