[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 20/47] i386/xen: implement HYPERVISOR_vcpu_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH v4 20/47] i386/xen: implement HYPERVISOR_vcpu_op |
Date: |
Wed, 21 Dec 2022 01:05:56 +0000 |
From: Joao Martins <joao.m.martins@oracle.com>
This is simply when guest tries to register a vcpu_info
and since vcpu_info placement is optional in the minimum ABI
therefore we can just fail with -ENOSYS
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
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 6b4d40397c..0e9ae481d8 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -28,6 +28,7 @@
#include "standard-headers/xen/sched.h"
#include "standard-headers/xen/memory.h"
#include "standard-headers/xen/hvm/hvm_op.h"
+#include "standard-headers/xen/vcpu.h"
#include "xen-compat.h"
@@ -362,6 +363,25 @@ static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit
*exit, X86CPU *cpu,
}
}
+static bool kvm_xen_hcall_vcpu_op(struct kvm_xen_exit *exit, X86CPU *cpu,
+ int cmd, int vcpu_id, uint64_t arg)
+{
+ int err;
+
+ switch (cmd) {
+ case VCPUOP_register_vcpu_info:
+ /* no vcpu info placement for now */
+ err = -ENOSYS;
+ break;
+
+ default:
+ return false;
+ }
+
+ exit->u.hcall.result = err;
+ return true;
+}
+
static int kvm_xen_soft_reset(void)
{
int err;
@@ -456,6 +476,11 @@ 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_vcpu_op:
+ return kvm_xen_hcall_vcpu_op(exit, cpu,
+ exit->u.hcall.params[0],
+ exit->u.hcall.params[1],
+ exit->u.hcall.params[2]);
case __HYPERVISOR_hvm_op:
return kvm_xen_hcall_hvm_op(exit, cpu, exit->u.hcall.params[0],
exit->u.hcall.params[1]);
--
2.35.3
- [RFC PATCH v4 12/47] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown, (continued)
- [RFC PATCH v4 12/47] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown, David Woodhouse, 2022/12/20
- [RFC PATCH v4 35/47] hw/xen: Implement EVTCHNOP_alloc_unbound, David Woodhouse, 2022/12/20
- [RFC PATCH v4 03/47] xen: Add XEN_DISABLED mode and make it default, David Woodhouse, 2022/12/20
- [RFC PATCH v4 37/47] hw/xen: Implement EVTCHNOP_bind_vcpu, David Woodhouse, 2022/12/20
- [RFC PATCH v4 02/47] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/20
- [RFC PATCH v4 40/47] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback, David Woodhouse, 2022/12/20
- [RFC PATCH v4 22/47] i386/xen: handle VCPUOP_register_vcpu_time_info, David Woodhouse, 2022/12/20
- [RFC PATCH v4 34/47] hw/xen: Implement EVTCHNOP_send, David Woodhouse, 2022/12/20
- [RFC PATCH v4 46/47] hw/xen: Implement GNTTABOP_query_size, David Woodhouse, 2022/12/20
- [RFC PATCH v4 20/47] i386/xen: implement HYPERVISOR_vcpu_op,
David Woodhouse <=
- [RFC PATCH v4 31/47] hw/xen: Implement EVTCHNOP_unmask, David Woodhouse, 2022/12/20
- [RFC PATCH v4 27/47] hw/xen: Add xen_evtchn device for event channel emulation, David Woodhouse, 2022/12/20
- [RFC PATCH v4 33/47] hw/xen: Implement EVTCHNOP_bind_ipi, David Woodhouse, 2022/12/20
- [RFC PATCH v4 25/47] i386/xen: implement HVMOP_set_evtchn_upcall_vector, David Woodhouse, 2022/12/20
- [RFC PATCH v4 47/47] i386/xen: handle PV timer hypercalls, David Woodhouse, 2022/12/20
- [RFC PATCH v4 39/47] i386/xen: add monitor commands to test event injection, David Woodhouse, 2022/12/20
- [RFC PATCH v4 30/47] hw/xen: Implement EVTCHNOP_close, David Woodhouse, 2022/12/20
- [RFC PATCH v4 43/47] hw/xen: Add xen_gnttab device for grant table emulation, David Woodhouse, 2022/12/20
- [RFC PATCH v4 06/47] i386/hvm: Set Xen vCPU ID in KVM, David Woodhouse, 2022/12/20