gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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:
ClockedObject SimObject Clocked EventManager Serializable Drainable Stats::Group

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 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...
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port with a given name and index. More...
 
void regStats () override
 Callback to set stat parameters. More...
 
Fault walk (const 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 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...
 
- Public Member Functions inherited from SimObject
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 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...
 
const Paramsparams () const
 
 SimObject (const Params *_params)
 
- Public Member Functions inherited from EventManager
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)
 
 EventManager (EventManager &em)
 
 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 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 InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from Clocked
void updateClockPeriod ()
 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 ()
 Gets 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 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)())
 
Fault generateLongDescFault (ArmFault::FaultSource src)
 
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

EventFunctionWrapper doL1DescEvent
 
EventFunctionWrapper doL2DescEvent
 
EventFunctionWrapper doL0LongDescEvent
 
EventFunctionWrapper doL1LongDescEvent
 
EventFunctionWrapper doL2LongDescEvent
 
EventFunctionWrapper doL3LongDescEvent
 
EventLongDescEventByLevel [4]
 
EventFunctionWrapper doProcessEvent
 

Additional Inherited Members

- Public Attributes inherited from ClockedObject
PowerStatepowerState
 
- 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...
 
virtual void clockPeriodUpdated ()
 A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More...
 

Detailed Description

Definition at line 61 of file table_walker.hh.

Member Typedef Documentation

◆ Params

typedef ArmTableWalkerParams ArmISA::TableWalker::Params

Definition at line 881 of file table_walker.hh.

Member Enumeration Documentation

◆ GrainSize

Enumerator
Grain4KB 
Grain16KB 
Grain64KB 
ReservedGrain 

Definition at line 367 of file table_walker.hh.

Constructor & Destructor Documentation

◆ TableWalker()

TableWalker::TableWalker ( const Params p)

◆ ~TableWalker()

TableWalker::~TableWalker ( )
virtual

Definition at line 93 of file table_walker.cc.

Member Function Documentation

◆ adjustTableSizeAArch64()

unsigned TableWalker::adjustTableSizeAArch64 ( unsigned  tsz)
staticprivate

Definition at line 734 of file table_walker.cc.

Referenced by processWalkAArch64().

◆ checkAddrSizeFaultAArch64()

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 744 of file table_walker.cc.

References bits(), and ArmISA::MaxPhysAddrRange.

Referenced by doLongDescriptor(), and processWalkAArch64().

◆ completeDrain()

void TableWalker::completeDrain ( )

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

Definition at line 144 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 haveLargeAsid64(), and nextWalk().

◆ doL0LongDescriptorWrapper()

void TableWalker::doL0LongDescriptorWrapper ( )
private

Definition at line 1914 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L0.

Referenced by TableWalker().

◆ doL1Descriptor()

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 1474 of file table_walker.cc.

References ArmISA::ArmFault::AccessFlagLL, ArmISA::TableWalker::L1Descriptor::ap(), bits(), ArmISA::byteOrder(), 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(), htog(), ArmISA::TableWalker::L1Descriptor::Ignore, insertTableEntry(), ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TableWalker::WalkerState::isUncacheable, 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, ArmISA::te, testWalk(), ArmISA::TableWalker::WalkerState::timing, ArmISA::ArmFault::TranslationLL, ArmISA::TableWalker::L1Descriptor::type(), Request::UNCACHEABLE, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, and ArmISA::ArmFault::VmsaTran.

Referenced by getTlb(), and processWalk().

◆ doL1DescriptorWrapper()

void TableWalker::doL1DescriptorWrapper ( )
private

◆ doL1LongDescriptorWrapper()

void TableWalker::doL1LongDescriptorWrapper ( )
private

Definition at line 1920 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L1.

Referenced by TableWalker().

◆ doL2Descriptor()

void TableWalker::doL2Descriptor ( )
private

◆ doL2DescriptorWrapper()

void TableWalker::doL2DescriptorWrapper ( )
private

◆ doL2LongDescriptorWrapper()

void TableWalker::doL2LongDescriptorWrapper ( )
private

Definition at line 1926 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L2.

Referenced by TableWalker().

◆ doL3LongDescriptorWrapper()

