Hello Andreas Sandberg,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/14001
to review the following change.
Change subject: arch-arm: Deprecate usage of legacy bootloader patching
......................................................................
arch-arm: Deprecate usage of legacy bootloader patching
This patch is implicitly deprecating the usage of bootloader patching,
which is injecting instructions from gem5 into the bootloader
binary. This was probably meant to provide a dynamic bootloader
entry point.
This is not needed in ARMv8.0, since we can simply update the
ArmSystem::resetAddress with the bootloader entry point.
Change-Id: I0c469873b8d69f7b49a7383e0754468bc1f2bd72
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
---
M src/arch/arm/system.cc
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/arch/arm/system.cc b/src/arch/arm/system.cc
index 0630661..164c965 100644
--- a/src/arch/arm/system.cc
+++ b/src/arch/arm/system.cc
@@ -104,6 +104,12 @@
if (bootldr) {
bootldr->loadGlobalSymbols(debugSymbolTable);
+
+ warn_if(bootldr->entryPoint() != _resetAddr,
+ "Bootloader entry point %#x overriding reset address %#x",
+ bootldr->entryPoint(), _resetAddr);
+ const_cast<Addr&>(_resetAddr) = bootldr->entryPoint();
+
if ((bootldr->getArch() == ObjectFile::Arm64) && !_highestELIs64) {
warn("Highest ARM exception-level set to AArch32 but
bootloader "
"is for AArch64. Assuming you wanted these to match.\n");
@@ -132,22 +138,6 @@
if (bootldr) {
bootldr->loadSections(physProxy);
- uint8_t jump_to_bl_32[] =
- {
- 0x07, 0xf0, 0xa0, 0xe1 // branch to r7 in aarch32
- };
-
- uint8_t jump_to_bl_64[] =
- {
- 0xe0, 0x00, 0x1f, 0xd6 // instruction "br x7" in aarch64
- };
-
- // write the jump to branch table into address 0
- if (!_highestELIs64)
- physProxy.writeBlob(0x0, jump_to_bl_32, sizeof(jump_to_bl_32));
- else
- physProxy.writeBlob(0x0, jump_to_bl_64, sizeof(jump_to_bl_64));
-
inform("Using bootloader at address %#x\n", bootldr->entryPoint());
// Put the address of the boot loader into r7 so we know
@@ -160,9 +150,9 @@
if (!_highestELIs64)
threadContexts[i]->setIntReg(3, (kernelEntry &
loadAddrMask) +
loadAddrOffset);
+
threadContexts[i]->setIntReg(4, params()->gic_cpu_addr);
threadContexts[i]->setIntReg(5, params()->flags_addr);
- threadContexts[i]->setIntReg(7, bootldr->entryPoint());
}
inform("Using kernel entry physical address at %#x\n",
(kernelEntry & loadAddrMask) + loadAddrOffset);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14001
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0c469873b8d69f7b49a7383e0754468bc1f2bd72
Gerrit-Change-Number: 14001
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev