From: Joao Martins Date: Thu, 28 Jun 2018 16:36:19 +0000 (-0400) Subject: i386/xen: implement HYPERVISOR_event_channel_op X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f8931282c26687d0844faa0bcc089686e225d7a7;p=users%2Fdwmw2%2Fqemu.git i386/xen: implement HYPERVISOR_event_channel_op Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise the "new" event_channel_op. Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by: David Woodhouse --- diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c index 09978c83ca..d6f3102d8e 100644 --- a/target/i386/kvm/xen-emu.c +++ b/target/i386/kvm/xen-emu.c @@ -27,6 +27,7 @@ #include "standard-headers/xen/hvm/hvm_op.h" #include "standard-headers/xen/hvm/params.h" #include "standard-headers/xen/vcpu.h" +#include "standard-headers/xen/event_channel.h" #include "xen-compat.h" @@ -611,6 +612,23 @@ static bool kvm_xen_hcall_vcpu_op(struct kvm_xen_exit *exit, X86CPU *cpu, return true; } +static bool kvm_xen_hcall_evtchn_op(struct kvm_xen_exit *exit, + int cmd, uint64_t arg) +{ + int err = -ENOSYS; + + switch (cmd) { + case EVTCHNOP_init_control: + err = -ENOSYS; + break; + default: + return false; + } + + exit->u.hcall.result = err; + return true; +} + static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit) { uint16_t code = exit->u.hcall.input; @@ -621,6 +639,9 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit) } switch (code) { + case __HYPERVISOR_event_channel_op: + return kvm_xen_hcall_evtchn_op(exit, exit->u.hcall.params[0], + exit->u.hcall.params[1]); case __HYPERVISOR_vcpu_op: return kvm_xen_hcall_vcpu_op(exit, cpu, exit->u.hcall.params[0],