gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ArmISA::TableWalker Class Reference

#include <table_walker.hh>

Inheritance diagram for ArmISA::TableWalker:
MemObject ClockedObject SimObject Clocked EventManager Serializable Drainable

Classes

class  DescriptorBase
 
class  L1Descriptor
 
class  L2Descriptor
 Level 2 page table descriptor. More...
 
class  LongDescriptor
 Long-descriptor format (LPAE) More...
 
class  WalkerState
 

Public Types

enum  GrainSize { Grain4KB = 12, Grain16KB = 14, Grain64KB = 16, ReservedGrain = 0 }
 
typedef ArmTableWalkerParams Params
 
- Public Types inherited from MemObject
typedef MemObjectParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 TableWalker (const Params *p)
 
virtual ~TableWalker ()
 
const Paramsparams () const
 
void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
bool haveLPAE () const
 
bool haveVirtualization () const
 
bool haveLargeAsid64 () const
 
void completeDrain ()
 Checks if all state is cleared and if so, completes drain. More...
 
DrainState drain () override
 Notify an object that it needs to drain its state. More...
 
void drainResume () override
 Resume execution after a successful drain. More...
 
BaseMasterPortgetMasterPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a master port with a given name and index. More...
 
void regStats () override
 Register statistics for this object. More...
 
Fault walk (RequestPtr req, ThreadContext *tc, uint16_t asid, uint8_t _vmid, bool _isHyp, TLB::Mode mode, TLB::Translation *_trans, bool timing, bool functional, bool secure, TLB::ArmTranslationType tranType, bool _stage2Req)
 
void setTlb (TLB *_tlb)
 
TLBgetTlb ()
 
void setMMU (Stage2MMU *m, MasterID master_id)
 
void memAttrs (ThreadContext *tc, TlbEntry &te, SCTLR sctlr, uint8_t texcb, bool s)
 
