[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v12 24/60] i386/xen: implement HYPERVISOR_event_channel_op
From: |
David Woodhouse |
Subject: |
[PATCH v12 24/60] i386/xen: implement HYPERVISOR_event_channel_op |
Date: |
Mon, 20 Feb 2023 20:47:00 +0000 |
From: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Ditch event_channel_op_compat which was never available to HVM guests]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
target/i386/kvm/xen-emu.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index f5c8b6d20c..0bca370ea4 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -28,6 +28,7 @@
#include "hw/xen/interface/memory.h"
#include "hw/xen/interface/hvm/hvm_op.h"
#include "hw/xen/interface/vcpu.h"
+#include "hw/xen/interface/event_channel.h"
#include "xen-compat.h"
@@ -588,6 +589,27 @@ static bool kvm_xen_hcall_vcpu_op(struct kvm_xen_exit
*exit, X86CPU *cpu,
return true;
}
+static bool kvm_xen_hcall_evtchn_op(struct kvm_xen_exit *exit,
+ int cmd, uint64_t arg)
+{
+ int err = -ENOSYS;
+
+ switch (cmd) {
+ case EVTCHNOP_init_control:
+ case EVTCHNOP_expand_array:
+ case EVTCHNOP_set_priority:
+ /* We do not support FIFO channels at this point */
+ err = -ENOSYS;
+ break;
+
+ default:
+ return false;
+ }
+
+ exit->u.hcall.result = err;
+ return true;
+}
+
int kvm_xen_soft_reset(void)
{
CPUState *cpu;
@@ -694,6 +716,9 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct
kvm_xen_exit *exit)
case __HYPERVISOR_sched_op:
return kvm_xen_hcall_sched_op(exit, cpu, exit->u.hcall.params[0],
exit->u.hcall.params[1]);
+ case __HYPERVISOR_event_channel_op:
+ return kvm_xen_hcall_evtchn_op(exit, exit->u.hcall.params[0],
+ exit->u.hcall.params[1]);
case __HYPERVISOR_vcpu_op:
return kvm_xen_hcall_vcpu_op(exit, cpu,
exit->u.hcall.params[0],
--
2.39.0
- [PATCH v12 59/60] i386/xen: Document Xen HVM emulation, (continued)
- [PATCH v12 59/60] i386/xen: Document Xen HVM emulation, David Woodhouse, 2023/02/20
- [PATCH v12 18/60] i386/xen: implement XENMEM_add_to_physmap_batch, David Woodhouse, 2023/02/20
- [PATCH v12 43/60] hw/xen: Add xen_gnttab device for grant table emulation, David Woodhouse, 2023/02/20
- [PATCH v12 12/60] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield, David Woodhouse, 2023/02/20
- [PATCH v12 13/60] hw/xen: Add xen_overlay device for emulating shared xenheap pages, David Woodhouse, 2023/02/20
- [PATCH v12 50/60] hw/xen: Add backend implementation of interdomain event channel support, David Woodhouse, 2023/02/20
- [PATCH v12 27/60] hw/xen: Add xen_evtchn device for event channel emulation, David Woodhouse, 2023/02/20
- [PATCH v12 51/60] hw/xen: Add xen_xenstore device for xenstore emulation, David Woodhouse, 2023/02/20
- [PATCH v12 06/60] i386/hvm: Set Xen vCPU ID in KVM, David Woodhouse, 2023/02/20
- [PATCH v12 55/60] hw/xen: Implement emulated PIRQ hypercall support, David Woodhouse, 2023/02/20
- [PATCH v12 24/60] i386/xen: implement HYPERVISOR_event_channel_op,
David Woodhouse <=
- [PATCH v12 56/60] hw/xen: Support GSI mapping to PIRQ, David Woodhouse, 2023/02/20
- [PATCH v12 09/60] i386/xen: handle guest hypercalls, David Woodhouse, 2023/02/20
- [PATCH v12 32/60] hw/xen: Implement EVTCHNOP_bind_virq, David Woodhouse, 2023/02/20
- [PATCH v12 21/60] i386/xen: handle VCPUOP_register_vcpu_info, David Woodhouse, 2023/02/20
- [PATCH v12 20/60] i386/xen: implement HYPERVISOR_vcpu_op, David Woodhouse, 2023/02/20
- [PATCH v12 01/60] include: import Xen public headers to hw/xen/interface, David Woodhouse, 2023/02/20
- [PATCH v12 16/60] i386/xen: manage and save/restore Xen guest long_mode setting, David Woodhouse, 2023/02/20
- [PATCH v12 36/60] hw/xen: Implement EVTCHNOP_bind_interdomain, David Woodhouse, 2023/02/20
- [PATCH v12 47/60] i386/xen: handle PV timer hypercalls, David Woodhouse, 2023/02/20