qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Smetanin <asmetanin@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Marcelo Tosatti" <mtosatti@redhat.com>,
	"Roman Kagan" <rkagan@virtuozzo.com>,
	"Denis V. Lunev" <den@openvz.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v1 2/2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers
Date: Tue, 12 Jan 2016 14:11:10 +0300	[thread overview]
Message-ID: <1452597070-25985-3-git-send-email-asmetanin@virtuozzo.com> (raw)
In-Reply-To: <1452597070-25985-1-git-send-email-asmetanin@virtuozzo.com>

Add Hyper-V VMBus hypercalls blank handlers which
just returns error code - HV_STATUS_INVALID_HYPERCALL_CODE.

Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Eduardo Habkost <ehabkost@redhat.com>
CC: "Andreas Färber" <afaerber@suse.de>
CC: Marcelo Tosatti <mtosatti@redhat.com>
CC: Roman Kagan <rkagan@virtuozzo.com>
CC: Denis V. Lunev <den@openvz.org>
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_route)
 {
     return event_notifier_set(&sint_route->sint_set_notifier);
 }
+
+int kvm_hv_handle_hypercall(X86CPU *cpu, struct kvm_run *run)
+{
+    uint16_t code;
+
+    code  = run->hv_hcall.input & 0xffff;
+    switch (code) {
+    case HV_X64_HCALL_POST_MESSAGE:
+    case HV_X64_HCALL_SIGNAL_EVENT:
+    default:
+        run->hv_hcall.result = 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);
 
 int kvm_hv_sint_route_set_sint(HvSintRoute *sint_route);
 
+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_run *run)
         ioapic_eoi_broadcast(run->eoi.vector);
         ret = 0;
         break;
+    case KVM_EXIT_HYPERV_HCALL:
+        ret = kvm_hv_handle_hypercall(cpu, run);
+        break;
     default:
         fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason);
         ret = -1;
-- 
2.4.3

      parent reply	other threads:[~2016-01-12 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 11:11 [Qemu-devel] [PATCH v1 0/2] QEMU: Hyper-V VMBus hypercalls blank handlers Andrey Smetanin
2016-01-12 11:11 ` [Qemu-devel] [PATCH v1 1/2] headers: Hyper-V VMBus hypercall codes and exit Andrey Smetanin
2016-01-12 11:11 ` Andrey Smetanin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452597070-25985-3-git-send-email-asmetanin@virtuozzo.com \
    --to=asmetanin@virtuozzo.com \
    --cc=afaerber@suse.de \
    --cc=den@openvz.org \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).