void TableWalker::doL3LongDescriptorWrapper ( )
private

Definition at line 1932 of file table_walker.cc.

References doLongDescriptorWrapper(), and ArmISA::L3.

Referenced by TableWalker().

◆ doLongDescriptor()

void TableWalker::doLongDescriptor ( )
private

Definition at line 1599 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, ArmISA::byteOrder(), checkAddrSizeFaultAArch64(), ArmISA::TlbEntry::Client, currState, ArmISA::TableWalker::LongDescriptor::data, ArmISA::TableWalker::WalkerState::delayed, DPRINTF, MipsISA::event, ArmISA::TableWalker::WalkerState::fault, ArmISA::ArmFault::FaultSourceInvalid, fetchDescriptor(), generateLongDescFault(), ArmISA::TableWalker::WalkerState::hpd, htog(), insertTableEntry(), ArmISA::TableWalker::LongDescriptor::Invalid, ArmISA::TableWalker::WalkerState::isUncacheable, X86ISA::L, ArmISA::L1, ArmISA::L2, ArmISA::L3, ArmISA::TableWalker::WalkerState::longDesc, LongDescEventByLevel, ArmISA::TableWalker::DescriptorBase::lookupLevel, ArmISA::MaxPhysAddrRange, mbits(), ArmISA::TableWalker::LongDescriptor::nextDescAddr(), 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, ArmISA::TableWalker::WalkerState::sctlr, Request::SECURE, ArmISA::TableWalker::WalkerState::secureLookup, ArmISA::TableWalker::LongDescriptor::secureTable(), Flags< T >::set(), ArmISA::TableWalker::LongDescriptor::Table, ArmISA::TableWalker::WalkerState::tc, ArmISA::te, testWalk(), ArmISA::TableWalker::WalkerState::timing, toLookupLevel(), ArmISA::ArmFault::TranslationLL, ArmISA::TableWalker::LongDescriptor::type(), Request::UNCACHEABLE, 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 processWalkAArch64(), and processWalkLPAE().

◆ doLongDescriptorWrapper()

void TableWalker::doLongDescriptorWrapper ( LookupLevel  curr_lookup_level)
private

◆ drain()

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 157 of file table_walker.cc.

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

Referenced by haveLargeAsid64().

◆ drainResume()

void TableWalker::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 178 of file table_walker.cc.

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

Referenced by haveLargeAsid64().

◆ fetchDescriptor()

bool TableWalker::fetchDescriptor ( Addr  descAddr,
uint8_t *  data,
int  numBytes,
Request::Flags  flags,
int  queueIndex,
Event event,
void(TableWalker::*)()  doDescriptor 
)
private

◆ generateLongDescFault()

Fault TableWalker::generateLongDescFault ( ArmFault::FaultSource  src)
private

◆ getPort()

Port & TableWalker::getPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
overridevirtual

Get a port with a given name and index.

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

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

Reimplemented from SimObject.

Definition at line 115 of file table_walker.cc.

References fatal, SimObject::getPort(), isStage2, and port.

Referenced by haveLargeAsid64().

◆ getTlb()

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

◆ haveLargeAsid64()

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

◆ haveLPAE()

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

Definition at line 893 of file table_walker.hh.

References _haveLPAE.

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

◆ haveVirtualization()

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

Definition at line 894 of file table_walker.hh.

References _haveVirtualization.

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

◆ init()

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.

Referenced by params().

◆ insertTableEntry()

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

Definition at line 2075 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::EL1, 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, ArmISA::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().

◆ memAttrs()

void TableWalker::memAttrs ( ThreadContext tc,
TlbEntry te,
SCTLR  sctlr,
uint8_t  texcb,
bool  s 
)

◆ memAttrsAArch64()

void TableWalker::memAttrsAArch64 ( ThreadContext tc,
TlbEntry te,
LongDescriptor lDescriptor 
)

◆ memAttrsLPAE()

void TableWalker::memAttrsLPAE ( ThreadContext tc,
TlbEntry te,
LongDescriptor lDescriptor 
)

◆ nextWalk()

void TableWalker::nextWalk ( ThreadContext tc)
private

◆ pageSizeNtoStatBin()

