Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/65091?usp=email )

Change subject: dev-amdgpu: Fix GART PTE size
......................................................................

dev-amdgpu: Fix GART PTE size

The GART table is a legacy 1-level page table primarily used for
supervisor mode accesses to GPUs. The PTE size is 64-bits, not 32-bit.
This causes memory sizes >3GB (in X86) to fail loading amdgpu driver.

This changeset fixes the issue by setting the GART mappings to the
correct data type.

Change-Id: Ibfba2443675fe28316d26afa5f1a14885fdce40c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65091
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
---
M src/dev/amdgpu/amdgpu_device.cc
M src/dev/amdgpu/amdgpu_vm.hh
2 files changed, 22 insertions(+), 2 deletions(-)

Approvals:
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/amdgpu/amdgpu_device.cc b/src/dev/amdgpu/amdgpu_device.cc
index 227e69e..2b58b20 100644
--- a/src/dev/amdgpu/amdgpu_device.cc
+++ b/src/dev/amdgpu/amdgpu_device.cc
@@ -270,7 +270,7 @@

     // Record the value
     if (aperture == gpuvm.gartBase()) {
-        gpuvm.gartTable[aperture_offset] = pkt->getLE<uint32_t>();
+ gpuvm.gartTable[aperture_offset] = pkt->getUintX(ByteOrder::little); DPRINTF(AMDGPUDevice, "GART translation %p -> %p\n", aperture_offset,
                 gpuvm.gartTable[aperture_offset]);
     }
diff --git a/src/dev/amdgpu/amdgpu_vm.hh b/src/dev/amdgpu/amdgpu_vm.hh
index 8df169b..212a688 100644
--- a/src/dev/amdgpu/amdgpu_vm.hh
+++ b/src/dev/amdgpu/amdgpu_vm.hh
@@ -165,7 +165,7 @@
* Copy of GART table. Typically resides in device memory, however we use
      * a copy in gem5 to simplify the interface.
      */
-    std::unordered_map<uint64_t, uint32_t> gartTable;
+    std::unordered_map<uint64_t, uint64_t> gartTable;

     void readMMIO(PacketPtr pkt, Addr offset);
     void writeMMIO(PacketPtr pkt, Addr offset);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/65091?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: Ibfba2443675fe28316d26afa5f1a14885fdce40c
Gerrit-Change-Number: 65091
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Alexandru Duțu (Alex) <alexandru.d...@amd.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to