From 3d31ac114899e78729675f6b316cb426a722e3f2 Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Mon, 18 Jun 2018 12:21:57 -0400 Subject: [PATCH] i386/xen: implement HYPERVISOR_hvm_op This is when guest queries for support for HVMOP_pagetable_dying. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- 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.50.1