From 190cc3c0edd60876150959ee9f242363e40d168e Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 13 Dec 2022 17:20:46 +0000 Subject: hw/xen: Implement EVTCHNOP_unmask This finally comes with a mechanism for actually injecting events into the guest vCPU, with all the atomic-test-and-set that's involved in setting the bit in the shinfo, then the index in the vcpu_info, and injecting either the lapic vector as MSI, or letting KVM inject the bare vector. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'target/i386') diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c index fab7d6b..884e1c9 100644 --- a/target/i386/kvm/xen-emu.c +++ b/target/i386/kvm/xen-emu.c @@ -817,6 +817,18 @@ static bool kvm_xen_hcall_evtchn_op(struct kvm_xen_exit *exit, X86CPU *cpu, err = xen_evtchn_close_op(&close); break; } + case EVTCHNOP_unmask: { + struct evtchn_unmask unmask; + + qemu_build_assert(sizeof(unmask) == 4); + if (kvm_copy_from_gva(cs, arg, &unmask, sizeof(unmask))) { + err = -EFAULT; + break; + } + + err = xen_evtchn_unmask_op(&unmask); + break; + } default: return false; } -- cgit v1.1