uint8_t TableWalker::pageSizeNtoStatBin ( uint8_t  N)
staticprivate

Definition at line 2198 of file table_walker.cc.

References panic.

Referenced by insertTableEntry().

◆ params()

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

Definition at line 886 of file table_walker.hh.

References SimObject::_params, and init().

Referenced by drainResume().

◆ pendingChange()

void TableWalker::pendingChange ( )
private

◆ processWalk()

Fault TableWalker::processWalk ( )
private

◆ processWalkAArch64()

Fault TableWalker::processWalkAArch64 ( )
private

Definition at line 751 of file table_walker.cc.

References ArmISA::TableWalker::LongDescriptor::aarch64, ArmISA::TableWalker::WalkerState::aarch64, ArmISA::ArmFault::AddressSizeLL, adjustTableSizeAArch64(), bits(), checkAddrSizeFaultAArch64(), currState, curTick(), ArmISA::TableWalker::LongDescriptor::data, ArmISA::decodePhysAddrRange64(), doLongDescriptor(), DPRINTF, ArmISA::TableWalker::WalkerState::el, ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, ArmISA::f, ArmISA::TableWalker::WalkerState::fault, fetchDescriptor(), Grain16KB, Grain4KB, Grain64KB, ArmISA::TableWalker::LongDescriptor::grainSize, ArmISA::TableWalker::WalkerState::hcr, ArmISA::TableWalker::WalkerState::hpd, ArmISA::i, ArmISA::TableWalker::WalkerState::isFetch, ArmISA::TableWalker::WalkerState::isSecure, isStage2, ArmISA::TableWalker::WalkerState::isUncacheable, ArmISA::TableWalker::WalkerState::isWrite, X86ISA::L, ArmISA::L0, ArmISA::L1, ArmISA::L2, ArmISA::L3, ArmISA::TableWalker::WalkerState::longDesc, LongDescEventByLevel, ArmISA::TableWalker::DescriptorBase::lookupLevel, ArmISA::ArmFault::LpaeTran, ArmISA::mask, ArmISA::MAX_LOOKUP_LEVELS, mbits(), ArmISA::MISCREG_TTBR0_EL1, ArmISA::MISCREG_TTBR0_EL2, ArmISA::MISCREG_TTBR0_EL3, ArmISA::MISCREG_TTBR1_EL1, ArmISA::MISCREG_TTBR1_EL2, ArmISA::MISCREG_VTTBR_EL2, nextWalk(), ArmISA::TlbEntry::NoAccess, panic_if, pending, ArmISA::TableWalker::WalkerState::physAddrRange, ArmISA::ps, Request::PT_WALK, ThreadContext::readMiscReg(), ArmISA::TableWalker::WalkerState::req, ReservedGrain, Stats::DistBase< Derived, Stor >::sample(), ArmISA::TableWalker::WalkerState::sctlr, Request::SECURE, Flags< T >::set(), ArmISA::TableWalker::WalkerState::startTime, statWalkWaitTime, ArmISA::stride, ArmISA::TableWalker::WalkerState::tc, ArmISA::TableWalker::WalkerState::tcr, testWalk(), ArmISA::TableWalker::WalkerState::timing, ArmISA::ArmFault::TranslationLL, Request::UNCACHEABLE, ArmISA::TableWalker::WalkerState::vaddr, ArmISA::TableWalker::WalkerState::vaddr_tainted, ArmISA::TableWalker::WalkerState::vtcr, and warn_once.

Referenced by processWalkWrapper(), and walk().

◆ processWalkLPAE()

Fault TableWalker::processWalkLPAE ( )
private

Definition at line 562 of file table_walker.cc.

References ArmISA::TableWalker::LongDescriptor::aarch64, bits(), currState, curTick(), ArmISA::TableWalker::LongDescriptor::data, ArmISA::TableWalker::WalkerState::delayed, doLongDescriptor(), DPRINTF, ArmISA::f, ArmISA::TableWalker::WalkerState::fault, fetchDescriptor(), 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::isUncacheable, 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::snsBankedIndex(), 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().

◆ processWalkWrapper()

void TableWalker::processWalkWrapper ( )
private

◆ regStats()

