diff options
Diffstat (limited to 'arch/x86/kvm/hyperv.c')
-rw-r--r-- | arch/x86/kvm/hyperv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 5ff3485acb60..01bd7b7a6866 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c | |||
@@ -1116,6 +1116,11 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) | |||
1116 | break; | 1116 | break; |
1117 | case HVCALL_POST_MESSAGE: | 1117 | case HVCALL_POST_MESSAGE: |
1118 | case HVCALL_SIGNAL_EVENT: | 1118 | case HVCALL_SIGNAL_EVENT: |
1119 | /* don't bother userspace if it has no way to handle it */ | ||
1120 | if (!vcpu_to_synic(vcpu)->active) { | ||
1121 | res = HV_STATUS_INVALID_HYPERCALL_CODE; | ||
1122 | break; | ||
1123 | } | ||
1119 | vcpu->run->exit_reason = KVM_EXIT_HYPERV; | 1124 | vcpu->run->exit_reason = KVM_EXIT_HYPERV; |
1120 | vcpu->run->hyperv.type = KVM_EXIT_HYPERV_HCALL; | 1125 | vcpu->run->hyperv.type = KVM_EXIT_HYPERV_HCALL; |
1121 | vcpu->run->hyperv.u.hcall.input = param; | 1126 | vcpu->run->hyperv.u.hcall.input = param; |