[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op |
Date: |
Mon, 5 Dec 2022 17:31:29 +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/xen.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/target/i386/xen.c b/target/i386/xen.c
index 5d2d8a7e00..38d4cae3d0 100644
--- a/target/i386/xen.c
+++ b/target/i386/xen.c
@@ -17,6 +17,7 @@
#include "standard-headers/xen/version.h"
#include "standard-headers/xen/memory.h"
+#include "standard-headers/xen/hvm/hvm_op.h"
#define PAGE_OFFSET 0xffffffff80000000UL
#define PAGE_SHIFT 12
@@ -181,6 +182,20 @@ static int kvm_xen_hcall_memory_op(struct kvm_xen_exit
*exit,
return err ? HCALL_ERR : 0;
}
+static int kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit,
+ int cmd, uint64_t arg)
+{
+ switch (cmd) {
+ case HVMOP_pagetable_dying: {
+ exit->u.hcall.result = -ENOSYS;
+ return 0;
+ }
+ }
+
+ exit->u.hcall.result = -ENOSYS;
+ return HCALL_ERR;
+}
+
static int __kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
{
uint16_t code = exit->u.hcall.input;
@@ -191,6 +206,9 @@ static int __kvm_xen_handle_exit(X86CPU *cpu, struct
kvm_xen_exit *exit)
}
switch (code) {
+ case __HYPERVISOR_hvm_op:
+ return kvm_xen_hcall_hvm_op(exit, exit->u.hcall.params[0],
+ exit->u.hcall.params[1]);
case __HYPERVISOR_memory_op:
return kvm_xen_hcall_memory_op(exit, exit->u.hcall.params[0],
exit->u.hcall.params[1], cpu);
--
2.35.3
- [RFC PATCH 06/21] pc_piix: handle XEN_EMULATE backend init, (continued)
- [RFC PATCH 06/21] pc_piix: handle XEN_EMULATE backend init, David Woodhouse, 2022/12/05
- [RFC PATCH 19/21] i386/xen: handle event channel upcall related hypercalls, David Woodhouse, 2022/12/05
- [RFC PATCH 02/21] i386/xen: Add xen-version machine property and init KVM Xen support, David Woodhouse, 2022/12/05
- [RFC PATCH 01/21] include: import xen public headers, David Woodhouse, 2022/12/05
- [RFC PATCH 03/21] i386/kvm: handle Xen HVM cpuid leaves, David Woodhouse, 2022/12/05
[RFC PATCH 17/21] i386/xen: handle register_runstate_memory_area, David Woodhouse, 2022/12/05
[RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op,
David Woodhouse <=
[RFC PATCH 05/21] hw/xen_backend: refactor xen_be_init(), David Woodhouse, 2022/12/05
[RFC PATCH 16/21] i386/xen: handle register_vcpu_time_memory_area, David Woodhouse, 2022/12/05
[RFC PATCH 11/21] i386/xen: implement HYPERCALL_xen_version, David Woodhouse, 2022/12/05
[RFC PATCH 09/21] pc_piix: allow xenfv machine with XEN_EMULATE, David Woodhouse, 2022/12/05
[RFC PATCH 18/21] kvm/ioapic: mark gsi-2 used in ioapic routing init, David Woodhouse, 2022/12/05