From 62ae85c0a2db286bcf1c8df5ad8f97a8bd527a55 Mon Sep 17 00:00:00 2001 From: Geoffrey Blake Date: Thu, 12 May 2016 11:47:43 -0500 Subject: sim: Implement load_addr_mask auto-calculation Recent Linux kernels for AArch64 have changed their start addresses but we still want to relocate the kernel to 0x80080000 which required hacking the load_addr_mask in Realview.py to be 0x7ffffff from 0xfffffff to mask off the proper number of MSBs to load the kernel in the desired location. To avoid having to make this change in the future again, we auto-calculate the load_addr_mask if it is specified as 0x0 in the System sim-object to find the most restrictive address mask instead of having the configuration specify it. If the configuration does specify the address mask, we use it instead of auto-calculating. Change-Id: I18aabb5d09945c6e3e3819c9c8036ea24b6c35cf Signed-off-by: Geoffrey Blake Reviewed-by: Curtis Dunham Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2323 Reviewed-by: Jason Lowe-Power --- src/arch/arm/ArmSystem.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/arch') diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py index 4fa9fd858..b42f219ef 100644 --- a/src/arch/arm/ArmSystem.py +++ b/src/arch/arm/ArmSystem.py @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2012-2013, 2015 ARM Limited +# Copyright (c) 2009, 2012-2013, 2015-2017 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -52,7 +52,6 @@ class ArmMachineType(Enum): class ArmSystem(System): type = 'ArmSystem' cxx_header = "arch/arm/system.hh" - load_addr_mask = 0xffffffff multi_proc = Param.Bool(True, "Multiprocessor system?") boot_loader = VectorParam.String([], "File that contains the boot loader code. Zero or more files may be " @@ -83,7 +82,6 @@ class ArmSystem(System): class GenericArmSystem(ArmSystem): type = 'GenericArmSystem' cxx_header = "arch/arm/system.hh" - load_addr_mask = 0x0fffffff machine_type = Param.ArmMachineType('DTOnly', "Machine id from http://www.arm.linux.org.uk/developer/machines/") atags_addr = Param.Addr("Address where default atags structure should " \ @@ -108,6 +106,10 @@ class LinuxArmSystem(GenericArmSystem): """Dump dmesg from the simulated kernel to standard out""" pass + # Have Linux systems for ARM auto-calc their load_addr_mask for proper + # kernel relocation. + load_addr_mask = 0x0 + class FreebsdArmSystem(GenericArmSystem): type = 'FreebsdArmSystem' cxx_header = "arch/arm/freebsd/system.hh" -- cgit v1.2.3