Skip to content

Commit

Permalink
KVM: x86: Update vCPU's runtime CPUID on write to MSR_IA32_XSS
Browse files Browse the repository at this point in the history
Do a runtime CPUID update for a vCPU if MSR_IA32_XSS is written, as the
size in bytes of the XSAVE area is affected by the states enabled in XSS.

Fixes: 2030009 ("kvm: vmx: add MSR logic for XSAVES")
Cc: [email protected]
Signed-off-by: Like Xu <[email protected]>
[sean: split out as a separate patch, adjust Fixes tag]
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Like Xu authored and bonzini committed Jan 26, 2022
1 parent be4f3b3 commit 4c282e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -3535,6 +3535,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
if (data & ~supported_xss)
return 1;
vcpu->arch.ia32_xss = data;
kvm_update_cpuid_runtime(vcpu);
break;
case MSR_SMI_COUNT:
if (!msr_info->host_initiated)
Expand Down

0 comments on commit 4c282e5

Please sign in to comment.