[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 16/38] i386/xen: implement HYPERVISOR_hvm_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH v3 16/38] i386/xen: implement HYPERVISOR_hvm_op |
Date: |
Fri, 16 Dec 2022 00:40:55 +0000 |
From: Joao Martins <joao.m.martins@oracle.com>
This is when guest queries for support for HVMOP_pagetable_dying.
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 | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index c23026b872..da77297ef9 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -22,6 +22,7 @@
#include "hw/i386/kvm/xen_overlay.h"
#include "standard-headers/xen/version.h"
#include "standard-headers/xen/memory.h"
+#include "standard-headers/xen/hvm/hvm_op.h"
#include "xen-compat.h"
@@ -303,6 +304,19 @@ static bool kvm_xen_hcall_memory_op(struct kvm_xen_exit
*exit, X86CPU *cpu,
return true;
}
+static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit, X86CPU *cpu,
+ int cmd, uint64_t arg)
+{
+ switch (cmd) {
+ case HVMOP_pagetable_dying:
+ exit->u.hcall.result = -ENOSYS;
+ return true;
+
+ default:
+ return false;
+ }
+}
+
static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
{
uint16_t code = exit->u.hcall.input;
@@ -313,6 +327,9 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct
kvm_xen_exit *exit)
}
switch (code) {
+ case __HYPERVISOR_hvm_op:
+ return kvm_xen_hcall_hvm_op(exit, cpu, exit->u.hcall.params[0],
+ exit->u.hcall.params[1]);
case __HYPERVISOR_memory_op:
return kvm_xen_hcall_memory_op(exit, cpu, exit->u.hcall.params[0],
exit->u.hcall.params[1]);
--
2.35.3
- [RFC PATCH v3 33/38] hw/xen: Implement EVTCHNOP_bind_vcpu, (continued)
- [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
- [RFC PATCH v3 09/38] i386/xen: handle guest hypercalls, David Woodhouse, 2022/12/15
- [RFC PATCH v3 30/38] hw/xen: Implement EVTCHNOP_send, David Woodhouse, 2022/12/15
- [RFC PATCH v3 03/38] xen: Add XEN_DISABLED mode and make it default, David Woodhouse, 2022/12/15
- [RFC PATCH v3 16/38] i386/xen: implement HYPERVISOR_hvm_op,
David Woodhouse <=
- [RFC PATCH v3 24/38] i386/xen: implement HYPERVISOR_sched_op, David Woodhouse, 2022/12/15
- [RFC PATCH v3 27/38] hw/xen: Implement EVTCHNOP_unmask, David Woodhouse, 2022/12/15
- [RFC PATCH v3 37/38] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback, David Woodhouse, 2022/12/15
- [RFC PATCH v3 20/38] i386/xen: handle VCPUOP_register_runstate_memory_area, David Woodhouse, 2022/12/15
- [RFC PATCH v3 13/38] i386/xen: manage and save/restore Xen guest long_mode setting, David Woodhouse, 2022/12/15
- [RFC PATCH v3 05/38] i386/kvm: handle Xen HVM cpuid leaves, David Woodhouse, 2022/12/15
- [RFC PATCH v3 01/38] include: import xen public headers, David Woodhouse, 2022/12/15
- [RFC PATCH v3 18/38] i386/xen: handle VCPUOP_register_vcpu_info, David Woodhouse, 2022/12/15