Skip to content

Commit f4f09b7

Browse files
rkrcmargregkh
authored andcommitted
KVM: x86: do not save guest-unsupported XSAVE state
commit 00c87e9a70a17b355b81c36adedf05e84f54e10d upstream. 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 4344ee9 ("KVM: x86: only copy XSAVE state for the supported features") and dropped it when implementing XSAVES. Do it again. Fixes: df1daba ("KVM: x86: support XSAVES usage in the host") Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8b51676 commit f4f09b7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/x86/kvm/x86.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,6 +3057,7 @@ static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
30573057
memcpy(dest, xsave, XSAVE_HDR_OFFSET);
30583058

30593059
/* Set XSTATE_BV */
3060+
xstate_bv &= vcpu->arch.guest_supported_xcr0 | XFEATURE_MASK_FPSSE;
30603061
*(u64 *)(dest + XSAVE_HDR_OFFSET) = xstate_bv;
30613062

30623063
/*

0 commit comments

Comments
 (0)