OSDN Git Service

hw/xen: take iothread mutex in xen_evtchn_reset_op()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 24 Oct 2023 21:22:47 +0000 (22:22 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 6 Nov 2023 10:03:45 +0000 (10:03 +0000)
The xen_evtchn_soft_reset() function requires the iothread mutex, but is
also called for the EVTCHNOP_reset hypercall. Ensure the mutex is taken
in that case.

Cc: qemu-stable@nongnu.org
Fixes: a15b10978fe6 ("hw/xen: Implement EVTCHNOP_reset")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
hw/i386/kvm/xen_evtchn.c

index 3d6f4b4..b2b4be9 100644 (file)
@@ -1135,6 +1135,7 @@ int xen_evtchn_reset_op(struct evtchn_reset *reset)
         return -ESRCH;
     }
 
+    QEMU_IOTHREAD_LOCK_GUARD();
     return xen_evtchn_soft_reset();
 }