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

[win-pv-devel] [PATCH xenvif] Stop lying about the lock state when calling into XENBUS_CACHE


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <paul.durrant@xxxxxxxxxx>
  • Date: Fri, 31 May 2019 11:00:16 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxxxxxxxxxxxxx
  • Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
  • Delivery-date: Fri, 31 May 2019 10:00:31 +0000
  • Ironport-sdr: A4yuZIBG+iJKCT8ACluJK2Iq9JeRNvkgqvxD63teIgiSnpTfmZCddA4dypoYGji0I17qyXatXf 1hR4NYKLDu3yZk35luSQoZWtsIDnPada4ScmWfNiqd4m8BOFEmZocZYUt1GReA21GLGUC7kqdu 23o+L1ROSg6h2PA0DyNZpuny2KDqns4kIYVEaxw6NYNbbp6Uy7dLh7v4UIEaZjeETeReGoRMA4 3OrXqQZrd2dI4fT/Ue26DSWuQrC9N6MHQL7YXAe/gdx/St/888HVwLTTYrons45vkqzBzsYT4j X/A=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Various cache access that used to be under protection of the reciver ring
lock are no longer subject to that lock, and thus the 'Locked' parameter
passed to the Get/Put methods needs to be FALSE rather than TRUE.

This bug was not spotted under recent changes applied to the implementation
of XENBUS_CACHE, which removed use of atomic bit operations.

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

diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c
index 9c69b77..32bc424 100644
--- a/src/xenvif/receiver.c
+++ b/src/xenvif/receiver.c
@@ -685,7 +685,7 @@ ReceiverRingPullup(
             Next = Mdl->Next;
             Mdl->Next = NULL;
 
-            __ReceiverRingPutMdl(Ring, Mdl, TRUE);
+            __ReceiverRingPutMdl(Ring, Mdl, FALSE);
 
             Mdl = Next;
         }
@@ -759,7 +759,7 @@ __ReceiverRingBuildSegment(
 
     InfoVa += Packet->Offset;
 
-    Segment = __ReceiverRingGetPacket(Ring, TRUE);
+    Segment = __ReceiverRingGetPacket(Ring, FALSE);
 
     status = STATUS_NO_MEMORY;
     if (Segment == NULL)
@@ -850,7 +850,7 @@ __ReceiverRingBuildSegment(
     for (;;) {
         ULONG   Length;
 
-        Mdl->Next = __ReceiverRingGetMdl(Ring, TRUE);
+        Mdl->Next = __ReceiverRingGetMdl(Ring, FALSE);
             
         status = STATUS_NO_MEMORY;
         if (Mdl->Next == NULL)
@@ -900,12 +900,12 @@ fail2:
         Next = Mdl->Next;
         Mdl->Next = NULL;
 
-        __ReceiverRingPutMdl(Ring, Mdl, TRUE);
+        __ReceiverRingPutMdl(Ring, Mdl, FALSE);
 
         Mdl = Next;
     }
 
-    __ReceiverRingPutPacket(Ring, Segment, TRUE);
+    __ReceiverRingPutPacket(Ring, Segment, FALSE);
 
 fail1:
     Error("fail1 (%08x)\n", status);
@@ -1068,7 +1068,7 @@ ReceiverRingProcessLargePacket(
 
         ReceiverRingCompletePacket(Ring, Packet);
     } else {
-        __ReceiverRingPutPacket(Ring, Packet, TRUE);
+        __ReceiverRingPutPacket(Ring, Packet, FALSE);
     }
 
     return;
@@ -1087,13 +1087,13 @@ fail1:
             Next = Mdl->Next;
             Mdl->Next = NULL;
 
-            __ReceiverRingPutMdl(Ring, Mdl, TRUE);
+            __ReceiverRingPutMdl(Ring, Mdl, FALSE);
 
             Mdl = Next;
         }
     }
 
-    __ReceiverRingPutPacket(Ring, Packet, TRUE);
+    __ReceiverRingPutPacket(Ring, Packet, FALSE);
 
     FrontendIncrementStatistic(Frontend,
                                XENVIF_RECEIVER_PACKETS_DROPPED,
@@ -1146,7 +1146,7 @@ ReceiverRingProcessStandardPacket(
         // of headroom (i.e. ByteOffset) so that it can pre-pend the header to 
the data
         // if something up the stack can't cope with the split.
 
-        Mdl = __ReceiverRingGetMdl(Ring, TRUE);
+        Mdl = __ReceiverRingGetMdl(Ring, FALSE);
 
         status = STATUS_NO_MEMORY;
         if (Mdl == NULL)
@@ -1189,14 +1189,14 @@ fail1:
             Next = Mdl->Next;
             Mdl->Next = NULL;
 
-            __ReceiverRingPutMdl(Ring, Mdl, TRUE);
+            __ReceiverRingPutMdl(Ring, Mdl, FALSE);
 
             Mdl = Next;
         }
     }
 
     Packet->Mdl.Next = NULL;
-    __ReceiverRingPutPacket(Ring, Packet, TRUE);
+    __ReceiverRingPutPacket(Ring, Packet, FALSE);
 
     FrontendIncrementStatistic(Frontend,
                                XENVIF_RECEIVER_PACKETS_DROPPED,
@@ -1236,7 +1236,7 @@ ReceiverRingProcessPacket(
     // Get a new packet structure that will just contain the header after
     // parsing. We need to preserve metadata from the original.
 
-    New = __ReceiverRingGetPacket(Ring, TRUE);
+    New = __ReceiverRingGetPacket(Ring, FALSE);
 
     status = STATUS_NO_MEMORY;
     if (New == NULL) {
@@ -1302,7 +1302,7 @@ fail3:
     Packet->Mdl.Next = NULL;
 
 fail2:
-    __ReceiverRingPutPacket(Ring, Packet, TRUE);
+    __ReceiverRingPutPacket(Ring, Packet, FALSE);
 
 fail1:
     if (Payload.Length != 0) {
@@ -1316,7 +1316,7 @@ fail1:
             Next = Mdl->Next;
             Mdl->Next = NULL;
 
-            __ReceiverRingPutMdl(Ring, Mdl, TRUE);
+            __ReceiverRingPutMdl(Ring, Mdl, FALSE);
 
             Mdl = Next;
         }
-- 
2.5.3


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

 


Rackspace

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