gem5
v20.1.0.0
|
#include <tlb.hh>
Classes | |
struct | TlbStats |
Public Types | |
enum | ArmFlags { AlignmentMask = 0x7, AlignByte = 0x0, AlignHalfWord = 0x1, AlignWord = 0x2, AlignDoubleWord = 0x3, AlignQuadWord = 0x4, AlignOctWord = 0x5, AllowUnaligned = 0x8, UserMode = 0x10 } |
enum | ArmTranslationType { NormalTran = 0, S1CTran = 0x1, HypMode = 0x2, S1S2NsTran = 0x4, S1E0Tran = 0x8, S1E1Tran = 0x10, S1E2Tran = 0x20, S1E3Tran = 0x40, S12E0Tran = 0x80, S12E1Tran = 0x100 } |
Public Types inherited from BaseTLB | |
enum | Mode { Read, Write, Execute } |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
TLB (const ArmTLBParams *p) | |
TLB (const Params *p, int _size, TableWalker *_walker) | |
TlbEntry * | lookup (Addr vpn, uint16_t asn, uint8_t vmid, bool hyp, bool secure, bool functional, bool ignore_asn, ExceptionLevel target_el, bool in_host) |
Lookup an entry in the TLB. More... | |
virtual | ~TLB () |
void | takeOverFrom (BaseTLB *otlb) override |
Take over from an old tlb context. More... | |
void | init () override |
setup all the back pointers More... | |
void | setTestInterface (SimObject *ti) |
TableWalker * | getTableWalker () |
void | setMMU (Stage2MMU *m, RequestorID requestor_id) |
int | getsize () const |
void | insert (Addr vaddr, TlbEntry &pte) |
Fault | getTE (TlbEntry **te, const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool timing, bool functional, bool is_secure, ArmTranslationType tranType) |
Fault | getResultTe (TlbEntry **te, const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool timing, bool functional, TlbEntry *mergeTe) |
Fault | checkPermissions (TlbEntry *te, const RequestPtr &req, Mode mode) |
Fault | checkPermissions64 (TlbEntry *te, const RequestPtr &req, Mode mode, ThreadContext *tc) |
bool | checkPAN (ThreadContext *tc, uint8_t ap, const RequestPtr &req, Mode mode) |
void | flushAllSecurity (bool secure_lookup, ExceptionLevel target_el, bool ignore_el=false, bool in_host=false) |
Reset the entire TLB. More... | |
void | flushAllNs (ExceptionLevel target_el, bool ignore_el=false) |
Remove all entries in the non secure world, depending on whether they were allocated in hyp mode or not. More... | |
void | flushAll () override |
Reset the entire TLB. More... | |
void | flushMvaAsid (Addr mva, uint64_t asn, bool secure_lookup, ExceptionLevel target_el, bool in_host=false) |
Remove any entries that match both a va and asn. More... | |
void | flushAsid (uint64_t asn, bool secure_lookup, ExceptionLevel target_el, bool in_host=false) |
Remove any entries that match the asn. More... | |
void | flushMva (Addr mva, bool secure_lookup, ExceptionLevel target_el, bool in_host=false) |
Remove all entries that match the va regardless of asn. More... | |
void | flushIpaVmid (Addr ipa, bool secure_lookup, ExceptionLevel target_el) |
Invalidate all entries in the stage 2 TLB that match the given ipa and the current VMID. More... | |
Fault | trickBoxCheck (const RequestPtr &req, Mode mode, TlbEntry::DomainType domain) |
Fault | walkTrickBoxCheck (Addr pa, bool is_secure, Addr va, Addr sz, bool is_exec, bool is_write, TlbEntry::DomainType domain, LookupLevel lookup_level) |
void | printTlb () const |
void | demapPage (Addr vaddr, uint64_t asn) override |
bool | translateFunctional (ThreadContext *tc, Addr vaddr, Addr &paddr) |
Do a functional lookup on the TLB (for debugging) and don't modify any internal state. More... | |
Fault | translateFunctional (const RequestPtr &req, ThreadContext *tc, Mode mode, ArmTranslationType tranType) |
Do a functional lookup on the TLB (for checker cpu) that behaves like a normal lookup without modifying any page table state. More... | |
Fault | translateFunctional (const RequestPtr &req, ThreadContext *tc, Mode mode) override |
void | setAttr (uint64_t attr) |
Accessor functions for memory attributes for last accessed TLB entry. More... | |
uint64_t | getAttr () const |
Fault | translateMmuOff (ThreadContext *tc, const RequestPtr &req, Mode mode, TLB::ArmTranslationType tranType, Addr vaddr, bool long_desc_format) |
Fault | translateMmuOn (ThreadContext *tc, const RequestPtr &req, Mode mode, Translation *translation, bool &delay, bool timing, bool functional, Addr vaddr, ArmFault::TranMethod tranMethod) |
Fault | translateFs (const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool &delay, bool timing, ArmTranslationType tranType, bool functional=false) |
Fault | translateSe (const RequestPtr &req, ThreadContext *tc, Mode mode, Translation *translation, bool &delay, bool timing) |
Fault | translateAtomic (const RequestPtr &req, ThreadContext *tc, Mode mode, ArmTranslationType tranType) |
Fault | translateAtomic (const RequestPtr &req, ThreadContext *tc, Mode mode) override |
void | translateTiming (const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType) |
void | translateTiming (const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode) override |
Fault | translateComplete (const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType, bool callFromS2) |
Fault | finalizePhysical (const RequestPtr &req, ThreadContext *tc, Mode mode) const override |
Do post-translation physical address finalization. More... | |
void | drainResume () override |
Resume execution after a successful drain. More... | |
void | regProbePoints () override |
Register probe points for this object. More... | |
Port * | getTableWalkerPort () override |
Get the table walker port. More... | |
const Params * | params () const |
void | invalidateMiscReg () |
Fault | testTranslation (const RequestPtr &req, Mode mode, TlbEntry::DomainType domain) |
Fault | testWalk (Addr pa, Addr size, Addr va, bool is_secure, Mode mode, TlbEntry::DomainType domain, LookupLevel lookup_level) |
Public Member Functions inherited from BaseTLB | |
void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Public Member Functions inherited from Stats::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Static Public Member Functions | |
static ExceptionLevel | tranTypeEL (CPSR cpsr, ArmTranslationType type) |
Determine the EL to use for the purpose of a translation given a specific translation type. More... | |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Protected Member Functions | |
void | updateMiscReg (ThreadContext *tc, ArmTranslationType tranType=NormalTran) |
Protected Member Functions inherited from BaseTLB | |
BaseTLB (const Params *p) | |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Attributes | |
TlbEntry * | table |
int | size |
bool | isStage2 |
bool | stage2Req |
bool | stage2DescReq |
uint64_t | _attr |
bool | directToStage2 |
TableWalker * | tableWalker |
TLB * | stage2Tlb |
Stage2MMU * | stage2Mmu |
TlbTestInterface * | test |
ArmISA::TLB::TlbStats | stats |
ProbePoints::PMUUPtr | ppRefills |
PMU probe for TLB refills. More... | |
int | rangeMRU |
CPSR | cpsr |
bool | aarch64 |
ExceptionLevel | aarch64EL |
SCTLR | sctlr |
SCR | scr |
bool | isPriv |
bool | isSecure |
bool | isHyp |
TTBCR | ttbcr |
uint16_t | asid |
uint8_t | vmid |
PRRR | prrr |
NMRR | nmrr |
HCR | hcr |
uint32_t | dacr |
bool | miscRegValid |
ContextID | miscRegContext |
ArmTranslationType | curTranType |
bool | haveLPAE |
bool | haveVirtualization |
bool | haveLargeAsid64 |
AddrRange | m5opRange |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Private Member Functions | |
void | _flushMva (Addr mva, uint64_t asn, bool secure_lookup, bool ignore_asn, ExceptionLevel target_el, bool in_host) |
Remove any entries that match both a va and asn. More... | |
TLB::TLB | ( | const ArmTLBParams * | p | ) |
Definition at line 75 of file tlb.cc.
References haveLargeAsid64, ArmISA::TableWalker::haveLargeAsid64(), haveLPAE, ArmISA::TableWalker::haveLPAE(), haveVirtualization, ArmISA::TableWalker::haveVirtualization(), m5opRange, System::m5opRange(), MipsISA::p, ArmISA::TableWalker::setTlb(), and tableWalker.
ArmISA::TLB::TLB | ( | const Params * | p, |
int | _size, | ||
TableWalker * | _walker | ||
) |
|
private |
Remove any entries that match both a va and asn.
mva | virtual address to flush |
asn | contextid/asn to flush on match |
secure_lookup | if the operation affects the secure world |
ignore_asn | if the flush should ignore the asn |
in_host | if hcr.e2h == 1 and hcr.tge == 1 for VHE. |
Definition at line 356 of file tlb.cc.
References DPRINTF, ArmISA::EL2, ArmISA::TLB::TlbStats::flushedEntries, lookup(), stats, ArmISA::te, and vmid.
Referenced by flushIpaVmid(), flushMva(), and flushMvaAsid().
bool TLB::checkPAN | ( | ThreadContext * | tc, |
uint8_t | ap, | ||
const RequestPtr & | req, | ||
Mode | mode | ||
) |
Definition at line 917 of file tlb.cc.
References Request::CACHE_BLOCK_ZERO, cpsr, BaseTLB::Execute, ArmISA::MISCREG_ID_AA64MMFR1_EL1, ArmISA::mode, and ThreadContext::readMiscReg().
Referenced by checkPermissions64().
Fault TLB::checkPermissions | ( | TlbEntry * | te, |
const RequestPtr & | req, | ||
Mode | mode | ||
) |
Definition at line 497 of file tlb.cc.
References ArmISA::TLB::TlbStats::alignFaults, ArmISA::ArmFault::AlignmentFault, AlignmentMask, dacr, ArmISA::TLB::TlbStats::domainFaults, ArmISA::ArmFault::DomainLL, DPRINTF, BaseTLB::Execute, hcr, isPriv, isSecure, isStage2, ArmISA::ArmFault::LpaeTran, ArmISA::mask, ArmISA::mode, ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::TlbEntry::Normal, panic, ArmISA::ArmFault::PermissionLL, ArmISA::TLB::TlbStats::permsFaults, ArmISA::ArmFault::PrefetchUncacheable, scr, sctlr, stats, ArmISA::te, UserMode, MipsISA::vaddr, ArmISA::ArmFault::VmsaTran, and BaseTLB::Write.
Referenced by getResultTe(), and ArmISA::Stage2LookUp::getTe().
Fault TLB::checkPermissions64 | ( | TlbEntry * | te, |
const RequestPtr & | req, | ||
Mode | mode, | ||
ThreadContext * | tc | ||
) |
Definition at line 675 of file tlb.cc.
References aarch64, aarch64EL, ArmISA::TLB::TlbStats::alignFaults, ArmISA::ArmFault::AlignmentFault, AlignmentMask, checkPAN(), curTranType, DPRINTF, ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, BaseTLB::Execute, ArmSystem::haveEL(), ArmSystem::haveVirtualization(), hcr, isPriv, isSecure, isStage2, ArmISA::ArmFault::LpaeTran, M5_FALLTHROUGH, ArmISA::mask, ArmISA::mode, ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::TlbEntry::Normal, RiscvISA::perm, ArmISA::ArmFault::PermissionLL, ArmISA::TLB::TlbStats::permsFaults, ArmISA::ArmFault::PrefetchUncacheable, ArmISA::purifyTaggedAddr(), MipsISA::r, scr, sctlr, stats, ArmISA::te, ttbcr, updateMiscReg(), UserMode, MipsISA::vaddr, MipsISA::w, BaseTLB::Write, ArmISA::wxn, and RiscvISA::x.
Referenced by getResultTe(), and ArmISA::Stage2LookUp::getTe().
|
inlineoverridevirtual |
|
overridevirtual |
Resume execution after a successful drain.
Reimplemented from Drainable.
Definition at line 386 of file tlb.cc.
References miscRegValid.
|
overridevirtual |
Do post-translation physical address finalization.
This method is used by some architectures that need post-translation massaging of physical addresses. For example, X86 uses this to remap physical addresses in the APIC range to a range of physical memory not normally available to real x86 implementations.
req | Request to updated in-place. |
tc | Thread context that created the request. |
mode | Request type (read/write/execute). |
Implements BaseTLB.
Definition at line 135 of file tlb.cc.
References AddrRange::contains(), PseudoInst::decodeAddrOffset(), m5opRange, ArmISA::mode, NoFault, BaseTLB::Read, Packet::setLE(), and AddrRange::start().
Referenced by translateMmuOn(), and translateSe().
|
inlineoverridevirtual |
Used for CPU switching to prevent stale translations after multiple switches
Implements BaseTLB.
Definition at line 265 of file tlb.hh.
References ArmISA::EL0, and flushAllSecurity().
void TLB::flushAllNs | ( | ExceptionLevel | target_el, |
bool | ignore_el = false |
||
) |
Remove all entries in the non secure world, depending on whether they were allocated in hyp mode or not.
Definition at line 279 of file tlb.cc.
References DPRINTF, ArmISA::EL1, ArmISA::EL2, flushAllNs(), ArmISA::TLB::TlbStats::flushedEntries, ArmISA::TLB::TlbStats::flushTlb, isStage2, size, stage2Tlb, stats, table, ArmISA::te, and RiscvISA::x.
Referenced by flushAllNs(), and ArmISA::TLBIALLN::operator()().
void TLB::flushAllSecurity | ( | bool | secure_lookup, |
ExceptionLevel | target_el, | ||
bool | ignore_el = false , |
||
bool | in_host = false |
||
) |
secure_lookup | if the operation affects the secure world |
Definition at line 248 of file tlb.cc.
References DPRINTF, ArmISA::EL1, flushAllSecurity(), ArmISA::TLB::TlbStats::flushedEntries, ArmISA::TLB::TlbStats::flushTlb, isHyp, isStage2, size, stage2Tlb, stats, table, ArmISA::te, vmid, and RiscvISA::x.
Referenced by flushAll(), flushAllSecurity(), ArmISA::TLBIALL::operator()(), ArmISA::ITLBIALL::operator()(), and ArmISA::DTLBIALL::operator()().
void TLB::flushAsid | ( | uint64_t | asn, |
bool | secure_lookup, | ||
ExceptionLevel | target_el, | ||
bool | in_host = false |
||
) |
Remove any entries that match the asn.
asn | contextid/asn to flush on match |
secure_lookup | if the operation affects the secure world |
Definition at line 321 of file tlb.cc.
References DPRINTF, ArmISA::TLB::TlbStats::flushedEntries, ArmISA::TLB::TlbStats::flushTlbAsid, size, stats, table, ArmISA::te, vmid, and RiscvISA::x.
Referenced by ArmISA::TLBIASID::operator()(), ArmISA::ITLBIASID::operator()(), and ArmISA::DTLBIASID::operator()().
void TLB::flushIpaVmid | ( | Addr | ipa, |
bool | secure_lookup, | ||
ExceptionLevel | target_el | ||
) |
Invalidate all entries in the stage 2 TLB that match the given ipa and the current VMID.
ipa | the address to invalidate |
secure_lookup | if the operation affects the secure world |
Definition at line 379 of file tlb.cc.
References _flushMva(), isStage2, and stage2Tlb.
Referenced by ArmISA::TLBIIPA::operator()().
void TLB::flushMva | ( | Addr | mva, |
bool | secure_lookup, | ||
ExceptionLevel | target_el, | ||
bool | in_host = false |
||
) |
Remove all entries that match the va regardless of asn.
mva | address to flush from cache |
secure_lookup | if the operation affects the secure world |
Definition at line 346 of file tlb.cc.
References _flushMva(), DPRINTF, ArmISA::TLB::TlbStats::flushTlbMva, and stats.
Referenced by ArmISA::TLBIMVAA::operator()().
void TLB::flushMvaAsid | ( | Addr | mva, |
uint64_t | asn, | ||
bool | secure_lookup, | ||
ExceptionLevel | target_el, | ||
bool | in_host = false |
||
) |
Remove any entries that match both a va and asn.
mva | virtual address to flush |
asn | contextid/asn to flush on match |
secure_lookup | if the operation affects the secure world |
Definition at line 310 of file tlb.cc.
References _flushMva(), DPRINTF, ArmISA::TLB::TlbStats::flushTlbMvaAsid, and stats.
Referenced by ArmISA::TLBIMVA::operator()(), ArmISA::ITLBIMVA::operator()(), and ArmISA::DTLBIMVA::operator()().
|
inline |
Definition at line 349 of file tlb.hh.
References _attr.
Referenced by ArmISA::ISA::addressTranslation(), and ArmISA::ISA::addressTranslation64().
Fault TLB::getResultTe | ( | TlbEntry ** | te, |
const RequestPtr & | req, | ||
ThreadContext * | tc, | ||
Mode | mode, | ||
Translation * | translation, | ||
bool | timing, | ||
bool | functional, | ||
TlbEntry * | mergeTe | ||
) |
Definition at line 1533 of file tlb.cc.
References aarch64, ArmISA::ArmFault::annotate(), checkPermissions(), checkPermissions64(), curTranType, DPRINTF, ArmISA::Stage2LookUp::getTe(), getTE(), ArmISA::Stage2LookUp::isComplete(), isSecure, isStage2, ArmISA::mode, NoFault, ArmISA::ArmFault::OVA, ArmISA::ArmFault::S1PTW, ArmISA::Stage2LookUp::setSelfDelete(), stage2Req, stage2Tlb, and ArmISA::te.
Referenced by translateMmuOn().
|
inline |
Definition at line 225 of file tlb.hh.
References tableWalker.
|
overridevirtual |
Get the table walker port.
This is used for migrating port connections during a CPU takeOverFrom() call. For architectures that do not have a table walker, NULL is returned, hence the use of a pointer rather than a reference. For ARM this method will always return a valid port pointer.
Reimplemented from BaseTLB.
Definition at line 1252 of file tlb.cc.
References ArmISA::Stage2MMU::getDMAPort(), and stage2Mmu.
Fault TLB::getTE | ( | TlbEntry ** | te, |
const RequestPtr & | req, | ||
ThreadContext * | tc, | ||
Mode | mode, | ||
Translation * | translation, | ||
bool | timing, | ||
bool | functional, | ||
bool | is_secure, | ||
TLB::ArmTranslationType | tranType | ||
) |
Definition at line 1463 of file tlb.cc.
References aarch64, aarch64EL, asid, DPRINTF, ArmISA::EL1, BaseTLB::Execute, ArmISA::TLB::TlbStats::instHits, ArmISA::TLB::TlbStats::instMisses, isHyp, isStage2, lookup(), ArmISA::mode, NoFault, ArmISA::TLB::TlbStats::prefetchFaults, ArmISA::ArmFault::PrefetchTLBMiss, printTlb(), ArmISA::purifyTaggedAddr(), ArmISA::TLB::TlbStats::readHits, ArmISA::TLB::TlbStats::readMisses, stage2DescReq, stats, tableWalker, ArmISA::te, ttbcr, updateMiscReg(), MipsISA::vaddr, vmid, ArmISA::TableWalker::walk(), BaseTLB::Write, ArmISA::TLB::TlbStats::writeHits, and ArmISA::TLB::TlbStats::writeMisses.
Referenced by ArmISA::Stage2LookUp::finish(), getResultTe(), and ArmISA::Stage2LookUp::getTe().
|
overridevirtual |
Definition at line 204 of file tlb.cc.
References ArmISA::TlbEntry::ap, ArmISA::TlbEntry::asid, asid, ArmISA::TlbEntry::domain, DPRINTF, ArmISA::el, ArmISA::TlbEntry::global, ArmISA::i, ArmISA::TLB::TlbStats::inserts, ArmISA::TlbEntry::isHyp, isHyp, ArmISA::TlbEntry::N, ArmISA::TlbEntry::nonCacheable, ArmISA::TlbEntry::ns, ArmISA::ns, ArmISA::TlbEntry::nstid, MipsISA::pfn, ArmISA::TlbEntry::pfn, ppRefills, ArmISA::TlbEntry::size, size, stats, table, ArmISA::TlbEntry::valid, ArmISA::TlbEntry::vmid, vmid, ArmISA::TlbEntry::vpn, and ArmISA::TlbEntry::xn.
Referenced by ArmISA::TableWalker::insertTableEntry().
|
inline |
Definition at line 446 of file tlb.hh.
References miscRegValid.
Referenced by ArmISA::ISA::clear(), and ArmISA::ISA::setMiscReg().
TlbEntry * TLB::lookup | ( | Addr | vpn, |
uint16_t | asn, | ||
uint8_t | vmid, | ||
bool | hyp, | ||
bool | secure, | ||
bool | functional, | ||
bool | ignore_asn, | ||
ExceptionLevel | target_el, | ||
bool | in_host | ||
) |
Lookup an entry in the TLB.
vpn | virtual address |
asn | context id/address space id to use |
vmid | The virtual machine ID used for stage 2 translation |
secure | if the lookup is secure |
hyp | if the lookup is done from hyp mode |
functional | if the lookup should modify state |
ignore_asn | if on lookup asn should be ignored |
Definition at line 159 of file tlb.cc.
References ArmISA::TlbEntry::ap, ArmISA::TlbEntry::asid, DPRINTF, ArmISA::TlbEntry::el, ArmISA::TlbEntry::global, ArmISA::i, ArmISA::TlbEntry::ns, ArmISA::TlbEntry::nstid, ArmISA::TlbEntry::pAddr(), ArmISA::TlbEntry::pfn, rangeMRU, ArmISA::TlbEntry::size, size, table, ArmISA::va, vmid, and RiscvISA::x.
Referenced by _flushMva(), getTE(), ArmISA::TableWalker::processWalkWrapper(), and translateFunctional().
|
inline |
Definition at line 442 of file tlb.hh.
References SimObject::_params.
void TLB::printTlb | ( | ) | const |
Definition at line 234 of file tlb.cc.
References DPRINTF, size, table, ArmISA::te, and RiscvISA::x.
Referenced by getTE().
|
overridevirtual |
Register probe points for this object.
No probe points by default, so do nothing in base.
Reimplemented from SimObject.
Definition at line 451 of file tlb.cc.
References SimObject::getProbeManager(), and ppRefills.
|
inline |
Accessor functions for memory attributes for last accessed TLB entry.
Definition at line 343 of file tlb.hh.
References _attr, and ArmISA::attr.
Referenced by translateMmuOff(), and translateMmuOn().
void TLB::setMMU | ( | Stage2MMU * | m, |
RequestorID | requestor_id | ||
) |
Definition at line 110 of file tlb.cc.
References ArmISA::m, ArmISA::TableWalker::setMMU(), stage2Mmu, and tableWalker.
Referenced by ArmISA::Stage2MMU::Stage2MMU().
void TLB::setTestInterface | ( | SimObject * | ti | ) |
Definition at line 1606 of file tlb.cc.
References fatal_if, SimObject::name(), and MipsISA::ti.
|
overridevirtual |
Take over from an old tlb context.
Implements BaseTLB.
Definition at line 394 of file tlb.cc.
References _attr, directToStage2, haveLPAE, isStage2, panic, stage2DescReq, stage2Req, stage2Tlb, and takeOverFrom().
Referenced by takeOverFrom().
Fault TLB::testTranslation | ( | const RequestPtr & | req, |
Mode | mode, | ||
TlbEntry::DomainType | domain | ||
) |
Definition at line 1618 of file tlb.cc.
References ArmISA::domain, isPriv, ArmISA::mode, and NoFault.
Referenced by translateMmuOff(), and translateMmuOn().
Fault TLB::testWalk | ( | Addr | pa, |
Addr | size, | ||
Addr | va, | ||
bool | is_secure, | ||
Mode | mode, | ||
TlbEntry::DomainType | domain, | ||
LookupLevel | lookup_level | ||
) |
Definition at line 1630 of file tlb.cc.
References ArmISA::domain, isPriv, ArmISA::mode, NoFault, ArmISA::pa, size, and ArmISA::va.
Referenced by ArmISA::TableWalker::testWalk().
|
inlineoverridevirtual |
Implements BaseTLB.
Definition at line 368 of file tlb.hh.
References ArmISA::mode, NormalTran, and translateAtomic().
Fault TLB::translateAtomic | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Mode | mode, | ||
TLB::ArmTranslationType | tranType | ||
) |
Definition at line 1163 of file tlb.cc.
References directToStage2, FullSystem, ArmISA::mode, stage2Tlb, translateAtomic(), translateFs(), translateSe(), and updateMiscReg().
Referenced by ArmISA::Stage2MMU::readDataUntimed(), Trace::TarmacParserRecord::readMemNoEffect(), and translateAtomic().
Fault TLB::translateComplete | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Translation * | translation, | ||
Mode | mode, | ||
TLB::ArmTranslationType | tranType, | ||
bool | callFromS2 | ||
) |
Definition at line 1222 of file tlb.cc.
References DPRINTF, BaseTLB::Translation::finish(), FullSystem, BaseTLB::Translation::markDelayed(), ArmISA::mode, NoFault, stage2Req, translateFs(), and translateSe().
Referenced by ArmISA::Stage2LookUp::finish(), and translateTiming().
Fault TLB::translateFs | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Mode | mode, | ||
Translation * | translation, | ||
bool & | delay, | ||
bool | timing, | ||
TLB::ArmTranslationType | tranType, | ||
bool | functional = false |
||
) |
Definition at line 1081 of file tlb.cc.
References aarch64, aarch64EL, ArmISA::TLB::TlbStats::alignFaults, ArmISA::ArmFault::AlignmentFault, AlignmentMask, AllowUnaligned, asid, DPRINTF, BaseTLB::Execute, ArmISA::ISA::getSelfDebug(), ArmISA::HaveVirtHostExt(), hcr, isPriv, isSecure, isStage2, ArmISA::longDescFormatInUse(), ArmISA::ArmFault::LpaeTran, ArmISA::mask, ArmISA::mode, ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::purifyTaggedAddr(), S1S2NsTran, scr, sctlr, ArmISA::sd, stats, Request::STRICT_ORDER, translateMmuOff(), translateMmuOn(), ttbcr, Request::UNCACHEABLE, updateMiscReg(), UserMode, MipsISA::vaddr, ArmISA::vm, ArmISA::ArmFault::VmsaTran, and BaseTLB::Write.
Referenced by translateAtomic(), translateComplete(), and translateFunctional().
|
inlineoverridevirtual |
Reimplemented from BaseTLB.
Definition at line 334 of file tlb.hh.
References ArmISA::mode, NormalTran, and translateFunctional().
Fault TLB::translateFunctional | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Mode | mode, | ||
TLB::ArmTranslationType | tranType | ||
) |
Do a functional lookup on the TLB (for checker cpu) that behaves like a normal lookup without modifying any page table state.
Definition at line 1184 of file tlb.cc.
References directToStage2, FullSystem, ArmISA::mode, stage2Tlb, translateFs(), translateFunctional(), translateSe(), and updateMiscReg().
bool TLB::translateFunctional | ( | ThreadContext * | tc, |
Addr | vaddr, | ||
Addr & | paddr | ||
) |
Do a functional lookup on the TLB (for debugging) and don't modify any internal state.
tc | thread context to get the context id from |
vaddr | virtual address to translate |
pa | returned physical address |
Definition at line 117 of file tlb.cc.
References aarch64, aarch64EL, asid, directToStage2, ArmISA::e, ArmISA::EL1, isHyp, isSecure, lookup(), ArmISA::pa, stage2Tlb, translateFunctional(), updateMiscReg(), ArmISA::va, and vmid.
Referenced by ArmISA::ISA::addressTranslation(), ArmISA::ISA::addressTranslation64(), ArmISA::Stage2MMU::readDataUntimed(), Trace::TarmacTracerRecordV8::TraceInstEntryV8::TraceInstEntryV8(), Trace::TarmacTracerRecordV8::TraceMemEntryV8::TraceMemEntryV8(), and translateFunctional().
Fault TLB::translateMmuOff | ( | ThreadContext * | tc, |
const RequestPtr & | req, | ||
Mode | mode, | ||
TLB::ArmTranslationType | tranType, | ||
Addr | vaddr, | ||
bool | long_desc_format | ||
) |
Definition at line 937 of file tlb.cc.
References aarch64, ArmISA::ArmFault::AddressSizeLL, ArmISA::TlbEntry::attributes, bits(), ArmISA::computeAddrTop(), ArmISA::currEL(), ArmISA::dc, DPRINTF, BaseTLB::Execute, ArmISA::f, ArmISA::HaveVirtHostExt(), hcr, ArmISA::TlbEntry::innerAttrs, isHyp, isSecure, isStage2, ArmISA::ArmFault::LpaeTran, ArmISA::MaxPhysAddrRange, ArmISA::MISCREG_TCR_EL1, ArmISA::mode, ArmISA::TlbEntry::mtype, nmrr, ArmISA::TlbEntry::NoAccess, ArmISA::TlbEntry::Normal, ArmISA::TlbEntry::ns, ArmISA::TlbEntry::outerAttrs, ArmISA::TlbEntry::outerShareable, prrr, ThreadContext::readMiscReg(), S1CTran, sctlr, Request::SECURE, setAttr(), ArmISA::TlbEntry::setAttributes(), ArmISA::TlbEntry::shareable, Request::STRICT_ORDER, ArmISA::TlbEntry::StronglyOrdered, testTranslation(), Request::UNCACHEABLE, MipsISA::vaddr, and BaseTLB::Write.
Referenced by translateFs().
Fault TLB::translateMmuOn | ( | ThreadContext * | tc, |
const RequestPtr & | req, | ||
Mode | mode, | ||
Translation * | translation, | ||
bool & | delay, | ||
bool | timing, | ||
bool | functional, | ||
Addr | vaddr, | ||
ArmFault::TranMethod | tranMethod | ||
) |
Definition at line 1009 of file tlb.cc.
References ArmISA::TLB::TlbStats::alignFaults, ArmISA::ArmFault::AlignmentFault, AlignmentMask, DPRINTF, BaseTLB::Execute, finalizePhysical(), getResultTe(), isSecure, isStage2, ArmISA::mask, ArmISA::mode, ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::TlbEntry::Normal, ArmISA::pa, Request::SECURE, setAttr(), stats, Request::STRICT_ORDER, ArmISA::te, testTranslation(), Request::UNCACHEABLE, MipsISA::vaddr, and BaseTLB::Write.
Referenced by translateFs().
Fault TLB::translateSe | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Mode | mode, | ||
Translation * | translation, | ||
bool & | delay, | ||
bool | timing | ||
) |
Definition at line 457 of file tlb.cc.
References aarch64, aarch64EL, ArmISA::ArmFault::AlignmentFault, AlignmentMask, AllowUnaligned, BaseTLB::Execute, finalizePhysical(), ThreadContext::getProcessPtr(), isStage2, ArmISA::mask, ArmISA::mode, ArmISA::TlbEntry::NoAccess, MipsISA::p, ArmISA::purifyTaggedAddr(), sctlr, ttbcr, updateMiscReg(), MipsISA::vaddr, ArmISA::ArmFault::VmsaTran, and BaseTLB::Write.
Referenced by translateAtomic(), translateComplete(), and translateFunctional().
|
inlineoverridevirtual |
Implements BaseTLB.
Definition at line 378 of file tlb.hh.
References ArmISA::mode, NormalTran, and translateTiming().
void TLB::translateTiming | ( | const RequestPtr & | req, |
ThreadContext * | tc, | ||
Translation * | translation, | ||
Mode | mode, | ||
TLB::ArmTranslationType | tranType | ||
) |
Definition at line 1205 of file tlb.cc.
References directToStage2, isStage2, ArmISA::mode, stage2Tlb, translateComplete(), translateTiming(), and updateMiscReg().
Referenced by ArmISA::TableWalker::doL1DescriptorWrapper(), ArmISA::TableWalker::doL2DescriptorWrapper(), ArmISA::TableWalker::doLongDescriptorWrapper(), ArmISA::TableWalker::processWalkWrapper(), ArmISA::Stage2MMU::Stage2Translation::translateTiming(), and translateTiming().
|
static |
Determine the EL to use for the purpose of a translation given a specific translation type.
If the translation type doesn't specify an EL, we use the current EL.
Definition at line 1434 of file tlb.cc.
References cpsr, ArmISA::currEL(), ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, HypMode, NormalTran, panic, S12E0Tran, S12E1Tran, S1CTran, S1E0Tran, S1E1Tran, S1E2Tran, S1E3Tran, S1S2NsTran, and type.
Referenced by updateMiscReg(), and ArmISA::TableWalker::walk().
Fault ArmISA::TLB::trickBoxCheck | ( | const RequestPtr & | req, |
Mode | mode, | ||
TlbEntry::DomainType | domain | ||
) |
|
protected |
Definition at line 1258 of file tlb.cc.
References aarch64, aarch64EL, asid, bits(), ThreadContext::contextId(), cpsr, curTranType, dacr, directToStage2, DPRINTF, ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, ArmISA::ELIs64(), haveLargeAsid64, ArmISA::HaveVirtHostExt(), haveVirtualization, hcr, HypMode, isHyp, isPriv, ArmISA::isSecure(), isSecure, ArmISA::IsSecureEL2Enabled(), isStage2, ArmISA::longDescFormatInUse(), ArmISA::MISCREG_CONTEXTIDR, ArmISA::MISCREG_CPSR, ArmISA::MISCREG_DACR, ArmISA::MISCREG_HCR, ArmISA::MISCREG_HCR_EL2, ArmISA::MISCREG_HSCTLR, ArmISA::MISCREG_NMRR, ArmISA::MISCREG_PRRR, ArmISA::MISCREG_SCR, ArmISA::MISCREG_SCR_EL3, ArmISA::MISCREG_SCTLR, ArmISA::MISCREG_SCTLR_EL1, ArmISA::MISCREG_SCTLR_EL2, ArmISA::MISCREG_SCTLR_EL3, ArmISA::MISCREG_TCR_EL1, ArmISA::MISCREG_TCR_EL2, ArmISA::MISCREG_TCR_EL3, ArmISA::MISCREG_TTBCR, ArmISA::MISCREG_TTBR0, ArmISA::MISCREG_TTBR0_EL1, ArmISA::MISCREG_TTBR0_EL2, ArmISA::MISCREG_TTBR1, ArmISA::MISCREG_TTBR1_EL1, ArmISA::MISCREG_TTBR1_EL2, ArmISA::MISCREG_VTTBR, ArmISA::MISCREG_VTTBR_EL2, miscRegContext, miscRegValid, ArmISA::MODE_HYP, ArmISA::MODE_USER, nmrr, prrr, ThreadContext::readMiscReg(), S1CTran, S1E1Tran, S1S2NsTran, scr, sctlr, ArmISA::snsBankedIndex(), stage2DescReq, stage2Req, tranTypeEL(), ttbcr, ArmISA::vm, and vmid.
Referenced by checkPermissions64(), getTE(), translateAtomic(), translateFs(), translateFunctional(), translateSe(), and translateTiming().
Fault ArmISA::TLB::walkTrickBoxCheck | ( | Addr | pa, |
bool | is_secure, | ||
Addr | va, | ||
Addr | sz, | ||
bool | is_exec, | ||
bool | is_write, | ||
TlbEntry::DomainType | domain, | ||
LookupLevel | lookup_level | ||
) |
|
protected |
Definition at line 153 of file tlb.hh.
Referenced by getAttr(), setAttr(), and takeOverFrom().
|
protected |
Definition at line 412 of file tlb.hh.
Referenced by checkPermissions64(), getResultTe(), getTE(), translateFs(), translateFunctional(), translateMmuOff(), translateSe(), and updateMiscReg().
|
protected |
Definition at line 413 of file tlb.hh.
Referenced by checkPermissions64(), getTE(), translateFs(), translateFunctional(), translateSe(), and updateMiscReg().
|
protected |
Definition at line 420 of file tlb.hh.
Referenced by getTE(), insert(), translateFs(), translateFunctional(), and updateMiscReg().
|
protected |
Definition at line 411 of file tlb.hh.
Referenced by checkPAN(), tranTypeEL(), and updateMiscReg().
|
protected |
Definition at line 428 of file tlb.hh.
Referenced by checkPermissions64(), getResultTe(), and updateMiscReg().
|
protected |
Definition at line 425 of file tlb.hh.
Referenced by checkPermissions(), and updateMiscReg().
|
protected |
Definition at line 154 of file tlb.hh.
Referenced by takeOverFrom(), translateAtomic(), translateFunctional(), translateTiming(), and updateMiscReg().
|
protected |
Definition at line 433 of file tlb.hh.
Referenced by TLB(), and updateMiscReg().
|
protected |
Definition at line 431 of file tlb.hh.
Referenced by takeOverFrom(), and TLB().
|
protected |
Definition at line 432 of file tlb.hh.
Referenced by TLB(), and updateMiscReg().
|
protected |
Definition at line 424 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), translateFs(), translateMmuOff(), and updateMiscReg().
|
protected |
Definition at line 418 of file tlb.hh.
Referenced by flushAllSecurity(), getTE(), insert(), translateFunctional(), translateMmuOff(), and updateMiscReg().
|
protected |
Definition at line 416 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), testTranslation(), testWalk(), translateFs(), and updateMiscReg().
|
protected |
Definition at line 417 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), getResultTe(), translateFs(), translateFunctional(), translateMmuOff(), translateMmuOn(), and updateMiscReg().
|
protected |
Definition at line 147 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), flushAllNs(), flushAllSecurity(), flushIpaVmid(), getResultTe(), getTE(), init(), takeOverFrom(), translateFs(), translateMmuOff(), translateMmuOn(), translateSe(), translateTiming(), and updateMiscReg().
|
protected |
Definition at line 435 of file tlb.hh.
Referenced by finalizePhysical(), and TLB().
|
protected |
Definition at line 427 of file tlb.hh.
Referenced by updateMiscReg().
|
protected |
Definition at line 426 of file tlb.hh.
Referenced by drainResume(), invalidateMiscReg(), and updateMiscReg().
|
protected |
Definition at line 423 of file tlb.hh.
Referenced by translateMmuOff(), and updateMiscReg().
|
protected |
|
protected |
Definition at line 422 of file tlb.hh.
Referenced by translateMmuOff(), and updateMiscReg().
|
protected |
Definition at line 415 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), translateFs(), and updateMiscReg().
|
protected |
Definition at line 414 of file tlb.hh.
Referenced by checkPermissions(), checkPermissions64(), translateFs(), translateMmuOff(), translateSe(), and updateMiscReg().
|
protected |
Definition at line 146 of file tlb.hh.
Referenced by flushAllNs(), flushAllSecurity(), flushAsid(), getsize(), insert(), lookup(), printTlb(), and testWalk().
|
protected |
Definition at line 152 of file tlb.hh.
Referenced by getTE(), takeOverFrom(), and updateMiscReg().
|
protected |
Definition at line 159 of file tlb.hh.
Referenced by getTableWalkerPort(), init(), and setMMU().
|
protected |
Definition at line 148 of file tlb.hh.
Referenced by getResultTe(), takeOverFrom(), translateComplete(), and updateMiscReg().
|
protected |
Definition at line 158 of file tlb.hh.
Referenced by flushAllNs(), flushAllSecurity(), flushIpaVmid(), getResultTe(), init(), takeOverFrom(), translateAtomic(), translateFunctional(), and translateTiming().
|
protected |
Referenced by _flushMva(), checkPermissions(), checkPermissions64(), flushAllNs(), flushAllSecurity(), flushAsid(), flushMva(), flushMvaAsid(), getTE(), insert(), translateFs(), and translateMmuOn().
|
protected |
Definition at line 145 of file tlb.hh.
Referenced by flushAllNs(), flushAllSecurity(), flushAsid(), insert(), lookup(), printTlb(), and ~TLB().
|
protected |
|
protected |
|
protected |
Definition at line 419 of file tlb.hh.
Referenced by checkPermissions64(), getTE(), translateFs(), translateSe(), and updateMiscReg().
|
protected |
Definition at line 421 of file tlb.hh.
Referenced by _flushMva(), flushAllSecurity(), flushAsid(), getTE(), insert(), lookup(), translateFunctional(), and updateMiscReg().