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

[win-pv-devel] [PATCH 1/2] Add registry override for EVTCHN ABI



Add a registry parameter DWORD:UseEvtchnFifoAbi than can be set to zero
to prevent use of the FIFO ABI or non-zero to allow it. The default value is
non-zero.

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

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 2be0da8..1bd5e5f 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -39,6 +39,7 @@
 #include "evtchn_fifo.h"
 #include "fdo.h"
 #include "hash_table.h"
+#include "registry.h"
 #include "dbg_print.h"
 #include "assert.h"
 
@@ -98,6 +99,7 @@ struct _XENBUS_EVTCHN_CONTEXT {
     PXENBUS_EVTCHN_ABI_CONTEXT      EvtchnTwoLevelContext;
     PXENBUS_EVTCHN_ABI_CONTEXT      EvtchnFifoContext;
     XENBUS_EVTCHN_ABI               EvtchnAbi;
+    BOOLEAN                         UseEvtchnFifoAbi;
     PXENBUS_HASH_TABLE              Table;
     LIST_ENTRY                      List;
 };
@@ -670,13 +672,19 @@ EvtchnAbiAcquire(
 {
     NTSTATUS                    status;
 
-    EvtchnFifoGetAbi(Context->EvtchnFifoContext,
-                     &Context->EvtchnAbi);
+    if (Context->UseEvtchnFifoAbi) {
+        EvtchnFifoGetAbi(Context->EvtchnFifoContext,
+                         &Context->EvtchnAbi);
 
-    status = XENBUS_EVTCHN_ABI(Acquire, &Context->EvtchnAbi);
-    if (NT_SUCCESS(status))
+        status = XENBUS_EVTCHN_ABI(Acquire, &Context->EvtchnAbi);
+        if (!NT_SUCCESS(status))
+            goto use_two_level;
+
+        Info("FIFO\n");
         goto done;
+    }
 
+use_two_level:
     EvtchnTwoLevelGetAbi(Context->EvtchnTwoLevelContext,
                          &Context->EvtchnAbi);
 
@@ -684,6 +692,8 @@ EvtchnAbiAcquire(
     if (!NT_SUCCESS(status))
         goto fail1;
 
+    Info("TWO LEVEL\n");
+
 done:
     return STATUS_SUCCESS;
 
@@ -1017,6 +1027,8 @@ EvtchnInitialize(
     OUT PXENBUS_EVTCHN_CONTEXT  *Context
     )
 {
+    HANDLE                      ParametersKey;
+    ULONG                       UseEvtchnFifoAbi;
     NTSTATUS                    status;
 
     Trace("====>\n");
@@ -1040,6 +1052,16 @@ EvtchnInitialize(
     if (!NT_SUCCESS(status))
         goto fail4;
 
+    ParametersKey = DriverGetParametersKey();
+
+    status = RegistryQueryDwordValue(ParametersKey,
+                                     "UseEvtchnFifoAbi",
+                                     &UseEvtchnFifoAbi);
+    if (!NT_SUCCESS(status))
+        UseEvtchnFifoAbi = 1;
+
+    (*Context)->UseEvtchnFifoAbi = (UseEvtchnFifoAbi != 0) ? TRUE : FALSE;
+
     status = SuspendGetInterface(FdoGetSuspendContext(Fdo),
                                  XENBUS_SUSPEND_INTERFACE_VERSION_MAX,
                                  (PINTERFACE)&(*Context)->SuspendInterface,
@@ -1153,6 +1175,8 @@ EvtchnTeardown(
     RtlZeroMemory(&Context->SuspendInterface,
                   sizeof (XENBUS_SUSPEND_INTERFACE));
 
+    Context->UseEvtchnFifoAbi = FALSE;
+
     EvtchnFifoTeardown(Context->EvtchnFifoContext);
     Context->EvtchnFifoContext = NULL;
 
-- 
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®.