From c9d5985b8221459e4737c637910dc08513b05660 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 19 Aug 2011 15:08:08 -0500 Subject: ARM: Mark some variables uncacheable until boot all CPUs are enabled. There are a set of locations is the linux kernel that are managed via cache maintence instructions until all processors enable their MMUs & TLBs. Writes to these locations are manually flushed from the cache to main memory when the occur so that cores operating without their MMU enabled and only issuing uncached accesses can receive the correct data. Unfortuantely, gem5 doesn't support any kind of software directed maintence of the cache. Until such time as that support exists this patch marks the specific cache blocks that need to be coherent as non-cacheable until all CPUs enable their MMU and thus allows gem5 to boot MP systems with caches enabled (a requirement for booting an O3 cpu and thus an O3 CPU regression). --- src/arch/arm/linux/system.cc | 21 +++++++++++++++++++++ src/arch/arm/linux/system.hh | 11 +++++++++++ 2 files changed, 32 insertions(+) (limited to 'src/arch/arm/linux') diff --git a/src/arch/arm/linux/system.cc b/src/arch/arm/linux/system.cc index 445fa2f19..66f4f26af 100644 --- a/src/arch/arm/linux/system.cc +++ b/src/arch/arm/linux/system.cc @@ -117,6 +117,27 @@ LinuxArmSystem::LinuxArmSystem(Params *p) } else { panic("couldn't find kernel symbol \'udelay\'"); } + + secDataPtrAddr = 0; + secDataAddr = 0; + penReleaseAddr = 0; + kernelSymtab->findAddress("__secondary_data", secDataPtrAddr); + kernelSymtab->findAddress("secondary_data", secDataAddr); + kernelSymtab->findAddress("pen_release", penReleaseAddr); + + secDataPtrAddr &= ~ULL(0x7F); + secDataAddr &= ~ULL(0x7F); + penReleaseAddr &= ~ULL(0x7F); +} + +bool +LinuxArmSystem::adderBootUncacheable(Addr a) +{ + Addr block = a & ~ULL(0x7F); + if (block == secDataPtrAddr || block == secDataAddr || + block == penReleaseAddr) + return true; + return false; } void diff --git a/src/arch/arm/linux/system.hh b/src/arch/arm/linux/system.hh index 2ef65fea2..54681096b 100644 --- a/src/arch/arm/linux/system.hh +++ b/src/arch/arm/linux/system.hh @@ -69,6 +69,8 @@ class LinuxArmSystem : public ArmSystem void initState(); + bool adderBootUncacheable(Addr a); + private: #ifndef NDEBUG /** Event to halt the simulator if the kernel calls panic() */ @@ -87,6 +89,15 @@ class LinuxArmSystem : public ArmSystem * Thus we need to do some division to get back to us. */ Linux::UDelayEvent *constUDelaySkipEvent; + + /** These variables store addresses of important data structures + * that are normaly kept coherent at boot with cache mainetence operations. + * Since these operations aren't supported in gem5, we keep them coherent + * by making them uncacheable until all processors in the system boot. + */ + Addr secDataPtrAddr; + Addr secDataAddr; + Addr penReleaseAddr; }; #endif // __ARCH_ARM_LINUX_SYSTEM_HH__ -- cgit v1.2.3