mem: Check the XBar's port queues on functional snoops
authorAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 6 Nov 2015 08:26:09 +0000 (03:26 -0500)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 6 Nov 2015 08:26:09 +0000 (03:26 -0500)
The CoherentXBar currently doesn't check its queued slave ports when
receiving a functional snoop. This caused data corruption in cases
when a modified cache lines is forwarded between two caches.

Add the required functional calls into the queued slave ports.

src/mem/coherent_xbar.cc

index cf438bc95e16f8ee36e5d40fa384bbd5273e766c..6a0136ea8d4b562fc050b71d1163910d16cafb2f 100644 (file)
@@ -832,6 +832,14 @@ CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id)
                 pkt->cmdString());
     }
 
+    for (const auto& p : slavePorts) {
+        if (p->checkFunctional(pkt)) {
+            if (pkt->needsResponse())
+                pkt->makeResponse();
+            return;
+        }
+    }
+
     // forward to all snoopers
     forwardFunctional(pkt, InvalidPortID);
 }