dev-amdgpu: Add node_id to interrupt handler
The ROCm 6.0 driver adds a node_id field to interrupts which must match before passing on the interrupt to be cleared by the cookie from gem5's interrupt handler implementation. Add this field and enable for gfx942. The usage of the field can be seen in event_interrupt_isr_v9_4_3 at https://github.com/ROCm/ROCK-Kernel-Driver/blob/roc-6.0.x/drivers/ gpu/drm/amd/amdkfd/kfd_int_process_v9.c#L449 Change-Id: Iae8b8f0386a5ad2852b4a3c69f2c161d965c4922
This commit is contained in:
@@ -75,7 +75,8 @@ void
|
||||
AMDGPUInterruptHandler::prepareInterruptCookie(ContextID cntxt_id,
|
||||
uint32_t ring_id,
|
||||
uint32_t client_id,
|
||||
uint32_t source_id)
|
||||
uint32_t source_id,
|
||||
unsigned node_id)
|
||||
{
|
||||
assert(client_id == SOC15_IH_CLIENTID_RLC ||
|
||||
client_id == SOC15_IH_CLIENTID_SDMA0 ||
|
||||
@@ -112,6 +113,7 @@ AMDGPUInterruptHandler::prepareInterruptCookie(ContextID cntxt_id,
|
||||
cookie->clientId = client_id;
|
||||
cookie->sourceId = source_id;
|
||||
cookie->ringId = ring_id;
|
||||
cookie->nodeId = node_id;
|
||||
cookie->source_data_dw1 = cntxt_id;
|
||||
interruptQueue.push(cookie);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,8 @@ typedef struct
|
||||
uint32_t reserved2 : 15;
|
||||
uint32_t timestamp_src : 1;
|
||||
uint32_t pasid : 16;
|
||||
uint32_t reserved3 : 15;
|
||||
uint32_t nodeId : 8;
|
||||
uint32_t reserved3 : 7;
|
||||
uint32_t pasid_src : 1;
|
||||
uint32_t source_data_dw1;
|
||||
uint32_t source_data_dw2;
|
||||
@@ -171,7 +172,7 @@ class AMDGPUInterruptHandler : public DmaDevice
|
||||
|
||||
void setGPUDevice(AMDGPUDevice *gpu_device) { gpuDevice = gpu_device; }
|
||||
void prepareInterruptCookie(ContextID cntxtId, uint32_t ring_id,
|
||||
uint32_t client_id, uint32_t source_id);
|
||||
uint32_t client_id, uint32_t source_id, unsigned node_id);
|
||||
void submitInterruptCookie();
|
||||
void submitWritePointer();
|
||||
void intrPost();
|
||||
|
||||
@@ -537,7 +537,8 @@ PM4PacketProcessor::releaseMemDone(PM4Queue *q, PM4ReleaseMem *pkt, Addr addr)
|
||||
ringId = (q->queue() << 4) | (q->me() << 2) | q->pipe();
|
||||
}
|
||||
gpuDevice->getIH()->prepareInterruptCookie(pkt->intCtxId, ringId,
|
||||
SOC15_IH_CLIENTID_GRBM_CP, CP_EOP);
|
||||
SOC15_IH_CLIENTID_GRBM_CP, CP_EOP,
|
||||
2 * getIpId());
|
||||
gpuDevice->getIH()->submitInterruptCookie();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,9 +81,9 @@ SDMAEngine::setGPUDevice(AMDGPUDevice *gpu_device)
|
||||
}
|
||||
|
||||
int
|
||||
SDMAEngine::getIHClientId()
|
||||
SDMAEngine::getIHClientId(int _id)
|
||||
{
|
||||
switch (id) {
|
||||
switch (_id) {
|
||||
case 0:
|
||||
return SOC15_IH_CLIENTID_SDMA0;
|
||||
case 1:
|
||||
@@ -809,8 +809,12 @@ SDMAEngine::trap(SDMAQueue *q, sdmaTrap *pkt)
|
||||
|
||||
uint32_t ring_id = (q->queueType() == SDMAPage) ? 3 : 0;
|
||||
|
||||
int node_id = 0;
|
||||
int local_id = getId();
|
||||
|
||||
gpuDevice->getIH()->prepareInterruptCookie(pkt->intrContext, ring_id,
|
||||
getIHClientId(), TRAP_ID);
|
||||
getIHClientId(local_id),
|
||||
TRAP_ID, 2*node_id);
|
||||
gpuDevice->getIH()->submitInterruptCookie();
|
||||
|
||||
delete pkt;
|
||||
|
||||
@@ -172,7 +172,7 @@ class SDMAEngine : public DmaVirtDevice
|
||||
/**
|
||||
* Returns the client id for the Interrupt Handler.
|
||||
*/
|
||||
int getIHClientId();
|
||||
int getIHClientId(int _id);
|
||||
|
||||
/**
|
||||
* Methods for translation.
|
||||
|
||||
Reference in New Issue
Block a user