Skip to content

Commit 1ded7a5

Browse files
committed
KVM: x86: Remove ordering check b/w MSR_PLATFORM_INFO and MISC_FEATURES_ENABLES
Drop KVM's odd restriction that disallows clearing CPUID_FAULT in MSR_PLATFORM_INFO if CPL>0 CPUID faulting is enabled in MSR_MISC_FEATURES_ENABLES. KVM generally doesn't require specific ordering when userspace sets MSRs, and the completely arbitrary order of MSRs in emulated_msrs_all means that a userspace that uses KVM's list verbatim could run afoul of the check. Dropping the restriction obviously means that userspace could stuff a nonsensical vCPU model, but that's the case all over KVM. KVM typically restricts userspace MSR writes only when it makes things easier for KVM and/or userspace. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent a5d5638 commit 1ded7a5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,9 +4116,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
41164116
vcpu->arch.osvw.status = data;
41174117
break;
41184118
case MSR_PLATFORM_INFO:
4119-
if (!msr_info->host_initiated ||
4120-
(!(data & MSR_PLATFORM_INFO_CPUID_FAULT) &&
4121-
cpuid_fault_enabled(vcpu)))
4119+
if (!msr_info->host_initiated)
41224120
return 1;
41234121
vcpu->arch.msr_platform_info = data;
41244122
break;

0 commit comments

Comments
 (0)