Go to the documentation of this file.
38 #ifndef __ARCH_ARM_TABLE_WALKER_HH__
39 #define __ARCH_ARM_TABLE_WALKER_HH__
48 #include "params/ArmTableWalker.hh"
75 virtual bool xn()
const = 0;
76 virtual uint8_t
ap()
const = 0;
80 virtual std::string
dbgHeader()
const = 0;
84 panic(
"texcb() not implemented for this class\n");
88 panic(
"shareable() not implemented for this class\n");
122 return "Inserting Section Descriptor into TLB\n";
145 panic(
"Super sections not implemented\n");
152 panic(
"Super sections not implemented\n");
161 panic(
"Super sections not implemented\n");
272 return "Inserting L2 Descriptor into TLB\n";
287 return large() ? 16 : 12;
403 return "Inserting Page descriptor into TLB\n";
406 return "Inserting Block descriptor into TLB\n";
456 panic(
"Invalid AArch64 VM granule size\n");
465 panic(
"Invalid AArch64 VM granule size\n");
468 panic(
"AArch64 page table entry must be block or page\n");
515 int va_hi = va_lo +
stride - 1;
606 return ((!
rw) << 2) | (
user << 1);
894 void init()
override;
908 uint16_t
asid, uint8_t _vmid,
910 bool timing,
bool functional,
bool secure,
917 uint8_t texcb,
bool s);
919 LongDescriptor &lDescriptor);
921 LongDescriptor &lDescriptor);
979 #endif //__ARCH_ARM_TABLE_WALKER_HH__
Addr l2Addr() const
Address of L2 descriptor if it exists.
Stats::Histogram walkWaitTime
virtual uint64_t getRawData() const
virtual std::string dbgHeader() const
bool stage2Req
Flag indicating if a second stage of lookup is required.
BaseTLB::Mode mode
Save mode for use in delayed response.
bool af() const
Returns true if the access flag (AF) is set.
ExceptionLevel el
Current exception level.
GrainSize grainSize
Width of the granule size in bits.
SCR scr
Cached copy of the scr as it existed when translation began.
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 drainResume() override
Resume execution after a successful drain.
bool functional
If the atomic mode should be functional.
Stats::Scalar walksShortDescriptor
Addr pfn() const
Return the physical frame, bits shifted right.
Level 2 page table descriptor.
void memAttrsAArch64(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
virtual bool secure(bool have_security, WalkerState *currState) const =0
bool supersection() const
Is the page a Supersection (16MB)?
TLB::ArmTranslationType tranType
The translation type that has been requested.
uint16_t asid
ASID that we're servicing the request under.
TableWalkerStats(Stats::Group *parent)
virtual bool global(WalkerState *currState) const =0
uint8_t rwTable() const
R/W protection flag for subsequent levels of lookup.
void doL0LongDescriptorWrapper()
virtual bool shareable() const
Fault testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level)
virtual uint8_t offsetBits() const
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
RequestPtr req
Request that is currently being serviced.
const PortID InvalidPortID
bool shareable() const
If the section is shareable.
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
LookupLevel lookupLevel
Current lookup level for this descriptor.
Stage2MMU * stage2Mmu
The MMU to forward second stage look upts to.
virtual std::string dbgHeader() const =0
const bool isStage2
Indicates whether this table walker is part of the stage 2 mmu.
Addr nextDescAddr(Addr va) const
Return the address of the next descriptor.
bool secure(bool have_security, WalkerState *currState) const
void doLongDescriptorWrapper(LookupLevel curr_lookup_level)
Addr pfn() const
Return the physical frame, bits shifted right.
EventFunctionWrapper doL2LongDescEvent
unsigned numSquashable
The number of walks belonging to squashed instructions that can be removed from the pendingQueue per ...
int physAddrRange
Current physical address range in bits.
ThreadContext * tc
Thread context that we're doing the walk for.
bool haveLargeAsid64() const
L2Descriptor(L1Descriptor &parent)
uint8_t apTable() const
Two bit access protection flags for subsequent levels of lookup.
const Params * params() const
virtual bool xn() const =0
uint64_t Tick
Tick count type.
unsigned levels
Page entries walked during service (for stats)
EntryType
Type of page table entry ARM DDI 0406B: B3-8.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
EventFunctionWrapper doProcessEvent
std::shared_ptr< Request > RequestPtr
bool dirty() const
This entry needs to be written back to memory.
Tick startTime
Timestamp for calculating elapsed time in service (for stats)
HCR hcr
Cached copy of the htcr as it existed when translation began.
void memAttrs(ThreadContext *tc, TlbEntry &te, SCTLR sctlr, uint8_t texcb, bool s)
static uint8_t pageSizeNtoStatBin(uint8_t N)
Stats::Scalar walksLongDescriptor
virtual uint64_t getRawData() const
bool pxnTable() const
Is privileged execution allowed on subsequent lookup levels?
void doL2DescriptorWrapper()
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
TlbEntry::DomainType domain() const
Domain Client/Manager: ARM DDI 0406B: B3-31.
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
EntryType type() const
Return the descriptor type.
EventFunctionWrapper doL0LongDescEvent
static const unsigned REQUESTED
FaultSource
Generic fault source enums used to index into {short/long/aarch64}DescFaultSources[] to get the actua...
uint8_t ap() const
Three bit access protection flags.
virtual uint8_t offsetBits() const =0
uint8_t userTable() const
User/privileged mode protection flag for subsequent levels of lookup.
A vector of scalar stats.
Addr paddr(Addr va) const
Return complete physical address given a VA.
TableWalker * tableWalker
bool isWrite
If the access is a write.
uint8_t ap() const
2-bit access protection flags
bool isSecure
If the access comes from the secure state.
void nextWalk(ThreadContext *tc)
bool invalid() const
Is the entry invalid.
L1Descriptor l1Desc
Short-format descriptors.
uint32_t data
The raw bits of the entry.
bool timing
If the mode is timing or atomic.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
LongDescriptor longDesc
Long-format descriptor (LPAE and AArch64)
bool secureLookup
Helper variables used to implement hierarchical access permissions when the long-desc.
bool contiguousHint() const
Contiguous hint bit.
virtual Addr pfn() const =0
CPSR cpsr
Cached copy of the cpsr as it existed when translation began.
static LookupLevel toLookupLevel(uint8_t lookup_level_as_int)
TLB::Translation * stage2Tran
A pointer to the stage 2 translation that's in progress.
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
Fault processWalkAArch64()
DrainState
Object drain/handover states.
This is a simple scalar statistic, like a counter.
bool rw() const
Read/write access protection flag.
L1Descriptor()
Default ctor.
RequestorID requestorId
Requestor id assigned by the MMU.
virtual TlbEntry::DomainType domain() const
bool dirty() const
This entry needs to be written back to memory.
Addr pfn() const
Return the physical frame, bits shifted right.
void doL3LongDescriptorWrapper()
void setAp0()
Set access flag that this entry has been touched.
uint8_t ap() const
Three bit access protection flags.
uint64_t data
The raw bits of the entry.
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
Addr paddr() const
Return the physcal address of the entry, bits in position.
bool aarch64
If the access is performed in AArch64 state.
uint8_t texcb() const
Memory region attributes: ARM DDI 0406B: B3-32.
uint8_t attrIndx() const
Attribute index.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
bool fetchDescriptor(Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, int queueIndex, Event *event, void(TableWalker::*doDescriptor)())
virtual uint64_t getRawData() const =0
std::shared_ptr< FaultBase > Fault
ArmISA::TableWalker::TableWalkerStats stats
bool secure(bool have_security, WalkerState *currState) const
Returns true if this entry targets the secure physical address map.
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
bool haveSecurity
Cached copies of system-level properties.
TlbEntry::DomainType domain() const
virtual std::string dbgHeader() const
bool large() const
What is the size of the mapping?
void setAp0()
Set access flag that this entry has been touched.
std::list< WalkerState * > stateQueues[MAX_LOOKUP_LEVELS]
Queues of requests for all the different lookup levels.
Ports are used to interface objects to each other.
bool secureTable() const
Whether the subsequent levels of lookup are secure.
Addr paddr(Addr va) const
Return the complete physical address given a VA.
uint8_t memAttr() const
Memory attributes, only used by stage 2 translations.
bool secure(bool have_security, WalkerState *currState) const
Returns true if this entry targets the secure physical address map.
ArmTableWalkerParams Params
uint8_t texcb() const
Memory region attributes: ARM DDI 0406B: B3-32.
bool shareable() const
If the section is shareable.
TableWalker(const Params *p)
VTCR_t vtcr
Cached copy of the vtcr as it existed when translation began.
bool haveVirtualization() const
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 ...
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void doL2LongDescriptorWrapper()
bool aarch64
True if the current lookup is performed in AArch64 state.
bool delayed
Whether the response is delayed in timing mode due to additional lookups.
EventFunctionWrapper doL3LongDescEvent
DmaPort * port
Port shared by the two table walkers.
static uint8_t ap(bool rw, bool user)
Return the AP bits as compatible with the AP[2:0] format.
virtual uint64_t getRawData() const
uint32_t data
The raw bits of the entry.
virtual uint8_t ap() const =0
bool user() const
User/privileged level access protection flag.
Event * LongDescEventByLevel[4]
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Stats::Histogram walkServiceTime
void setAf()
Set access flag that this entry has been touched.
Stats::Vector walksLongTerminatedAtLevel
bool isFetch
If the access is a fetch (for execution, and no-exec) must be checked?
Stats::Vector walksShortTerminatedAtLevel
Fault generateLongDescFault(ArmFault::FaultSource src)
uint8_t offsetBits() const
Return the bit width of the page/block offset.
void memAttrsLPAE(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
HTCR htcr
Cached copy of the htcr as it existed when translation began.
void completeDrain()
Checks if all state is cleared and if so, completes drain.
EventFunctionWrapper doL1LongDescEvent
virtual const std::string name() const
bool hpd
Hierarchical access permission disable.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Addr vaddr_tainted
The virtual address that is being translated.
Addr vaddr
The virtual address that is being translated with tagging removed.
void setMMU(Stage2MMU *m, RequestorID requestor_id)
bool xn() const
Is the translation not allow execution?
void doL1DescriptorWrapper()
A 2-Dimensional vecto of scalar stats.
bool dirty() const
This entry needs to be written back to memory.
TLB * tlb
TLB that is initiating these table walks.
uint8_t sh() const
2-bit shareability field
Addr paddr() const
Return the physical address of the entry.
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
Stats::Vector2d requestOrigin
bool isUncacheable
True if table walks are uncacheable (for table descriptors)
const SimObjectParams * _params
Cached copy of the object parameters.
std::list< WalkerState * > pendingQueue
Queue of requests that have passed are waiting because the walker is currently busy.
virtual TlbEntry::DomainType domain() const =0
bool xn() const
Is execution allowed on this mapping?
static unsigned adjustTableSizeAArch64(unsigned tsz)
Bitfield< 21, 20 > stride
Addr nextTableAddr() const
Return the address of the next page table.
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
static const unsigned COMPLETED
void doL1LongDescriptorWrapper()
bool xnTable() const
Is execution allowed on subsequent lookup levels?
EventFunctionWrapper doL1DescEvent
virtual std::string dbgHeader() const
bool pxn() const
Is privileged execution allowed on this mapping? (LPAE only)
EventFunctionWrapper doL2DescEvent
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
void processWalkWrapper()
bool xn() const
Is execution allowed on this mapping?
Long-descriptor format (LPAE)
TLB::Translation * transState
Translation state for delayed requests.
Fault fault
The fault that we are going to return.
Addr paddr(Addr va) const
Return the physcal address of the entry, bits in position.
Stats::Scalar squashedAfter
Stats::Scalar squashedBefore
virtual uint8_t texcb() const
L2Descriptor()
Default ctor.
void insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
Stats::Histogram pendingWalks
bool pending
If a timing translation is currently in progress.
EntryType
Descriptor type.
virtual uint8_t offsetBits() const
#define panic(...)
This implements a cprintf based panic() function.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17