void TableWalker::regStats ( )
overridevirtual

◆ setMMU()

void TableWalker::setMMU ( Stage2MMU m,
MasterID  master_id 
)

Definition at line 99 of file table_walker.cc.

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

Referenced by getTlb(), and ArmISA::TLB::setMMU().

◆ setTlb()

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

Definition at line 912 of file table_walker.hh.

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

◆ testWalk()

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

◆ toLookupLevel()

LookupLevel TableWalker::toLookupLevel ( uint8_t  lookup_level_as_int)
static

Definition at line 2156 of file table_walker.cc.

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

Referenced by doLongDescriptor(), and getTlb().

◆ walk()

Fault TableWalker::walk ( const 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 188 of file table_walker.cc.

References _haveVirtualization, ArmISA::TableWalker::WalkerState::aarch64, ArmISA::TableWalker::WalkerState::asid, currState, curTick(), DPRINTF, ArmISA::TableWalker::WalkerState::el, ArmISA::EL0, ArmISA::EL1, ArmISA::EL2, ArmISA::EL3, ArmISA::ELIs64(), BaseTLB::Execute, ArmISA::TableWalker::WalkerState::fault, ArmISA::TableWalker::WalkerState::functional, 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_CPSR, 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, processWalk(), processWalkAArch64(), processWalkLPAE(), ArmISA::purifyTaggedAddr(), ArmISA::TableWalker::WalkerState::pxnTable, ThreadContext::readMiscReg(), ArmISA::TableWalker::WalkerState::req, REQUESTED, ArmISA::TableWalker::WalkerState::rwTable, ArmISA::TableWalker::WalkerState::sctlr, ArmISA::TableWalker::WalkerState::secureLookup, ArmISA::snsBankedIndex(), 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::TLB::tranTypeEL(), 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, ArmISA::TableWalker::WalkerState::WalkerState(), BaseTLB::Write, and ArmISA::TableWalker::WalkerState::xnTable.

Referenced by ArmISA::TLB::getTE(), and haveLargeAsid64().

Member Data Documentation

◆ _haveLargeAsid64

bool ArmISA::TableWalker::_haveLargeAsid64
protected

Definition at line 858 of file table_walker.hh.

Referenced by haveLargeAsid64(), and TableWalker().

◆ _haveLPAE

bool ArmISA::TableWalker::_haveLPAE
protected

Definition at line 855 of file table_walker.hh.

Referenced by haveLPAE(), memAttrsLPAE(), and TableWalker().

◆ _haveVirtualization

bool ArmISA::TableWalker::_haveVirtualization
protected

Definition at line 856 of file table_walker.hh.

Referenced by haveVirtualization(), TableWalker(), and walk().

◆ COMPLETED

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

Definition at line 878 of file table_walker.hh.

Referenced by insertTableEntry().

◆ currState

WalkerState* ArmISA::TableWalker::currState
protected

◆ doL0LongDescEvent

EventFunctionWrapper ArmISA::TableWalker::doL0LongDescEvent
private

Definition at line 937 of file table_walker.hh.

Referenced by TableWalker().

◆ doL1DescEvent

EventFunctionWrapper ArmISA::TableWalker::doL1DescEvent
private

Definition at line 928 of file table_walker.hh.

Referenced by processWalk().

◆ doL1LongDescEvent

EventFunctionWrapper ArmISA::TableWalker::doL1LongDescEvent
private

Definition at line 939 of file table_walker.hh.

Referenced by TableWalker().

◆ doL2DescEvent

EventFunctionWrapper ArmISA::TableWalker::doL2DescEvent
private

Definition at line 932 of file table_walker.hh.

Referenced by doL1Descriptor(), and TableWalker().

◆ doL2LongDescEvent

EventFunctionWrapper ArmISA::TableWalker::doL2LongDescEvent
private

Definition at line 941 of file table_walker.hh.

Referenced by TableWalker().

◆ doL3LongDescEvent

EventFunctionWrapper ArmISA::TableWalker::doL3LongDescEvent
private

Definition at line 943 of file table_walker.hh.

Referenced by TableWalker().

◆ doProcessEvent

EventFunctionWrapper ArmISA::TableWalker::doProcessEvent
private

Definition at line 964 of file table_walker.hh.

Referenced by nextWalk(), and TableWalker().

◆ haveSecurity

bool ArmISA::TableWalker::haveSecurity
protected

Cached copies of system-level properties.

Definition at line 854 of file table_walker.hh.

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

◆ isStage2

const bool ArmISA::TableWalker::isStage2
protected

◆ LongDescEventByLevel

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

◆ masterId

MasterID ArmISA::TableWalker::masterId
protected

Master id assigned by the MMU.

Definition at line 833 of file table_walker.hh.

Referenced by fetchDescriptor(), and setMMU().

◆ numSquashable

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 851 of file table_walker.hh.

Referenced by processWalkWrapper().

◆ pending

bool ArmISA::TableWalker::pending
protected

If a timing translation is currently in progress.

Definition at line 847 of file table_walker.hh.

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

◆ pendingChangeTick

Tick ArmISA::TableWalker::pendingChangeTick
mutableprotected

Definition at line 875 of file table_walker.hh.

Referenced by pendingChange().

◆ pendingQueue

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

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

Definition at line 824 of file table_walker.hh.

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

◆ pendingReqs

unsigned ArmISA::TableWalker::pendingReqs
mutableprotected

Definition at line 874 of file table_walker.hh.

Referenced by pendingChange().

◆ physAddrRange

uint8_t ArmISA::TableWalker::physAddrRange
protected

Definition at line 857 of file table_walker.hh.

Referenced by TableWalker().

◆ port

DmaPort* ArmISA::TableWalker::port
protected

Port shared by the two table walkers.

Definition at line 830 of file table_walker.hh.

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

◆ REQUESTED

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

Definition at line 877 of file table_walker.hh.

Referenced by walk().

◆ sctlr

SCTLR ArmISA::TableWalker::sctlr
protected

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

Definition at line 842 of file table_walker.hh.

Referenced by TableWalker().

◆ stage2Mmu

Stage2MMU* ArmISA::TableWalker::stage2Mmu
protected

The MMU to forward second stage look upts to.

Definition at line 827 of file table_walker.hh.

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

◆ stateQueues

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

Queues of requests for all the different lookup levels.

Definition at line 820 of file table_walker.hh.

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

◆ statPageSizes

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

Definition at line 871 of file table_walker.hh.

Referenced by insertTableEntry(), and regStats().

◆ statPendingWalks

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

Definition at line 870 of file table_walker.hh.

Referenced by pendingChange(), and regStats().

◆ statRequestOrigin

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

Definition at line 872 of file table_walker.hh.

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

◆ statSquashedAfter

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

Definition at line 867 of file table_walker.hh.

Referenced by regStats().

◆ statSquashedBefore

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

Definition at line 866 of file table_walker.hh.

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

◆ statWalks

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

Statistics.

Definition at line 861 of file table_walker.hh.

Referenced by regStats(), and walk().

◆ statWalkServiceTime

Stats::Histogram ArmISA::TableWalker::statWalkServiceTime
protected

◆ statWalksLongDescriptor

Stats::Scalar ArmISA::TableWalker::statWalksLongDescriptor
protected

Definition at line 863 of file table_walker.hh.

Referenced by regStats(), and walk().

◆ statWalksLongTerminatedAtLevel

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

Definition at line 865 of file table_walker.hh.

Referenced by doLongDescriptorWrapper(), and regStats().

◆ statWalksShortDescriptor

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

Definition at line 862 of file table_walker.hh.

Referenced by regStats(), and walk().

◆ statWalksShortTerminatedAtLevel

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

Definition at line 864 of file table_walker.hh.

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

◆ statWalkWaitTime

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

Definition at line 868 of file table_walker.hh.

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

◆ tlb

TLB* ArmISA::TableWalker::tlb
protected

TLB that is initiating these table walks.

Definition at line 839 of file table_walker.hh.

Referenced by doL1DescriptorWrapper(), doL2DescriptorWrapper(), doLongDescriptorWrapper(), getTlb(), init(), insertTableEntry(), processWalkWrapper(), and testWalk().


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

Generated on Mon Jun 8 2020 15:45:34 for gem5 by doxygen 1.8.13