]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
Fix checked-only bugcheck (0xD1 due to IsOnList in buffer.c)
authorOwen Smith <owen.smith@citrix.com>
Tue, 20 May 2014 13:04:27 +0000 (14:04 +0100)
committerOwen Smith <owen.smith@citrix.com>
Tue, 20 May 2014 13:04:27 +0000 (14:04 +0100)
Signed-off-by: Owen Smith <owen.smith@citrix.com>
sdv.py [deleted file]
src/xenvbd/blockring.c
src/xenvbd/buffer.c
src/xenvbd/pdo.c

diff --git a/sdv.py b/sdv.py
deleted file mode 100644 (file)
index 0704bc8..0000000
--- a/sdv.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!python -u
-
-import os, sys
-import datetime
-import re
-import glob
-import tarfile
-import subprocess
-
-def shell(command):
-    print(command)
-    sys.stdout.flush()
-
-    pipe = os.popen(command, 'r', 1)
-
-    for line in pipe:
-        print(line.rstrip())
-
-    return pipe.close()
-
-
-class msbuild_failure(Exception):
-    def __init__(self, value):
-        self.value = value
-    def __str__(self):
-        return repr(self.value)
-
-def msbuild(name, target, args):
-    cwd = os.getcwd()
-
-    os.environ['PLATFORM'] = 'x64'
-    os.environ['CONFIGURATION'] = 'Windows 8 Release'
-    os.environ['TARGET'] = target
-    os.environ['BUILD_FILE'] = name + '.vcxproj'
-    os.environ['BUILD_ARGS'] = args
-
-    os.chdir('proj')
-    os.chdir(name)
-    status = shell('..\\msbuild.bat')
-    os.chdir(cwd)
-
-#    if (status != None):
-#        raise msbuild_failure(sdv_arg)
-
-
-if __name__ == '__main__':
-    msbuild('xencrsh', 'sdv', '/p:Inputs="/clean"')
-    msbuild('xenvbd',  'sdv', '/p:Inputs="/clean"')
-    msbuild('xencrsh', 'sdv', '/p:Inputs="/check:default.sdv"')
-    msbuild('xenvbd',  'sdv', '/p:Inputs="/check:default.sdv"')
-    msbuild('xencrsh', 'dvl', '')
-    msbuild('xenvbd',  'dvl', '')
-#archive the dvl.xmls
index 51e669f3d2e1cade45ce7db893249b8b22a24960..40b0d9f32c95f647839c69350ffca82a02bd663a 100644 (file)
@@ -419,10 +419,11 @@ BlockRingDebugCallback(
     IN  PXENBUS_DEBUG_CALLBACK      Callback
     )
 {
-    ULONG   Index;
+    ULONG           Index;
+    PXENVBD_GRANTER Granter = FrontendGetGranter(BlockRing->Frontend);
 
     DEBUG(Printf, Debug, Callback,
-            "BLOCKRING: Requests : %d / %d / %d\n", 
+            "BLOCKRING: Requests  : %d / %d / %d\n",
             BlockRing->Outstanding,
             BlockRing->Submitted,
             BlockRing->Recieved);
@@ -434,25 +435,27 @@ BlockRingDebugCallback(
     if (BlockRing->SharedRing) {
         DEBUG(Printf, Debug, Callback,
                 "BLOCKRING: SharedRing : %d / %d - %d / %d\n",
-                BlockRing->SharedRing->req_prod, 
-                BlockRing->SharedRing->req_event, 
-                BlockRing->SharedRing->rsp_prod, 
+                BlockRing->SharedRing->req_prod,
+                BlockRing->SharedRing->req_event,
+                BlockRing->SharedRing->rsp_prod,
                 BlockRing->SharedRing->rsp_event);
     }
 
     DEBUG(Printf, Debug, Callback,
-            "BLOCKRING: FrontRing : %d / %d (%d)\n", 
+            "BLOCKRING: FrontRing  : %d / %d (%d)\n",
             BlockRing->FrontRing.req_prod_pvt,
-            BlockRing->FrontRing.rsp_cons, 
+            BlockRing->FrontRing.rsp_cons,
             BlockRing->FrontRing.nr_ents);
 
     DEBUG(Printf, Debug, Callback,
-            "BLOCKRING: Order : %d\n", 
+            "BLOCKRING: Order      : %d\n",
             BlockRing->Order);
     for (Index = 0; Index < (1ul << BlockRing->Order); ++Index) {
         DEBUG(Printf, Debug, Callback,
-                "BLOCKRING: Grants[%-2d] : %d\n", 
-                Index, BlockRing->Grants[Index]);
+                "BLOCKRING: Grants[%-2d] : 0x%p (%u)\n", 
+                Index,
+                BlockRing->Grants[Index],
+                GranterReference(Granter, BlockRing->Grants[Index]));
     }
 
     BlockRing->Submitted = BlockRing->Recieved = 0;
index 1306c05fd15291d2caba4603d4181fee10ac13f6..85ef666c63e3bd1619948ebf586531a17ecbc1b1 100644 (file)
@@ -112,23 +112,40 @@ __BufferFree(
 static DECLSPEC_NOINLINE BOOLEAN
 __IsOnList(
     IN  PLIST_ENTRY             ListHead,
-    IN  PLIST_ENTRY             ListItem
+    IN  PLIST_ENTRY             ListItem,
+    IN  BOOLEAN                 Locked
     )
 {
+    KIRQL       Irql;
     PLIST_ENTRY Entry;
+    BOOLEAN     Found = FALSE;
+
+    if (!Locked)
+        KeAcquireSpinLock(&__Buffer.Lock, &Irql);
+
+    ASSERT3P(ListHead, !=, NULL);
+    ASSERT3P(ListItem, !=, NULL);
+    ASSERT3P(ListHead->Flink, !=, NULL);
+    ASSERT3P(ListHead, !=, ListItem);
+    ASSERT3U(KeGetCurrentIrql(), ==, DISPATCH_LEVEL);
 
     for (Entry = ListHead->Flink; Entry != ListHead; Entry = Entry->Flink) {
         if (Entry == ListItem) {
-            return TRUE;
+            Found = TRUE;
+            break;
         }
     }
-    return FALSE;
+
+    if (!Locked)
+        KeReleaseSpinLock(&__Buffer.Lock, Irql);
+
+    return Found;
 }
 
 #ifdef DBG
-#define IsOnList(a, b)  __IsOnList(a, b)
+#define IsOnList(a, b, c)  __IsOnList(a, b, c)
 #else
-#define IsOnList(a, b)  (TRUE)
+#define IsOnList(a, b, c)  (TRUE)
 #endif
 
 static DECLSPEC_NOINLINE VOID
@@ -146,7 +163,7 @@ __BufferPushFreeList(
 }
 static DECLSPEC_NOINLINE PXENVBD_BUFFER
 __BufferPopFreeList(
-)
+    )
 {
     PLIST_ENTRY     Entry;
 
@@ -164,7 +181,7 @@ __BufferPopFreeList(
 static DECLSPEC_NOINLINE VOID
 __BufferPushUsedList(
     IN PXENVBD_BUFFER           BufferId
-)
+    )
 {
     ASSERT3P(BufferId->Entry.Flink, ==, NULL);
     ASSERT3P(BufferId->Entry.Blink, ==, NULL);
@@ -176,7 +193,7 @@ __BufferPushUsedList(
 }
 static DECLSPEC_NOINLINE PXENVBD_BUFFER
 __BufferPopUsedList(
-)
+    )
 {
     PLIST_ENTRY     Entry;
 
@@ -198,7 +215,7 @@ __BufferRemoveUsedList(
 {
     ASSERT3P(BufferId->Entry.Flink, !=, NULL);
     ASSERT3P(BufferId->Entry.Blink, !=, NULL);
-    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry));
+    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry, TRUE));
 
     RemoveEntryList(&BufferId->Entry);
     BufferId->Entry.Flink = NULL;
@@ -351,7 +368,7 @@ BufferCopyIn(
     ASSERT3U(Length, <=, PAGE_SIZE);
 
     ASSERT3P(BufferId->VAddr, !=, NULL);
-    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry));
+    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry, FALSE));
     RtlCopyMemory(BufferId->VAddr, Input, Length);
 }
 
