[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 14/22] i386/xen: implement HYPERVISOR_hvm_op
From: |
David Woodhouse |
Subject: |
[RFC PATCH v2 14/22] i386/xen: implement HYPERVISOR_hvm_op |
Date: |
Fri, 9 Dec 2022 09:56:04 +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 | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/target/i386/xen.c b/target/i386/xen.c
index ddd144039a..2847b4f864 100644
--- a/target/i386/xen.c
+++ b/target/i386/xen.c
@@ -18,6 +18,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"
static int kvm_gva_rw(CPUState *cs, uint64_t gva, void *_buf, size_t sz,
bool is_write)
@@ -180,6 +181,19 @@ static bool kvm_xen_hcall_memory_op(struct kvm_xen_exit
*exit,
return true;
}
+static bool 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 true;
+
+ default:
+ return false;
+ }
+}
+
static bool __kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
{
uint16_t code = exit->u.hcall.input;
@@ -190,6 +204,9 @@ static bool __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 v2 06/22] hw/xen_backend: refactor xen_be_init(), (continued)
- [RFC PATCH v2 06/22] hw/xen_backend: refactor xen_be_init(), David Woodhouse, 2022/12/09
- [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/09
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, Paul Durrant, 2022/12/12
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, Paolo Bonzini, 2022/12/12
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/12
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, Paolo Bonzini, 2022/12/12
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/12
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, Paolo Bonzini, 2022/12/13
- Re: [RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2022/12/16
[RFC PATCH v2 14/22] i386/xen: implement HYPERVISOR_hvm_op,
David Woodhouse <=
[RFC PATCH v2 16/22] i386/xen: handle VCPUOP_register_vcpu_info, David Woodhouse, 2022/12/09
[RFC PATCH v2 04/22] i386/kvm: handle Xen HVM cpuid leaves, David Woodhouse, 2022/12/09
[RFC PATCH v2 15/22] i386/xen: implement HYPERVISOR_vcpu_op, David Woodhouse, 2022/12/09