Skip to content

Commit 00c87e9

Browse files
committed
KVM: x86: do not save guest-unsupported XSAVE state
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") Cc: [email protected] Reviewed-by: Paolo Bonzini <[email protected]> Signed-off-by: Radim Krčmář <[email protected]>
1 parent 566cf87 commit 00c87e9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/x86.c

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

31843184
/* Set XSTATE_BV */
3185+
xstate_bv &= vcpu->arch.guest_supported_xcr0 | XFEATURE_MASK_FPSSE;
31853186
*(u64 *)(dest + XSAVE_HDR_OFFSET) = xstate_bv;
31863187

31873188
/*

0 commit comments

Comments
 (0)