[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 23/38] i386/xen: implement HYPERVISOR_event_channel_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH v3 23/38] i386/xen: implement HYPERVISOR_event_channel_op |
Date: |
Fri, 16 Dec 2022 00:41:02 +0000 |
From: Joao Martins <joao.m.martins@oracle.com>
Additionally set XEN_INTERFACE_VERSION to most recent in order to
exercise the "new" event_channel_op.
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>
---
target/i386/kvm/xen-emu.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index 09978c83ca..d6f3102d8e 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -27,6 +27,7 @@
#include "standard-headers/xen/hvm/hvm_op.h"
#include "standard-headers/xen/hvm/params.h"
#include "standard-headers/xen/vcpu.h"
+#include "standard-headers/xen/event_channel.h"
#include "xen-compat.h"
@@ -611,6 +612,23 @@ 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:
+ err = -ENOSYS;
+ break;
+ default:
+ return false;
+ }
+
+ exit->u.hcall.result = err;
+ return true;
+}
+
static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
{
uint16_t code = exit->u.hcall.input;
@@ -621,6 +639,9 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct
kvm_xen_exit *exit)
}
switch (code) {
+ 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.35.3
- Re: [RFC PATCH v3 06/38] xen-platform: exclude vfio-pci from the PCI platform unplug, (continued)
- [RFC PATCH v3 22/38] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/15
- [RFC PATCH v3 29/38] hw/xen: Implement EVTCHNOP_bind_ipi, David Woodhouse, 2022/12/15
- [RFC PATCH v3 02/38] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/15
- [RFC PATCH v3 32/38] hw/xen: Implement EVTCHNOP_bind_interdomain, David Woodhouse, 2022/12/15
- [RFC PATCH v3 25/38] hw/xen: Implement EVTCHNOP_status, David Woodhouse, 2022/12/15
- [RFC PATCH v3 08/38] hw/xen_backend: refactor xen_be_init(), David Woodhouse, 2022/12/15
- [RFC PATCH v3 15/38] i386/xen: implement XENMEM_add_to_physmap_batch, David Woodhouse, 2022/12/15
- [RFC PATCH v3 23/38] i386/xen: implement HYPERVISOR_event_channel_op,
David Woodhouse <=
- [RFC PATCH v3 31/38] hw/xen: Implement EVTCHNOP_alloc_unbound, David Woodhouse, 2022/12/15
- [RFC PATCH v3 36/38] i386/xen: Implement SCHEDOP_poll, David Woodhouse, 2022/12/15
- [RFC PATCH v3 11/38] hw/xen: Add xen_overlay device for emulating shared xenheap pages, David Woodhouse, 2022/12/15
- [RFC PATCH v3 19/38] i386/xen: handle VCPUOP_register_vcpu_time_info, David Woodhouse, 2022/12/15
- [RFC PATCH v3 28/38] hw/xen: Implement EVTCHNOP_bind_virq, David Woodhouse, 2022/12/15
- [RFC PATCH v3 21/38] i386/xen: implement HVMOP_set_evtchn_upcall_vector, David Woodhouse, 2022/12/15
- [RFC PATCH v3 33/38] hw/xen: Implement EVTCHNOP_bind_vcpu, David Woodhouse, 2022/12/15
- [RFC PATCH v3 04/38] i386/kvm: Add xen-version machine property and init KVM Xen support, David Woodhouse, 2022/12/15
- [RFC PATCH v3 14/38] i386/xen: implement HYPERVISOR_memory_op, David Woodhouse, 2022/12/15