@@ -369,7 +386,7 @@ BufferCopyOut(
     ASSERT3U(Length, <=, PAGE_SIZE);
 
     ASSERT3P(BufferId->VAddr, !=, NULL);
-    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry));
+    ASSERT(IsOnList(&__Buffer.UsedList, &BufferId->Entry, FALSE));
     RtlCopyMemory(Output, BufferId->VAddr, Length);
 }
 
index 507591c999663bc15db6951cc806d20ab7ca70a4..16207eb2a2e7865dc18630bad16e82bd6e9a085f 100644 (file)
@@ -233,7 +233,7 @@ __LookasideDebug(
     )
 {
     DEBUG(Printf, Debug, Callback,
-          "PDO: %s: %u / %u (%u failed)\n",
+          "LOOKASIDE: %s: %u / %u (%u failed)\n",
           Name, Lookaside->Used,
           Lookaside->Max, Lookaside->Failed);
 
@@ -314,12 +314,13 @@ PdoDebugCallback(
     __LookasideDebug(&Pdo->SegmentList, DebugInterface, DebugCallback, "SEGMENTs");
     __LookasideDebug(&Pdo->MappingList, DebugInterface, DebugCallback, "MAPPINGs");
 
-    FrontendDebugCallback(Pdo->Frontend, DebugInterface, DebugCallback);
     QueueDebugCallback(&Pdo->FreshSrbs,    "Fresh    ", DebugInterface, DebugCallback);
     QueueDebugCallback(&Pdo->PreparedReqs, "Prepared ", DebugInterface, DebugCallback);
     QueueDebugCallback(&Pdo->SubmittedReqs, "Submitted", DebugInterface, DebugCallback);
     QueueDebugCallback(&Pdo->ShutdownSrbs, "Shutdown ", DebugInterface, DebugCallback);
 
+    FrontendDebugCallback(Pdo->Frontend, DebugInterface, DebugCallback);
+
     Pdo->BlkOpRead = Pdo->BlkOpWrite = 0;
     Pdo->BlkOpIndirectRead = Pdo->BlkOpIndirectWrite = 0;
     Pdo->BlkOpBarrier = Pdo->BlkOpDiscard = 0;
@@ -862,6 +863,7 @@ PdoPutTag(
     }
 
     KeReleaseSpinLock(&Queue->Lock, Irql);
+    Warning("Target[%d] : Tag %x not found in submitted list\n", PdoGetTargetId(Pdo), Tag);
     return NULL;
 }