void memAttrsLPAE (ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
 
void memAttrsAArch64 (ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
 
- Public Member Functions inherited from MemObject
const Paramsparams () const
 
 MemObject (const Params *params)
 
virtual BaseSlavePortgetSlavePort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a slave port with a given name and index. More...
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
void regStats () override
 Register statistics for this object. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () 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 resetStats ()
 Reset statistics associated with this object. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. 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...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. 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
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () 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)
 
void setCurTick (Tick newVal)
 
- 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 Clocked
void updateClockPeriod () const
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Static Public Member Functions

static LookupLevel toLookupLevel (uint8_t lookup_level_as_int)
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (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 ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 

Protected Attributes

std::list< WalkerState * > stateQueues [MAX_LOOKUP_LEVELS]
 Queues of requests for all the different lookup levels. More...
 
std::list< WalkerState * > pendingQueue
 Queue of requests that have passed are waiting because the walker is currently busy. More...
 
Stage2MMUstage2Mmu
 The MMU to forward second stage look upts to. More...
 
DmaPortport
 Port shared by the two table walkers. More...
 
MasterID masterId
 Master id assigned by the MMU. More...
 
const bool isStage2
 Indicates whether this table walker is part of the stage 2 mmu. More...
 
TLBtlb
 TLB that is initiating these table walks. More...
 
SCTLR sctlr
 Cached copy of the sctlr as it existed when translation began. More...
 
WalkerStatecurrState
 
bool pending
 If a timing translation is currently in progress. More...
 
unsigned numSquashable
 The number of walks belonging to squashed instructions that can be removed from the pendingQueue per cycle. More...
 
bool haveSecurity
 Cached copies of system-level properties. More...
 
bool _haveLPAE
 
bool _haveVirtualization
 
uint8_t physAddrRange
 
bool _haveLargeAsid64
 
Stats::Scalar statWalks
 Statistics. More...
 
Stats::Scalar statWalksShortDescriptor
 
Stats::Scalar statWalksLongDescriptor
 
Stats::Vector statWalksShortTerminatedAtLevel
 
Stats::Vector statWalksLongTerminatedAtLevel
 
Stats::Scalar statSquashedBefore
 
Stats::Scalar statSquashedAfter
 
Stats::Histogram statWalkWaitTime
 
Stats::Histogram statWalkServiceTime
 
Stats::Histogram statPendingWalks
 
Stats::Vector statPageSizes
 
Stats::Vector2d statRequestOrigin
 
unsigned pendingReqs
 
Tick pendingChangeTick
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Static Protected Attributes

static const unsigned REQUESTED = 0
 
static const unsigned COMPLETED = 1
 

Private Member Functions

void doL1Descriptor ()
 
void doL1DescriptorWrapper ()
 
void doL2Descriptor ()
 
void doL2DescriptorWrapper ()
 
void doLongDescriptor ()
 
void doL0LongDescriptorWrapper ()
 
void doL1LongDescriptorWrapper ()
 
void doL2LongDescriptorWrapper ()
 
void doL3LongDescriptorWrapper ()
 
void doLongDescriptorWrapper (LookupLevel curr_lookup_level)
 
bool fetchDescriptor (Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, int queueIndex, Event *event, void(TableWalker::*doDescriptor)())
 
void insertTableEntry (DescriptorBase &descriptor, bool longDescriptor)
 
Fault processWalk ()
 
Fault processWalkLPAE ()
 
Fault processWalkAArch64 ()
 
void processWalkWrapper ()
 
void nextWalk (ThreadContext *tc)
 
void pendingChange ()
 
Fault testWalk (Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level)
 

Static Private Member Functions

static unsigned adjustTableSizeAArch64 (unsigned tsz)
 
static bool checkAddrSizeFaultAArch64 (Addr addr, int currPhysAddrRange)
 Returns true if the address exceeds the range permitted by the system-wide setting or by the TCR_ELx IPS/PS setting. More...
 
static uint8_t pageSizeNtoStatBin (uint8_t N)
 

Private Attributes

EventWrapper< TableWalker,&TableWalker::doL1DescriptorWrapperdoL1DescEvent
 
EventWrapper< TableWalker,&TableWalker::doL2DescriptorWrapperdoL2DescEvent
 
EventWrapper< TableWalker,&TableWalker::doL0LongDescriptorWrapperdoL0LongDescEvent
 
EventWrapper< TableWalker,&TableWalker::doL1LongDescriptorWrapperdoL1LongDescEvent
 
EventWrapper< TableWalker,&TableWalker::doL2LongDescriptorWrapperdoL2LongDescEvent
 
EventWrapper< TableWalker,&TableWalker::doL3LongDescriptorWrapperdoL3LongDescEvent
 
EventLongDescEventByLevel [4]
 
EventWrapper< TableWalker,&TableWalker::processWalkWrapperdoProcessEvent
 

Additional Inherited Members

- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 

Detailed Description

Definition at line 62 of file table_walker.hh.

Member Typedef Documentation

typedef ArmTableWalkerParams ArmISA::TableWalker::Params

Definition at line 877 of file table_walker.hh.

Member Enumeration Documentation

Enumerator
Grain4KB 
Grain16KB 
Grain64KB 
ReservedGrain 

Definition at line 366 of file table_walker.hh.

Constructor & Destructor Documentation

TableWalker::TableWalker ( const Params p)
TableWalker::~TableWalker ( )
virtual

Definition at line 93 of file table_walker.cc.

Member Function Documentation

unsigned TableWalker::adjustTableSizeAArch64 ( unsigned  tsz)
staticprivate

Definition at line 715 of file table_walker.cc.

Referenced by processWalkAArch64().

bool TableWalker::checkAddrSizeFaultAArch64 ( Addr  addr,
int  currPhysAddrRange 
)
staticprivate

Returns true if the address exceeds the range permitted by the system-wide setting or by the TCR_ELx IPS/PS setting.

Definition at line 725 of file table_walker.cc.

References bits(), and ArmISA::MaxPhysAddrRange.

Referenced by doLongDescriptor().

void TableWalker::completeDrain ( )

Checks if all state is cleared and if so, completes drain.

Definition at line 140 of file table_walker.cc.

References DPRINTF, Draining, Drainable::drainState(), ArmISA::L0, ArmISA::L1, ArmISA::L2, ArmISA::L3, pendingQueue, Drainable::signalDrainDone(), and stateQueues.

Referenced by nextWalk().

void TableWalker::doL0LongDescriptorWrapper ( )
private

Definition at line 1854 of file table_walker.cc.

References doLongDescriptorWrapper().

void TableWalker::doL1Descriptor ( )
private
Todo:
: check sctlr.ha (bit[17]) if Hardware Access Flag is enabled if set, do l1.Desc.setAp0() instead of generating AccessFlag0

Definition at line 1416 of file table_walker.cc.

References ArmISA::ArmFault::AccessFlagLL, ArmISA::TableWalker::L1Descriptor::ap(), bits(), currState, ArmISA::TableWalker::L1Descriptor::data, ArmISA::TableWalker::L2Descriptor::data, ArmISA::TableWalker::WalkerState::delayed, doL2DescEvent, doL2Descriptor(), ArmISA::TableWalker::L1Descriptor::domain(), DPRINTF, ArmISA::TableWalker::WalkerState::fault, fetchDescriptor(), ArmISA::TableWalker::L1Descriptor::Ignore, insertTableEntry(), ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TableWalker::WalkerState::isWrite, ArmISA::L1, ArmISA::TableWalker::WalkerState::l1Desc, ArmISA::L2, ArmISA::TableWalker::L1Descriptor::l2Addr(), ArmISA::TableWalker::WalkerState::l2Desc, ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::TableWalker::L1Descriptor::PageTable, panic, Request::PT_WALK, ArmISA::TableWalker::WalkerState::req, ArmISA::TableWalker::L1Descriptor::Reserved, ArmISA::TableWalker::WalkerState::sctlr, ArmISA::TableWalker::L1Descriptor::Section, Request::SECURE, Flags< T >::set(), ArmISA::TableWalker::L1Descriptor::supersection(), ArmISA::TableWalker::WalkerState::tc, MipsISA::te, testWalk(), ArmISA::TableWalker::WalkerState::timing, ArmISA::ArmFault::TranslationLL, ArmISA::TableWalker::L1Descriptor::type(), ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, and ArmISA::ArmFault::VmsaTran.

Referenced by doL1DescriptorWrapper(), and processWalk().

void TableWalker::doL1DescriptorWrapper ( )
private
void TableWalker::doL1LongDescriptorWrapper ( )
private

Definition at line 1860 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L1.

void TableWalker::doL2Descriptor ( )
private
void TableWalker::doL2DescriptorWrapper ( )
private
void TableWalker::doL2LongDescriptorWrapper ( )
private

Definition at line 1866 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L2.

void TableWalker::doL3LongDescriptorWrapper ( )
private

Definition at line 1872 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L3.

void TableWalker::doLongDescriptor ( )
private

Definition at line 1511 of file table_walker.cc.

References ArmISA::TableWalker::WalkerState::aarch64, ArmISA::ArmFault::AccessFlagLL, ArmISA::ArmFault::AddressSizeLL, ArmISA::TableWalker::LongDescriptor::af(), ArmISA::TableWalker::LongDescriptor::ap(), ArmISA::TableWalker::LongDescriptor::Block, checkAddrSizeFaultAArch64(), ArmISA::TlbEntry::Client, currState, ArmISA::TableWalker::LongDescriptor::data, ArmISA::TableWalker::WalkerState::delayed, DPRINTF, MipsISA::event, ArmISA::TableWalker::WalkerState::fault, fetchDescriptor(), insertTableEntry(), ArmISA::TableWalker::LongDescriptor::Invalid, ArmISA::TableWalker::WalkerState::isFetch, isStage2, ArmISA::TableWalker::WalkerState::isWrite, X86ISA::L, ArmISA::L1, ArmISA::L2, ArmISA::L3, ArmISA::TableWalker::WalkerState::longDesc, LongDescEventByLevel, ArmISA::TableWalker::DescriptorBase::lookupLevel, ArmISA::ArmFault::LpaeTran, ArmISA::MaxPhysAddrRange, mbits(), ArmISA::TableWalker::LongDescriptor::nextDescAddr(), ArmISA::TlbEntry::NoAccess, NoFault, ArmISA::TableWalker::LongDescriptor::offsetBits(), ArmISA::TableWalker::LongDescriptor::Page, panic, ArmISA::TableWalker::WalkerState::physAddrRange, Request::PT_WALK, ArmISA::TableWalker::LongDescriptor::pxn(), ArmISA::TableWalker::LongDescriptor::pxnTable(), ArmISA::TableWalker::WalkerState::pxnTable, ArmISA::TableWalker::WalkerState::req, ArmISA::TableWalker::LongDescriptor::rwTable(), ArmISA::TableWalker::WalkerState::rwTable, Request::SECURE, ArmISA::TableWalker::WalkerState::secureLookup, ArmISA::TableWalker::LongDescriptor::secureTable(), Flags< T >::set(), ArmISA::TableWalker::LongDescriptor::Table, ArmISA::TableWalker::WalkerState::tc, MipsISA::te, testWalk(), ArmISA::TableWalker::WalkerState::timing, toLookupLevel(), ArmISA::ArmFault::TranslationLL, ArmISA::TableWalker::LongDescriptor::type(), ArmISA::TableWalker::LongDescriptor::userTable(), ArmISA::TableWalker::WalkerState::userTable, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, ArmISA::TableWalker::LongDescriptor::xn(), ArmISA::TableWalker::LongDescriptor::xnTable(), and ArmISA::TableWalker::WalkerState::xnTable.

Referenced by doLongDescriptorWrapper(), and processWalkLPAE().

void TableWalker::doLongDescriptorWrapper ( LookupLevel  curr_lookup_level)
private
DrainState TableWalker::drain ( )
overridevirtual

Notify an object that it needs to drain its state.

If the object does not need further simulation to drain internal buffers, it returns DrainState::Drained and automatically switches to the Drained state. If the object needs more simulation, it returns DrainState::Draining and automatically enters the Draining state. Other return values are invalid.

Note
An object that has entered the Drained state can be disturbed by other objects in the system and consequently stop being drained. These perturbations are not visible in the drain state. The simulator therefore repeats the draining process until all objects return DrainState::Drained on the first call to drain().
Returns
DrainState::Drained if the object is drained at this point in time, DrainState::Draining if it needs further simulation.

Implements Drainable.

Definition at line 153 of file table_walker.cc.

References DPRINTF, Drained, Draining, ArmISA::i, ArmISA::MAX_LOOKUP_LEVELS, pendingQueue, and stateQueues.

void TableWalker::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 174 of file table_walker.cc.

References currState, params(), and pendingChange().

bool TableWalker::fetchDescriptor ( Addr  descAddr,
uint8_t *  data,
int  numBytes,
Request::Flags  flags,
int  queueIndex,
Event event,
void(TableWalker::*)()  doDescriptor 
)
private
BaseMasterPort & TableWalker::getMasterPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
overridevirtual

Get a master port with a given name and index.

This is used at binding time and returns a reference to a protocol-agnostic base master port.

Parameters
if_namePort name
idxIndex in the case of a VectorPort
Returns
A reference to the given port

Reimplemented from MemObject.

Definition at line 115 of file table_walker.cc.

References fatal, MemObject::getMasterPort(), isStage2, and port.

TLB* ArmISA::TableWalker::getTlb ( )
inline

Definition at line 908 of file table_walker.hh.

References tlb.

bool ArmISA::TableWalker::haveLargeAsid64 ( ) const
inline

Definition at line 891 of file table_walker.hh.

References _haveLargeAsid64.

Referenced by ArmISA::TLB::TLB().

bool ArmISA::TableWalker::haveLPAE ( ) const
inline

Definition at line 889 of file table_walker.hh.

References _haveLPAE.

Referenced by ArmISA::TLB::TLB().

bool ArmISA::TableWalker::haveVirtualization ( ) const
inline

Definition at line 890 of file table_walker.hh.

References _haveVirtualization.

Referenced by ArmISA::TLB::TLB().

void TableWalker::init ( )
overridevirtual

init() is called after all C++ SimObjects have been created and all ports are connected.

Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.

Reimplemented from SimObject.

Definition at line 107 of file table_walker.cc.

References fatal_if(), port, stage2Mmu, and tlb.

void TableWalker::insertTableEntry ( DescriptorBase descriptor,
bool  longDescriptor 
)
private

Definition at line 2019 of file table_walker.cc.

References ArmISA::TableWalker::WalkerState::aarch64, ArmISA::TableWalker::DescriptorBase::ap(), ArmISA::TlbEntry::ap, ArmISA::TableWalker::LongDescriptor::ap(), ArmISA::TlbEntry::asid, ArmISA::TableWalker::WalkerState::asid, COMPLETED, currState, ArmISA::TableWalker::DescriptorBase::dbgHeader(), ArmISA::TableWalker::DescriptorBase::domain(), ArmISA::TlbEntry::domain, DPRINTF, ArmISA::TlbEntry::el, ArmISA::TableWalker::WalkerState::el, ArmISA::TableWalker::DescriptorBase::getRawData(), ArmISA::TableWalker::DescriptorBase::global(), ArmISA::TlbEntry::global, ArmISA::TlbEntry::hap, haveSecurity, ArmISA::TLB::insert(), ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TlbEntry::isHyp, ArmISA::TableWalker::WalkerState::isHyp, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TlbEntry::longDescFormat, ArmISA::TableWalker::DescriptorBase::lookupLevel, ArmISA::TlbEntry::lookupLevel, memAttrs(), memAttrsAArch64(), memAttrsLPAE(), ArmISA::TlbEntry::N, ArmISA::TlbEntry::nonCacheable, ArmISA::TlbEntry::ns, ArmISA::TlbEntry::nstid, ArmISA::TableWalker::DescriptorBase::offsetBits(), pageSizeNtoStatBin(), ArmISA::TableWalker::DescriptorBase::pfn(), ArmISA::TlbEntry::pfn, ArmISA::TlbEntry::pxn, ArmISA::TableWalker::LongDescriptor::pxn(), ArmISA::TableWalker::WalkerState::pxnTable, ArmISA::TableWalker::WalkerState::req, ArmISA::TableWalker::WalkerState::rwTable, ArmISA::TableWalker::WalkerState::sctlr, ArmISA::TableWalker::DescriptorBase::secure(), ArmISA::TableWalker::DescriptorBase::shareable(), ArmISA::TlbEntry::size, statPageSizes, statRequestOrigin, ArmISA::TableWalker::WalkerState::tc, MipsISA::te, ArmISA::TableWalker::DescriptorBase::texcb(), ArmISA::TableWalker::WalkerState::timing, tlb, ArmISA::TableWalker::WalkerState::userTable, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TlbEntry::valid, ArmISA::TlbEntry::vmid, ArmISA::TableWalker::WalkerState::vmid, ArmISA::TlbEntry::vpn, ArmISA::TableWalker::DescriptorBase::xn(), ArmISA::TlbEntry::xn, and ArmISA::TableWalker::WalkerState::xnTable.

Referenced by doL1Descriptor(), doL2Descriptor(), and doLongDescriptor().

void TableWalker::memAttrs ( ThreadContext tc,
TlbEntry te,
SCTLR  sctlr,
uint8_t  texcb,
bool  s 
)
void TableWalker::memAttrsAArch64 ( ThreadContext tc,
TlbEntry te,
LongDescriptor lDescriptor 
)
void TableWalker::memAttrsLPAE ( ThreadContext tc,
TlbEntry te,
LongDescriptor lDescriptor 
)
void TableWalker::nextWalk ( ThreadContext tc)
private
uint8_t TableWalker::pageSizeNtoStatBin ( uint8_t  N)
staticprivate

Definition at line 2142 of file table_walker.cc.

References panic.

Referenced by insertTableEntry().

const Params* ArmISA::TableWalker::params ( ) const
inline

Definition at line 882 of file table_walker.hh.

References SimObject::_params.

Referenced by drainResume().

void TableWalker::pendingChange ( )
private
Fault TableWalker::processWalk ( )
private
Fault TableWalker::processWalkAArch64 ( )
private
Fault TableWalker::processWalkLPAE ( )
private

Definition at line 551 of file table_walker.cc.

References ArmISA::TableWalker::LongDescriptor::aarch64, bits(), currState, curTick(), ArmISA::TableWalker::LongDescriptor::data, doLongDescriptor(), DPRINTF, ArmISA::f, ArmISA::TableWalker::WalkerState::fault, fetchDescriptor(), ArmISA::flattenMiscRegNsBanked(), Grain4KB, ArmISA::TableWalker::LongDescriptor::grainSize, ArmISA::TableWalker::WalkerState::htcr, ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TableWalker::WalkerState::isHyp, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TableWalker::WalkerState::isWrite, ArmISA::L1, ArmISA::L2, ArmISA::TableWalker::WalkerState::longDesc, LongDescEventByLevel, ArmISA::longDescFormatInUse(), ArmISA::TableWalker::DescriptorBase::lookupLevel, ArmISA::ArmFault::LpaeTran, mbits(), ArmISA::MISCREG_HTTBR, ArmISA::MISCREG_TTBR0, ArmISA::MISCREG_TTBR1, ArmISA::MISCREG_VTTBR, ArmISA::n, nextWalk(), ArmISA::TlbEntry::NoAccess, pending, Request::PT_WALK, ThreadContext::readMiscReg(), ArmISA::TableWalker::WalkerState::req, Stats::DistBase< Derived, Stor >::sample(), ArmISA::TableWalker::WalkerState::sctlr, Request::SECURE, Flags< T >::set(), ArmISA::TableWalker::WalkerState::startTime, statWalkWaitTime, ArmISA::TableWalker::WalkerState::tc, testWalk(), ArmISA::TableWalker::WalkerState::timing, ArmISA::ArmFault::TranslationLL, ArmISA::TableWalker::WalkerState::ttbcr, ULL, Request::UNCACHEABLE, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, and ArmISA::TableWalker::WalkerState::vtcr.

Referenced by processWalkWrapper(), and walk().

void TableWalker::processWalkWrapper ( )
private
void TableWalker::regStats ( )
overridevirtual
void TableWalker::setMMU ( Stage2MMU m,
MasterID  master_id 
)

Definition at line 99 of file table_walker.cc.

References ArmISA::Stage2MMU::getPort(), ArmISA::m, masterId, port, and stage2Mmu.

Referenced by ArmISA::TLB::setMMU().

void ArmISA::TableWalker::setTlb ( TLB _tlb)
inline

Definition at line 907 of file table_walker.hh.

References tlb.

Referenced by ArmISA::TLB::TLB().

Fault TableWalker::testWalk ( Addr  pa,
Addr  size,
TlbEntry::DomainType  domain,
LookupLevel  lookup_level 
)
private
LookupLevel TableWalker::toLookupLevel ( uint8_t  lookup_level_as_int)
static

Definition at line 2100 of file table_walker.cc.

References ArmISA::L1, ArmISA::L2, ArmISA::L3, and panic.

Referenced by doLongDescriptor().

Fault TableWalker::walk ( RequestPtr  req,
ThreadContext tc,
uint16_t  asid,
uint8_t  _vmid,
bool  _isHyp,
TLB::Mode  mode,
TLB::Translation _trans,
bool  timing,
bool  functional,
bool  secure,
TLB::ArmTranslationType  tranType,
bool  _stage2Req 
)
Todo:
These should be cached or grabbed from cached copies in the TLB, all these miscreg reads are expensive

Definition at line 184 of file table_walker.cc.

References _haveVirtualization, ArmISA::TableWalker::WalkerState::aarch64, ArmISA::TableWalker::WalkerState::asid, ArmISA::currEL(), ArmISA::currOpMode(), currState, curTick(), ArmISA::TableWalker::WalkerState::doingStage2, DPRINTF, ArmISA::TableWalker::WalkerState::el, ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, ArmISA::ELIs64(), BaseTLB::Execute, ArmISA::TableWalker::WalkerState::fault, ArmISA::flattenMiscRegNsBanked(), ArmISA::TableWalker::WalkerState::functional, Request::getVaddr(), haveSecurity, ArmISA::TableWalker::WalkerState::hcr, ArmISA::TableWalker::WalkerState::htcr, ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TableWalker::WalkerState::isHyp, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TableWalker::WalkerState::isWrite, ArmISA::longDescFormatInUse(), ArmISA::MISCREG_HCR, ArmISA::MISCREG_HCR_EL2, ArmISA::MISCREG_HTCR, 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_VTCR, ArmISA::MISCREG_VTCR_EL2, ArmISA::TableWalker::WalkerState::mode, NoFault, panic, pending, pendingChange(), pendingQueue, ArmISA::TableWalker::WalkerState::physAddrRange, physAddrRange, processWalk(), processWalkAArch64(), processWalkLPAE(), ArmISA::purifyTaggedAddr(), ArmISA::TableWalker::WalkerState::pxnTable, ThreadContext::readMiscReg(), ArmISA::TableWalker::WalkerState::req, REQUESTED, ArmISA::TableWalker::WalkerState::rwTable, ArmISA::TableWalker::WalkerState::sctlr, sctlr, ArmISA::TableWalker::WalkerState::secureLookup, ArmISA::TableWalker::WalkerState::stage2Req, ArmISA::TableWalker::WalkerState::startTime, statRequestOrigin, statSquashedBefore, statWalks, statWalksLongDescriptor, statWalksShortDescriptor, ArmISA::TableWalker::WalkerState::tableWalker, ArmISA::TableWalker::WalkerState::tc, ArmISA::TableWalker::WalkerState::tcr, ArmISA::TableWalker::WalkerState::timing, ArmISA::TableWalker::WalkerState::transState, ArmISA::TableWalker::WalkerState::tranType, ArmISA::TableWalker::WalkerState::ttbcr, ArmISA::TableWalker::WalkerState::userTable, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, ArmISA::TableWalker::WalkerState::vmid, ArmISA::TableWalker::WalkerState::vtcr, BaseTLB::Write, and ArmISA::TableWalker::WalkerState::xnTable.

Referenced by ArmISA::TLB::getTE().

Member Data Documentation

bool ArmISA::TableWalker::_haveLargeAsid64
protected

Definition at line 854 of file table_walker.hh.

Referenced by haveLargeAsid64().

bool ArmISA::TableWalker::_haveLPAE
protected

Definition at line 851 of file table_walker.hh.

Referenced by haveLPAE(), and memAttrsLPAE().

bool ArmISA::TableWalker::_haveVirtualization
protected

Definition at line 852 of file table_walker.hh.

Referenced by haveVirtualization(), and walk().

const unsigned ArmISA::TableWalker::COMPLETED = 1
staticprotected

Definition at line 874 of file table_walker.hh.

Referenced by insertTableEntry().

WalkerState* ArmISA::TableWalker::currState
protected
EventWrapper<TableWalker, &TableWalker::doL0LongDescriptorWrapper> ArmISA::TableWalker::doL0LongDescEvent
private

Definition at line 935 of file table_walker.hh.

Referenced by TableWalker().

EventWrapper<TableWalker, &TableWalker::doL1DescriptorWrapper> ArmISA::TableWalker::doL1DescEvent
private

Definition at line 924 of file table_walker.hh.

Referenced by processWalk().

EventWrapper<TableWalker, &TableWalker::doL1LongDescriptorWrapper> ArmISA::TableWalker::doL1LongDescEvent
private

Definition at line 938 of file table_walker.hh.

Referenced by TableWalker().

EventWrapper<TableWalker, &TableWalker::doL2DescriptorWrapper> ArmISA::TableWalker::doL2DescEvent
private

Definition at line 929 of file table_walker.hh.

Referenced by doL1Descriptor().

EventWrapper<TableWalker, &TableWalker::doL2LongDescriptorWrapper> ArmISA::TableWalker::doL2LongDescEvent
private

Definition at line 941 of file table_walker.hh.

Referenced by TableWalker().

EventWrapper<TableWalker, &TableWalker::doL3LongDescriptorWrapper> ArmISA::TableWalker::doL3LongDescEvent
private

Definition at line 944 of file table_walker.hh.

Referenced by TableWalker().

EventWrapper<TableWalker, &TableWalker::processWalkWrapper> ArmISA::TableWalker::doProcessEvent
private

Definition at line 963 of file table_walker.hh.

Referenced by nextWalk().

bool ArmISA::TableWalker::haveSecurity
protected

Cached copies of system-level properties.

Definition at line 850 of file table_walker.hh.

Referenced by insertTableEntry(), processWalk(), and walk().

const bool ArmISA::TableWalker::isStage2
protected

Indicates whether this table walker is part of the stage 2 mmu.

Definition at line 832 of file table_walker.hh.

Referenced by doL1Descriptor(), doL2Descriptor(), doLongDescriptor(), getMasterPort(), insertTableEntry(), processWalk(), processWalkAArch64(), processWalkLPAE(), processWalkWrapper(), and walk().

Event* ArmISA::TableWalker::LongDescEventByLevel[4]
private

Definition at line 947 of file table_walker.hh.

Referenced by doLongDescriptor(), and processWalkLPAE().

MasterID ArmISA::TableWalker::masterId
protected

Master id assigned by the MMU.

Definition at line 829 of file table_walker.hh.

Referenced by fetchDescriptor(), and setMMU().

unsigned ArmISA::TableWalker::numSquashable
protected

The number of walks belonging to squashed instructions that can be removed from the pendingQueue per cycle.

Definition at line 847 of file table_walker.hh.

Referenced by processWalkWrapper().

bool ArmISA::TableWalker::pending
protected

If a timing translation is currently in progress.

Definition at line 843 of file table_walker.hh.

Referenced by doL1DescriptorWrapper(), doL2DescriptorWrapper(), doLongDescriptorWrapper(), processWalk(), processWalkLPAE(), processWalkWrapper(), and walk().

Tick ArmISA::TableWalker::pendingChangeTick
mutableprotected

Definition at line 871 of file table_walker.hh.

Referenced by pendingChange().

std::list<WalkerState *> ArmISA::TableWalker::pendingQueue
protected

Queue of requests that have passed are waiting because the walker is currently busy.

Definition at line 820 of file table_walker.hh.

Referenced by completeDrain(), drain(), nextWalk(), pendingChange(), processWalkWrapper(), and walk().

unsigned ArmISA::TableWalker::pendingReqs
mutableprotected

Definition at line 870 of file table_walker.hh.

Referenced by pendingChange().

uint8_t ArmISA::TableWalker::physAddrRange
protected

Definition at line 853 of file table_walker.hh.

Referenced by walk().

DmaPort* ArmISA::TableWalker::port
protected

Port shared by the two table walkers.

Definition at line 826 of file table_walker.hh.

Referenced by fetchDescriptor(), getMasterPort(), init(), and setMMU().

const unsigned ArmISA::TableWalker::REQUESTED = 0
staticprotected

Definition at line 873 of file table_walker.hh.

Referenced by walk().

SCTLR ArmISA::TableWalker::sctlr
protected

Cached copy of the sctlr as it existed when translation began.

Definition at line 838 of file table_walker.hh.

Referenced by walk().

Stage2MMU* ArmISA::TableWalker::stage2Mmu
protected

The MMU to forward second stage look upts to.

Definition at line 823 of file table_walker.hh.

Referenced by fetchDescriptor(), init(), and setMMU().

std::list<WalkerState *> ArmISA::TableWalker::stateQueues[MAX_LOOKUP_LEVELS]
protected

Queues of requests for all the different lookup levels.

Definition at line 816 of file table_walker.hh.

Referenced by completeDrain(), doL1DescriptorWrapper(), doL2DescriptorWrapper(), doLongDescriptorWrapper(), drain(), and fetchDescriptor().

Stats::Vector ArmISA::TableWalker::statPageSizes
protected

Definition at line 867 of file table_walker.hh.

Referenced by insertTableEntry(), and regStats().

Stats::Histogram ArmISA::TableWalker::statPendingWalks
protected

Definition at line 866 of file table_walker.hh.

Referenced by pendingChange(), and regStats().

Stats::Vector2d ArmISA::TableWalker::statRequestOrigin
protected

Definition at line 868 of file table_walker.hh.

Referenced by insertTableEntry(), regStats(), and walk().

Stats::Scalar ArmISA::TableWalker::statSquashedAfter
protected

Definition at line 863 of file table_walker.hh.

Referenced by regStats().

Stats::Scalar ArmISA::TableWalker::statSquashedBefore
protected

Definition at line 862 of file table_walker.hh.

Referenced by processWalkWrapper(), regStats(), and walk().

Stats::Scalar ArmISA::TableWalker::statWalks
protected

Statistics.

Definition at line 857 of file table_walker.hh.

Referenced by regStats(), and walk().

Stats::Histogram ArmISA::TableWalker::statWalkServiceTime
protected
Stats::Scalar ArmISA::TableWalker::statWalksLongDescriptor
protected

Definition at line 859 of file table_walker.hh.

Referenced by regStats(), and walk().

Stats::Vector ArmISA::TableWalker::statWalksLongTerminatedAtLevel
protected

Definition at line 861 of file table_walker.hh.

Referenced by doLongDescriptorWrapper(), and regStats().

Stats::Scalar ArmISA::TableWalker::statWalksShortDescriptor
protected

Definition at line 858 of file table_walker.hh.

Referenced by regStats(), and walk().

Stats::Vector ArmISA::TableWalker::statWalksShortTerminatedAtLevel
protected

Definition at line 860 of file table_walker.hh.

Referenced by doL1DescriptorWrapper(), doL2DescriptorWrapper(), and regStats().

Stats::Histogram ArmISA::TableWalker::statWalkWaitTime
protected

Definition at line 864 of file table_walker.hh.

Referenced by processWalk(), processWalkAArch64(), processWalkLPAE(), and regStats().

TLB* ArmISA::TableWalker::tlb
protected

The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:29 for gem5 by doxygen 1.8.6