changeset 90eeefe7e341 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=90eeefe7e341
description:
        arch, x86: Delete packet in IntDevice::recvResponse

        IntDevice::recvResponse is called from two places in current mainline: 
(1) the
        short circuit path of X86ISA::IntDevice::IntMasterPort::sendMessage for 
atomic
        mode, and (2) the full request->response path to and from the x86 
interrupts
        device (finally called from MessageMasterPort::recvTimingResp). In the 
former
        case, the packet was deleted correctly, but in the latter case, the 
packet and
        request leak. To fix the leak, move request and packet deletion into 
IntDevice
        inherited class implementations of recvResponse.

diffstat:

 src/dev/x86/i82094aa.cc |  9 +++++++++
 src/dev/x86/i82094aa.hh |  2 ++
 src/dev/x86/intdev.cc   |  2 --
 src/dev/x86/intdev.hh   |  1 +
 4 files changed, 12 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r d2114f5629ff -r 90eeefe7e341 src/dev/x86/i82094aa.cc
--- a/src/dev/x86/i82094aa.cc   Tue Sep 29 09:28:25 2015 -0500
+++ b/src/dev/x86/i82094aa.cc   Tue Sep 29 09:28:26 2015 -0500
@@ -88,6 +88,15 @@
 }
 
 Tick
+X86ISA::I82094AA::recvResponse(PacketPtr pkt)
+{
+    // Packet instantiated calling sendMessage() in signalInterrupt()
+    delete pkt->req;
+    delete pkt;
+    return 0;
+}
+
+Tick
 X86ISA::I82094AA::read(PacketPtr pkt)
 {
     assert(pkt->getSize() == 4);
diff -r d2114f5629ff -r 90eeefe7e341 src/dev/x86/i82094aa.hh
--- a/src/dev/x86/i82094aa.hh   Tue Sep 29 09:28:25 2015 -0500
+++ b/src/dev/x86/i82094aa.hh   Tue Sep 29 09:28:26 2015 -0500
@@ -105,6 +105,8 @@
     BaseMasterPort &getMasterPort(const std::string &if_name,
                                   PortID idx = InvalidPortID);
 
+    Tick recvResponse(PacketPtr pkt) M5_ATTR_OVERRIDE;
+
     void signalInterrupt(int line);
     void raiseInterruptPin(int number);
     void lowerInterruptPin(int number);
diff -r d2114f5629ff -r 90eeefe7e341 src/dev/x86/intdev.cc
--- a/src/dev/x86/intdev.cc     Tue Sep 29 09:28:25 2015 -0500
+++ b/src/dev/x86/intdev.cc     Tue Sep 29 09:28:26 2015 -0500
@@ -59,8 +59,6 @@
             assert(pkt->isResponse());
             // also ignore the latency in handling the response
             recvResponse(pkt);
-            delete pkt->req;
-            delete pkt;
         }
     }
 }
diff -r d2114f5629ff -r 90eeefe7e341 src/dev/x86/intdev.hh
--- a/src/dev/x86/intdev.hh     Tue Sep 29 09:28:25 2015 -0500
+++ b/src/dev/x86/intdev.hh     Tue Sep 29 09:28:26 2015 -0500
@@ -150,6 +150,7 @@
     virtual Tick
     recvResponse(PacketPtr pkt)
     {
+        panic("recvResponse not implemented.\n");
         return 0;
     }
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to