diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-01-07 13:05:45 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-01-07 13:05:45 -0500 |
commit | fb52ea9220f307de18da6565a2cbbaf67ba2b7a7 (patch) | |
tree | 879d47a6ccb3333c7c9e38d508aa54f55b70e940 /src/arch | |
parent | 0d59549cd9db2263b1cc1b90e8abd05229eaab5b (diff) | |
download | gem5-fb52ea9220f307de18da6565a2cbbaf67ba2b7a7.tar.xz |
arm: Invalidate cached TLB configuration in drainResume
Currently, we invalidate the cached miscregs in
TLB::unserialize(). The intended use of the drainResume() method is to
invalidate cached state and prepare the system to resume after a CPU
handover or (un)serialization. This patch moves the TLB miscregs
invalidation code to the drainResume() method to avoid surprising
behavior.
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/tlb.cc | 11 | ||||
-rw-r--r-- | src/arch/arm/tlb.hh | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc index e7ac935e6..170d819d8 100644 --- a/src/arch/arm/tlb.cc +++ b/src/arch/arm/tlb.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 ARM Limited + * Copyright (c) 2010-2012 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -253,6 +253,14 @@ TLB::flushMva(Addr mva) } void +TLB::drainResume() +{ + // We might have unserialized something or switched CPUs, so make + // sure to re-read the misc regs. + miscRegValid = false; +} + +void TLB::serialize(ostream &os) { DPRINTF(Checkpoint, "Serializing Arm TLB\n"); @@ -278,7 +286,6 @@ TLB::unserialize(Checkpoint *cp, const string §ion) for(int i = 0; i < min(size, num_entries); i++){ table[i].unserialize(cp, csprintf("%s.TlbEntry%d", section, i)); } - miscRegValid = false; } void diff --git a/src/arch/arm/tlb.hh b/src/arch/arm/tlb.hh index 968699764..f5c7320ed 100644 --- a/src/arch/arm/tlb.hh +++ b/src/arch/arm/tlb.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 ARM Limited + * Copyright (c) 2010-2012 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -208,6 +208,8 @@ class TLB : public BaseTLB Fault translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode); + void drainResume(); + // Checkpointing void serialize(std::ostream &os); void unserialize(Checkpoint *cp, const std::string §ion); |