Skip to content

Commit b467ab8

Browse files
committed
KVM: x86: expose MSR_PLATFORM_INFO as a feature MSR
For userspace that wants to disable KVM_X86_QUIRK_STUFF_FEATURE_MSRS, it is useful to know what bits can be set to 1 in MSR_PLATFORM_INFO (apart from the TSC ratio). The right way to do that is via /dev/kvm's feature MSR mechanism. In fact, MSR_PLATFORM_INFO is already a feature MSR for the purpose of blocking updates after the vCPU is run, but KVM_GET_MSRS did not return a valid value for it. Just like in a VM that leaves KVM_X86_QUIRK_STUFF_FEATURE_MSRS enabled, the TSC ratio field is left to 0. Only bit 31 is set. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a0423af commit b467ab8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/x86.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,9 @@ static int kvm_get_feature_msr(struct kvm_vcpu *vcpu, u32 index, u64 *data,
16751675
case MSR_IA32_PERF_CAPABILITIES:
16761676
*data = kvm_caps.supported_perf_cap;
16771677
break;
1678+
case MSR_PLATFORM_INFO:
1679+
*data = MSR_PLATFORM_INFO_CPUID_FAULT;
1680+
break;
16781681
case MSR_IA32_UCODE_REV:
16791682
rdmsrl_safe(index, data);
16801683
break;

0 commit comments

Comments
 (0)