]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Fix event channel unmasking for two-level ABI
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 27 Feb 2015 13:48:46 +0000 (13:48 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Fri, 27 Feb 2015 13:48:46 +0000 (13:48 +0000)
The two-level ABI requires that an event is masked for the unmask
hypercall to raise the event, so the test-and-clear operation in the
guest basically means that pending events get stuck. The simple fix
is to re-mask pending events before making the hypercall. This is
unnecessary when the FIFO ABI is used, but it's safe. Hence this patch
unconditionally re-masks pending events, regardless of ABI, before
making the unmask hypercall.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/evtchn.c

index 63af0797b7cd7aa7332450b9bb187a0b9096411c..3bb8d18ac5e4f5b15b751489fc4ff7d89c7ca356 100644 (file)
@@ -710,8 +710,16 @@ EvtchnUnmask(
 
     if (XENBUS_EVTCHN_ABI(PortUnmask,
                           &Context->EvtchnAbi,
-                          LocalPort))
+                          LocalPort)) {
+        //
+        // The event was pending so we must re-mask and use
+        // a hypercall to do the unmask and raise the event
+        //
+        XENBUS_EVTCHN_ABI(PortMask,
+                          &Context->EvtchnAbi,
+                          LocalPort);
         (VOID) EventChannelUnmask(LocalPort);
+    }
 
 done:
     if (!InUpcall)