summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
authorKrishnendra Nathella <Krishnendra.Nathella@arm.com>2012-09-07 14:20:53 -0500
committerKrishnendra Nathella <Krishnendra.Nathella@arm.com>2012-09-07 14:20:53 -0500
commit3f5ee1cf8c9e840426e3110644180fed5a1dbcb0 (patch)
treef6c43437b06772db981971b9085decda90ac8072 /src/sim/system.cc
parent3742b19b368eb371e2fd8fefc388a8ca65a3113d (diff)
downloadgem5-3f5ee1cf8c9e840426e3110644180fed5a1dbcb0.tar.xz
sim: add validation to make sure there is memory where we're loading the kernel
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc7
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);