All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] QEMU: Hyper-V VMBus hypercalls blank handlers
@ 2016-01-12 11:11 ` Andrey Smetanin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Andreas Färber, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, kvm

The patches adds blank handlers for Hyper-V
VMBus hypercalls routed by KVM_EXIT_HYPERV_HCALL KVM exit.

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

Andrey Smetanin (2):
  headers: Hyper-V VMBus hypercall codes and exit
  target-i386/kvm: Hyper-V VMBus hypercalls blank handlers

 include/standard-headers/asm-x86/hyperv.h |  4 +++-
 linux-headers/linux/kvm.h                 |  7 +++++++
 target-i386/hyperv.c                      | 14 ++++++++++++++
 target-i386/hyperv.h                      |  2 ++
 target-i386/kvm.c                         |  3 +++
 5 files changed, 29 insertions(+), 1 deletion(-)

-- 
2.4.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v1 0/2] QEMU: Hyper-V VMBus hypercalls blank handlers
@ 2016-01-12 11:11 ` Andrey Smetanin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, kvm, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, Paolo Bonzini, Andreas Färber,
	Richard Henderson

The patches adds blank handlers for Hyper-V
VMBus hypercalls routed by KVM_EXIT_HYPERV_HCALL KVM exit.

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

Andrey Smetanin (2):
  headers: Hyper-V VMBus hypercall codes and exit
  target-i386/kvm: Hyper-V VMBus hypercalls blank handlers

 include/standard-headers/asm-x86/hyperv.h |  4 +++-
 linux-headers/linux/kvm.h                 |  7 +++++++
 target-i386/hyperv.c                      | 14 ++++++++++++++
 target-i386/hyperv.h                      |  2 ++
 target-i386/kvm.c                         |  3 +++
 5 files changed, 29 insertions(+), 1 deletion(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] headers: Hyper-V VMBus hypercall codes and exit
  2016-01-12 11:11 ` [Qemu-devel] " Andrey Smetanin
@ 2016-01-12 11:11   ` Andrey Smetanin
  -1 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Andreas Färber, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, kvm

This patch just for completeness, this changes
should be received by scripts/update-linux-headers.sh

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

---
 include/standard-headers/asm-x86/hyperv.h | 4 +++-
 linux-headers/linux/kvm.h                 | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/standard-headers/asm-x86/hyperv.h b/include/standard-headers/asm-x86/hyperv.h
index acb119d..27b445e 100644
--- a/include/standard-headers/asm-x86/hyperv.h
+++ b/include/standard-headers/asm-x86/hyperv.h
@@ -226,7 +226,9 @@
 		(~((1ull << HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT) - 1))
 
 /* Declare the various hypercall operations. */
-#define HV_X64_HV_NOTIFY_LONG_SPIN_WAIT		0x0008
+#define HV_X64_HCALL_NOTIFY_LONG_SPIN_WAIT		0x0008
+#define HV_X64_HCALL_POST_MESSAGE			0x005c
+#define HV_X64_HCALL_SIGNAL_EVENT			0x005d
 
 #define HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE		0x00000001
 #define HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT	12
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 4e20262..32879ba 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -199,6 +199,7 @@ struct kvm_hyperv_exit {
 #define KVM_EXIT_S390_STSI        25
 #define KVM_EXIT_IOAPIC_EOI       26
 #define KVM_EXIT_HYPERV           27
+#define KVM_EXIT_HYPERV_HCALL     28
 
 /* For KVM_EXIT_INTERNAL_ERROR */
 /* Emulate instruction failed. */
@@ -355,6 +356,12 @@ struct kvm_run {
 		} eoi;
 		/* KVM_EXIT_HYPERV */
 		struct kvm_hyperv_exit hyperv;
+		/* KVM_EXIT_HYPERV_HCALL */
+		struct {
+			__u64 input;
+			__u64 params[2];
+			__u64 result;
+		} hv_hcall;
 		/* Fix the size of the union. */
 		char padding[256];
 	};
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v1 1/2] headers: Hyper-V VMBus hypercall codes and exit
@ 2016-01-12 11:11   ` Andrey Smetanin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, kvm, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, Paolo Bonzini, Andreas Färber,
	Richard Henderson

This patch just for completeness, this changes
should be received by scripts/update-linux-headers.sh

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

---
 include/standard-headers/asm-x86/hyperv.h | 4 +++-
 linux-headers/linux/kvm.h                 | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/standard-headers/asm-x86/hyperv.h b/include/standard-headers/asm-x86/hyperv.h
index acb119d..27b445e 100644
--- a/include/standard-headers/asm-x86/hyperv.h
+++ b/include/standard-headers/asm-x86/hyperv.h
@@ -226,7 +226,9 @@
 		(~((1ull << HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT) - 1))
 
 /* Declare the various hypercall operations. */
-#define HV_X64_HV_NOTIFY_LONG_SPIN_WAIT		0x0008
+#define HV_X64_HCALL_NOTIFY_LONG_SPIN_WAIT		0x0008
+#define HV_X64_HCALL_POST_MESSAGE			0x005c
+#define HV_X64_HCALL_SIGNAL_EVENT			0x005d
 
 #define HV_X64_MSR_APIC_ASSIST_PAGE_ENABLE		0x00000001
 #define HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT	12
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 4e20262..32879ba 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -199,6 +199,7 @@ struct kvm_hyperv_exit {
 #define KVM_EXIT_S390_STSI        25
 #define KVM_EXIT_IOAPIC_EOI       26
 #define KVM_EXIT_HYPERV           27
+#define KVM_EXIT_HYPERV_HCALL     28
 
 /* For KVM_EXIT_INTERNAL_ERROR */
 /* Emulate instruction failed. */
@@ -355,6 +356,12 @@ struct kvm_run {
 		} eoi;
 		/* KVM_EXIT_HYPERV */
 		struct kvm_hyperv_exit hyperv;
+		/* KVM_EXIT_HYPERV_HCALL */
+		struct {
+			__u64 input;
+			__u64 params[2];
+			__u64 result;
+		} hv_hcall;
 		/* Fix the size of the union. */
 		char padding[256];
 	};
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers
  2016-01-12 11:11 ` [Qemu-devel] " Andrey Smetanin
@ 2016-01-12 11:11   ` Andrey Smetanin
  -1 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Andreas Färber, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, kvm

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v1 2/2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers
@ 2016-01-12 11:11   ` Andrey Smetanin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Smetanin @ 2016-01-12 11:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, kvm, Marcelo Tosatti, Roman Kagan,
	Denis V. Lunev, Paolo Bonzini, Andreas Färber,
	Richard Henderson

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-12 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12 11:11 [PATCH v1 0/2] QEMU: Hyper-V VMBus hypercalls blank handlers Andrey Smetanin
2016-01-12 11:11 ` [Qemu-devel] " Andrey Smetanin
2016-01-12 11:11 ` [PATCH v1 1/2] headers: Hyper-V VMBus hypercall codes and exit Andrey Smetanin
2016-01-12 11:11   ` [Qemu-devel] " Andrey Smetanin
2016-01-12 11:11 ` [PATCH v1 2/2] target-i386/kvm: Hyper-V VMBus hypercalls blank handlers Andrey Smetanin
2016-01-12 11:11   ` [Qemu-devel] " Andrey Smetanin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.