diff options
-rw-r--r-- | arch/x86/kvm/hyperv.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index ab8dc23f05bf..cb66842ccb8d 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -1205,6 +1205,18 @@ out_unlock: static bool hv_check_msr_access(struct kvm_vcpu_hv *hv_vcpu, u32 msr) { + if (!hv_vcpu->enforce_cpuid) + return true; + + switch (msr) { + case HV_X64_MSR_GUEST_OS_ID: + case HV_X64_MSR_HYPERCALL: + return hv_vcpu->cpuid_cache.features_eax & + HV_MSR_HYPERCALL_AVAILABLE; + default: + break; + } + return true; } |