arch-arm: dtb_addr is already encoding the loadAddrOffset
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 18 Jan 2021 16:24:22 +0000 (16:24 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 18 Jan 2021 22:27:32 +0000 (22:27 +0000)
This fixes a bug in AArch32 where the dtb_address is
adding the loadAddrOffset twice to the dtb base address
after

https://gem5-review.googlesource.com/c/public/gem5/+/35076

Change-Id: Ia8bd35a02d998c54fbc3a889739c9abbeb506d96
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39216
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/freebsd/fs_workload.cc
src/arch/arm/linux/fs_workload.cc

index 8eb3c70e19f0f67230a43612e3107eb38e24c412..cc0151bb653ebf9c6a21b0a0316f88d5b90bfdd0 100644 (file)
@@ -95,7 +95,7 @@ FsFreebsd::initState()
     // Kernel supports flattened device tree and dtb file specified.
     // Using Device Tree Blob to describe system configuration.
     inform("Loading DTB file: %s at address %#x\n", params().dtb_filename,
-            params().dtb_addr + _loadAddrOffset);
+            params().dtb_addr);
 
     auto *dtb_file = new ::Loader::DtbFile(params().dtb_filename);
 
@@ -108,7 +108,7 @@ FsFreebsd::initState()
         bootReleaseAddr = ra & ~ULL(0x7F);
 
     dtb_file->buildImage().
-        offset(params().dtb_addr + _loadAddrOffset).
+        offset(params().dtb_addr).
         write(system->physProxy);
     delete dtb_file;
 
@@ -116,7 +116,7 @@ FsFreebsd::initState()
     for (auto *tc: system->threads) {
         tc->setIntReg(0, 0);
         tc->setIntReg(1, params().machine_type);
-        tc->setIntReg(2, params().dtb_addr + _loadAddrOffset);
+        tc->setIntReg(2, params().dtb_addr);
     }
 }
 
index f05fd6faa5a22dd6d105b050a46a29a3f74ffb8b..b296b68081d29aae644e13693104ea38f710f44c 100644 (file)
@@ -151,7 +151,7 @@ FsLinux::initState()
         DPRINTF(Loader, "Boot atags was %d bytes in total\n", size << 2);
         DDUMP(Loader, boot_data, size << 2);
 
-        system->physProxy.writeBlob(params().dtb_addr + _loadAddrOffset,
+        system->physProxy.writeBlob(params().dtb_addr,
                                     boot_data, size << 2);
 
         delete[] boot_data;
@@ -170,7 +170,7 @@ FsLinux::initState()
         for (auto *tc: system->threads) {
             tc->setIntReg(0, 0);
             tc->setIntReg(1, params().machine_type);
-            tc->setIntReg(2, params().dtb_addr + _loadAddrOffset);
+            tc->setIntReg(2, params().dtb_addr);
         }
     }
 }