[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 10/15] Simplify EVTCHN Unmask



Just use the hypercall if the event channel is pending. It's a lot safer
than trying to avoid it.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenbus/evtchn.c | 48 ++++--------------------------------------------
 1 file changed, 4 insertions(+), 44 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 453f9d6..e33a68e 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -493,9 +493,7 @@ EvtchnUnmask(
 {
     PXENBUS_EVTCHN_CONTEXT      Context = Interface->Context;
     KIRQL                       Irql = PASSIVE_LEVEL;
-    BOOLEAN                     Pending;
     ULONG                       LocalPort;
-    ULONG                       Cpu;
 
     ASSERT3U(Channel->Magic, ==, XENBUS_EVTCHN_CHANNEL_MAGIC);
 
@@ -504,59 +502,21 @@ EvtchnUnmask(
 
     ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
 
-    Pending = FALSE;
-
     if (!Channel->Active)
         goto done;
 
     LocalPort = Channel->LocalPort;
 
-    Pending = XENBUS_EVTCHN_ABI(PortUnmask,
-                                &Context->EvtchnAbi,
-                                LocalPort);
-
-    if (!Pending)
-        goto done;
-
-    //
-    // If we are in context of the upcall then use a hypercall
-    // to schedule the pending event.
-    //
-    if (InUpcall) {
-        (VOID) EventChannelUnmask(LocalPort);
-
-        Pending = FALSE;
-        goto done;
-    }
-
-    //
-    // If we are not unmasking on the same CPU to which the
-    // event channel is bound, then we need to use a hypercall
-    // to schedule the upcall on the correct CPU.
-    //
-    Cpu = KeGetCurrentProcessorNumber();
-
-    if (Channel->Cpu != Cpu) {
-        (VOID) EventChannelUnmask(LocalPort);
-
-        Pending = FALSE;
-        goto done;
-    }
-
-    if (Channel->Mask)
-        XENBUS_EVTCHN_ABI(PortMask,
+    if (XENBUS_EVTCHN_ABI(PortUnmask,
                           &Context->EvtchnAbi,
-                          LocalPort);
-
-    XENBUS_EVTCHN_ABI(PortAck,
-                      &Context->EvtchnAbi,
-                      LocalPort);
+                          LocalPort))
+        (VOID) EventChannelUnmask(LocalPort);
 
 done:
     if (!InUpcall)
         KeReleaseSpinLock(&Channel->Lock, Irql);
 
-    return Pending;
+    return FALSE;
 }
 
 static NTSTATUS
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.