From: Joao Martins <joao.m.mart...@oracle.com> This is when guest queries for support for HVMOP_pagetable_dying.
Signed-off-by: Joao Martins <joao.m.mart...@oracle.com> Signed-off-by: David Woodhouse <d...@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