[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 17/38] i386/xen: implement HYPERVISOR_vcpu_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH v3 17/38] i386/xen: implement HYPERVISOR_vcpu_op |
Date: |
Fri, 16 Dec 2022 00:40: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 da77297ef9..83d98cbfd9 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -23,6 +23,7 @@
#include "standard-headers/xen/version.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"
@@ -317,6 +318,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 bool do_kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
{
uint16_t code = exit->u.hcall.input;
@@ -327,6 +347,11 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct
kvm_xen_exit *exit)
}
switch (code) {
+ 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 v3 00/38] Xen HVM support under KVM, David Woodhouse, 2022/12/15
- [RFC PATCH v3 26/38] hw/xen: Implement EVTCHNOP_close, David Woodhouse, 2022/12/15
- [RFC PATCH v3 35/38] i386/xen: add monitor commands to test event injection, David Woodhouse, 2022/12/15
- [RFC PATCH v3 17/38] i386/xen: implement HYPERVISOR_vcpu_op,
David Woodhouse <=
- [RFC PATCH v3 12/38] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode, David Woodhouse, 2022/12/15
- [RFC PATCH v3 38/38] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback, David Woodhouse, 2022/12/15
- [RFC PATCH v3 06/38] xen-platform: exclude vfio-pci from the PCI platform unplug, David Woodhouse, 2022/12/15
- [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