From 39b5b5e5113579ec49e81b14124e97bc8e7e1a6b Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Mon, 13 Feb 2023 10:58:12 -0600 Subject: [PATCH] dev-amdgpu: Fix address in POLL_REGMEM SDMA packet The address for the POLL_REGMEM packet should not be shifted when the mode is 1 (memory). Relevant driver code below is not shifting the address. The shift is causing a page fault due to the incorrect address. This changeset removes the shift so the correct address is translated. https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/blob/ roc-4.3.x/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c#L903 Change-Id: I7a0ec3245ca14376670df24c5d3773958c08d751 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67877 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Tested-by: kokoro --- src/dev/amdgpu/sdma_engine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/amdgpu/sdma_engine.cc b/src/dev/amdgpu/sdma_engine.cc index 4c03bf57b2..736df45d9d 100644 --- a/src/dev/amdgpu/sdma_engine.cc +++ b/src/dev/amdgpu/sdma_engine.cc @@ -832,7 +832,7 @@ SDMAEngine::pollRegMem(SDMAQueue *q, sdmaPollRegMemHeader *header, auto cb = new DmaVirtCallback( [ = ] (const uint32_t &dma_buffer) { pollRegMemRead(q, header, pkt, dma_buffer, 0); }); - dmaReadVirt(pkt->address >> 3, sizeof(uint32_t), cb, + dmaReadVirt(pkt->address, sizeof(uint32_t), cb, (void *)&cb->dmaBuffer); } else { panic("SDMA poll mem operation not implemented.");