[gem5-dev] [S] Change in gem5/gem5[develop]: dev-amdgpu: Store SDMA queue type, use for ring ID

2022-11-18 Thread Matthew Poremba (Gerrit) via gem5-dev
Matthew Poremba has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/65691?usp=email )


Change subject: dev-amdgpu: Store SDMA queue type, use for ring ID
..

dev-amdgpu: Store SDMA queue type, use for ring ID

Currently the SDMA queue type is guessed in the trap method by looking
at which queue in the engine is processing packets. It is possible for
both queues to be processing (e.g., one queue sent a DMA and is waiting
then switch to another queue), triggering an assert.

Instead store the queue type in the queue itself and use that type in
trap to determine which ring ID to use for the interrupt packet.

Change-Id: If91c458e60a03f2013c0dc42bab0b1673e3dbd84
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65691
Maintainer: Jason Lowe-Power 
Reviewed-by: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/dev/amdgpu/sdma_engine.cc
M src/dev/amdgpu/sdma_engine.hh
2 files changed, 30 insertions(+), 6 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/amdgpu/sdma_engine.cc b/src/dev/amdgpu/sdma_engine.cc
index 59c5027..02203c8 100644
--- a/src/dev/amdgpu/sdma_engine.cc
+++ b/src/dev/amdgpu/sdma_engine.cc
@@ -55,11 +55,15 @@
 gfxIb.parent();
 gfx.valid(true);
 gfxIb.valid(true);
+gfx.queueType(SDMAGfx);
+gfxIb.queueType(SDMAGfx);

 page.ib();
 pageIb.parent();
 page.valid(true);
 pageIb.valid(true);
+page.queueType(SDMAPage);
+pageIb.queueType(SDMAPage);

 rlc0.ib();
 rlc0Ib.parent();
@@ -727,11 +731,7 @@

 DPRINTF(SDMAEngine, "Trap contextId: %p\n", pkt->intrContext);

-uint32_t ring_id = 0;
-assert(page.processing() ^ gfx.processing());
-if (page.processing()) {
-ring_id = 3;
-}
+uint32_t ring_id = (q->queueType() == SDMAPage) ? 3 : 0;

 gpuDevice->getIH()->prepareInterruptCookie(pkt->intrContext, ring_id,
getIHClientId(), TRAP_ID);
diff --git a/src/dev/amdgpu/sdma_engine.hh b/src/dev/amdgpu/sdma_engine.hh
index d0afaf7..0bfee12 100644
--- a/src/dev/amdgpu/sdma_engine.hh
+++ b/src/dev/amdgpu/sdma_engine.hh
@@ -64,9 +64,10 @@
 bool _processing;
 SDMAQueue *_parent;
 SDMAQueue *_ib;
+SDMAType _type;
   public:
 SDMAQueue() : _rptr(0), _wptr(0), _valid(false),  
_processing(false),

-_parent(nullptr), _ib(nullptr) {}
+_parent(nullptr), _ib(nullptr), _type(SDMAGfx) {}

 Addr base() { return _base; }
 Addr rptr() { return _base + _rptr; }
@@ -80,6 +81,7 @@
 bool processing() { return _processing; }
 SDMAQueue* parent() { return _parent; }
 SDMAQueue* ib() { return _ib; }
+SDMAType queueType() { return _type; }

 void base(Addr value) { _base = value; }

@@ -111,6 +113,7 @@
 void processing(bool value) { _processing = value; }
 void parent(SDMAQueue* q) { _parent = q; }
 void ib(SDMAQueue* ib) { _ib = ib; }
+void queueType(SDMAType type) { _type = type; }
 };

 /* SDMA Engine ID */

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/65691?usp=email
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: If91c458e60a03f2013c0dc42bab0b1673e3dbd84
Gerrit-Change-Number: 65691
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Matthew Poremba 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[develop]: dev-amdgpu: Store SDMA queue type, use for ring ID

2022-11-17 Thread Matthew Poremba (Gerrit) via gem5-dev
Matthew Poremba has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/65691?usp=email )



Change subject: dev-amdgpu: Store SDMA queue type, use for ring ID
..

dev-amdgpu: Store SDMA queue type, use for ring ID

Currently the SDMA queue type is guessed in the trap method by looking
at which queue in the engine is processing packets. It is possible for
both queues to be processing (e.g., one queue sent a DMA and is waiting
then switch to another queue), triggering an assert.

Instead store the queue type in the queue itself and use that type in
trap to determine which ring ID to use for the interrupt packet.

Change-Id: If91c458e60a03f2013c0dc42bab0b1673e3dbd84
---
M src/dev/amdgpu/sdma_engine.cc
M src/dev/amdgpu/sdma_engine.hh
2 files changed, 26 insertions(+), 6 deletions(-)



diff --git a/src/dev/amdgpu/sdma_engine.cc b/src/dev/amdgpu/sdma_engine.cc
index 59c5027..02203c8 100644
--- a/src/dev/amdgpu/sdma_engine.cc
+++ b/src/dev/amdgpu/sdma_engine.cc
@@ -55,11 +55,15 @@
 gfxIb.parent();
 gfx.valid(true);
 gfxIb.valid(true);
+gfx.queueType(SDMAGfx);
+gfxIb.queueType(SDMAGfx);

 page.ib();
 pageIb.parent();
 page.valid(true);
 pageIb.valid(true);
+page.queueType(SDMAPage);
+pageIb.queueType(SDMAPage);

 rlc0.ib();
 rlc0Ib.parent();
@@ -727,11 +731,7 @@

 DPRINTF(SDMAEngine, "Trap contextId: %p\n", pkt->intrContext);

-uint32_t ring_id = 0;
-assert(page.processing() ^ gfx.processing());
-if (page.processing()) {
-ring_id = 3;
-}
+uint32_t ring_id = (q->queueType() == SDMAPage) ? 3 : 0;

 gpuDevice->getIH()->prepareInterruptCookie(pkt->intrContext, ring_id,
getIHClientId(), TRAP_ID);
diff --git a/src/dev/amdgpu/sdma_engine.hh b/src/dev/amdgpu/sdma_engine.hh
index d0afaf7..0bfee12 100644
--- a/src/dev/amdgpu/sdma_engine.hh
+++ b/src/dev/amdgpu/sdma_engine.hh
@@ -64,9 +64,10 @@
 bool _processing;
 SDMAQueue *_parent;
 SDMAQueue *_ib;
+SDMAType _type;
   public:
 SDMAQueue() : _rptr(0), _wptr(0), _valid(false),  
_processing(false),

-_parent(nullptr), _ib(nullptr) {}
+_parent(nullptr), _ib(nullptr), _type(SDMAGfx) {}

 Addr base() { return _base; }
 Addr rptr() { return _base + _rptr; }
@@ -80,6 +81,7 @@
 bool processing() { return _processing; }
 SDMAQueue* parent() { return _parent; }
 SDMAQueue* ib() { return _ib; }
+SDMAType queueType() { return _type; }

 void base(Addr value) { _base = value; }

@@ -111,6 +113,7 @@
 void processing(bool value) { _processing = value; }
 void parent(SDMAQueue* q) { _parent = q; }
 void ib(SDMAQueue* ib) { _ib = ib; }
+void queueType(SDMAType type) { _type = type; }
 };

 /* SDMA Engine ID */

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/65691?usp=email
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: If91c458e60a03f2013c0dc42bab0b1673e3dbd84
Gerrit-Change-Number: 65691
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org