KVM: x86: hyper-v: Honor HV_ACCESS_REENLIGHTENMENT privilege bit
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 21 May 2021 09:51:49 +0000 (11:51 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jun 2021 17:09:41 +0000 (13:09 -0400)
HV_X64_MSR_REENLIGHTENMENT_CONTROL/HV_X64_MSR_TSC_EMULATION_CONTROL/
HV_X64_MSR_TSC_EMULATION_STATUS are only available to guest when
HV_ACCESS_REENLIGHTENMENT bit is exposed.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210521095204.2161214-16-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/hyperv.c

index 2a0660b..230f526 100644 (file)
@@ -1257,6 +1257,11 @@ static bool hv_check_msr_access(struct kvm_vcpu_hv *hv_vcpu, u32 msr)
        case HV_X64_MSR_APIC_FREQUENCY:
                return hv_vcpu->cpuid_cache.features_eax &
                        HV_ACCESS_FREQUENCY_MSRS;
+       case HV_X64_MSR_REENLIGHTENMENT_CONTROL:
+       case HV_X64_MSR_TSC_EMULATION_CONTROL:
+       case HV_X64_MSR_TSC_EMULATION_STATUS:
+               return hv_vcpu->cpuid_cache.features_eax &
+                       HV_ACCESS_REENLIGHTENMENT;
        default:
                break;
        }