diff options
author | Krishnendra Nathella <Krishnendra.Nathella@arm.com> | 2012-09-07 14:20:53 -0500 |
---|---|---|
committer | Krishnendra Nathella <Krishnendra.Nathella@arm.com> | 2012-09-07 14:20:53 -0500 |
commit | 3f5ee1cf8c9e840426e3110644180fed5a1dbcb0 (patch) | |
tree | f6c43437b06772db981971b9085decda90ac8072 /src | |
parent | 3742b19b368eb371e2fd8fefc388a8ca65a3113d (diff) | |
download | gem5-3f5ee1cf8c9e840426e3110644180fed5a1dbcb0.tar.xz |
sim: add validation to make sure there is memory where we're loading the kernel
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/system.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc index 2dd4d41bd..4871ac824 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -266,6 +266,13 @@ System::initState() * Load the kernel code into memory */ if (params()->kernel != "") { + // Validate kernel mapping before loading binary + if (!(isMemAddr(kernelStart & loadAddrMask) && + isMemAddr(kernelEnd & loadAddrMask))) { + fatal("Kernel is mapped to invalid location (not memory). " + "kernelStart 0x(%x) - kernelEnd 0x(%x)\n", kernelStart, + kernelEnd); + } // Load program sections into memory kernel->loadSections(physProxy, loadAddrMask); |