Kyle Roarty has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34555 )

Change subject: gpu-compute: Fix deadlock in fetch_unit after branch instruction
......................................................................

gpu-compute: Fix deadlock in fetch_unit after branch instruction

The following deadlock was occuring in fetch_unit w/timingSim:
1. exec() is called, a wave is ready to fetch, so it sets pendingFetch
2. A packet is sent to ITLB to fetch for that wave
3. The wave executes a branch, causing the fetch buffer to be cleared
4. The packet is handled, and fetch() is called. However, because the
fetch buffer was cleared, it returns doing nothing.
5. exec() gets called again, but the wave will never be scheduled to
fetch, as pendingFetch is still set to true.

This patch clears pendingFetch (and dropFetch) before returning when
the instruction buffer has been cleared in fetch().

dropFetch needed to be cleared otherwise gem5 would crash.

Change-Id: Iccbac7defc4849c19e8b17aa2492da641defb772
---
M src/gpu-compute/fetch_unit.cc
1 file changed, 2 insertions(+), 0 deletions(-)



diff --git a/src/gpu-compute/fetch_unit.cc b/src/gpu-compute/fetch_unit.cc
index 4e4259e..098b783 100644
--- a/src/gpu-compute/fetch_unit.cc
+++ b/src/gpu-compute/fetch_unit.cc
@@ -240,6 +240,8 @@
      * pending, in the same cycle another instruction is trying to fetch.
      */
if (!fetchBuf.at(wavefront->wfSlotId).isReserved(pkt->req->getVaddr())) {
+        wavefront->dropFetch = false;
+        wavefront->pendingFetch = false;
         return;
     }


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34555
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Iccbac7defc4849c19e8b17aa2492da641defb772
Gerrit-Change-Number: 34555
Gerrit-PatchSet: 1
Gerrit-Owner: Kyle Roarty <kyleroarty1...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to