From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIwrm-0007GF-T9 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 06:11:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIwri-00047V-Sz for qemu-devel@nongnu.org; Tue, 12 Jan 2016 06:11:58 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:10697 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIwri-00047O-Ez for qemu-devel@nongnu.org; Tue, 12 Jan 2016 06:11:54 -0500 From: Andrey Smetanin Date: Tue, 12 Jan 2016 14:11:10 +0300 Message-Id: <1452597070-25985-3-git-send-email-asmetanin@virtuozzo.com> In-Reply-To: <1452597070-25985-1-git-send-email-asmetanin@virtuozzo.com> References: <1452597070-25985-1-git-send-email-asmetanin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v1 2/2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost , kvm@vger.kernel.org, Marcelo Tosatti , Roman Kagan , "Denis V. Lunev" , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Add Hyper-V VMBus hypercalls blank handlers which just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Andreas F=C3=A4rber" CC: Marcelo Tosatti CC: Roman Kagan CC: Denis V. Lunev CC: kvm@vger.kernel.org --- target-i386/hyperv.c | 14 ++++++++++++++ target-i386/hyperv.h | 2 ++ target-i386/kvm.c | 3 +++ 3 files changed, 19 insertions(+) diff --git a/target-i386/hyperv.c b/target-i386/hyperv.c index e79b173..bd09506 100644 --- a/target-i386/hyperv.c +++ b/target-i386/hyperv.c @@ -125,3 +125,17 @@ int kvm_hv_sint_route_set_sint(HvSintRoute *sint_rou= te) { return event_notifier_set(&sint_route->sint_set_notifier); } + +int kvm_hv_handle_hypercall(X86CPU *cpu, struct kvm_run *run) +{ + uint16_t code; + + code =3D run->hv_hcall.input & 0xffff; + switch (code) { + case HV_X64_HCALL_POST_MESSAGE: + case HV_X64_HCALL_SIGNAL_EVENT: + default: + run->hv_hcall.result =3D HV_STATUS_INVALID_HYPERCALL_CODE; + return 0; + } +} diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h index b26201f..9515b6e 100644 --- a/target-i386/hyperv.h +++ b/target-i386/hyperv.h @@ -39,4 +39,6 @@ void kvm_hv_sint_route_destroy(HvSintRoute *sint_route)= ; =20 int kvm_hv_sint_route_set_sint(HvSintRoute *sint_route); =20 +int kvm_hv_handle_hypercall(X86CPU *cpu, struct kvm_run *run); + #endif diff --git a/target-i386/kvm.c b/target-i386/kvm.c index ab65a6e..adb1d64 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -3026,6 +3026,9 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_r= un *run) ioapic_eoi_broadcast(run->eoi.vector); ret =3D 0; break; + case KVM_EXIT_HYPERV_HCALL: + ret =3D kvm_hv_handle_hypercall(cpu, run); + break; default: fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reaso= n); ret =3D -1; --=20 2.4.3