Go to the documentation of this file.
38 #ifndef __ARCH_ARM_TABLE_WALKER_HH__
39 #define __ARCH_ARM_TABLE_WALKER_HH__
52 #include "params/ArmTableWalker.hh"
81 virtual bool xn()
const = 0;
82 virtual uint8_t
ap()
const = 0;
86 virtual std::string
dbgHeader()
const = 0;
90 panic(
"texcb() not implemented for this class\n");
94 panic(
"shareable() not implemented for this class\n");
130 return "Inserting Section Descriptor into TLB\n";
153 panic(
"Super sections not implemented\n");
160 panic(
"Super sections not implemented\n");
169 panic(
"Super sections not implemented\n");
281 return "Inserting L2 Descriptor into TLB\n";
296 return large() ? 16 : 12;
427 return "Inserting Page descriptor into TLB\n";
430 return "Inserting Block descriptor into TLB\n";
497 panic(
"Invalid AArch64 VM granule size\n");
506 panic(
"Invalid AArch64 VM granule size\n");
509 panic(
"AArch64 page table entry must be block or page\n");
538 Addr table_address = 0;
543 table_address |=
bits(
data, 15, 12) << 48;
548 return table_address;
559 int va_hi = va_lo +
stride - 1;
650 return ((!
rw) << 2) | (
user << 1);
942 Stage2Walk *translation,
int num_bytes,
1035 bool timing,
bool functional,
bool secure,
1043 uint8_t texcb,
bool s);
1045 LongDescriptor &lDescriptor);
1047 LongDescriptor &lDescriptor);
1087 GrainSize granule,
int tsz,
bool low_range);
1110 #endif //__ARCH_ARM_TABLE_WALKER_HH__
This is a simple scalar statistic, like a counter.
EventFunctionWrapper doL1DescEvent
virtual std::string dbgHeader() const =0
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void doLongDescriptorWrapper(LookupLevel curr_lookup_level)
uint8_t texcb() const
Memory region attributes: ARM DDI 0406B: B3-32.
L1Descriptor()
Default ctor.
bool isSecure
If the access comes from the secure state.
bool xn() const
Is execution allowed on this mapping?
Event * LongDescEventByLevel[4]
statistics::Scalar walksLongDescriptor
bool pxnTable() const
Is privileged execution allowed on subsequent lookup levels?
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
Fault walk(const RequestPtr &req, ThreadContext *tc, uint16_t asid, vmid_t _vmid, bool _isHyp, BaseMMU::Mode mode, BaseMMU::Translation *_trans, bool timing, bool functional, bool secure, TLB::ArmTranslationType tranType, bool _stage2Req)
ExceptionLevel el
Current exception level.
void sendAtomicReq(Addr desc_addr, int size, uint8_t *data, Request::Flags flag, Tick delay)
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
LongDescriptor longDesc
Long-format descriptor (LPAE and AArch64)
uint8_t texcb() const
Memory region attributes: ARM DDI 0406B: B3-32.
EventFunctionWrapper doProcessEvent
virtual std::string dbgHeader() const
void readDataTimed(ThreadContext *tc, Addr desc_addr, Stage2Walk *translation, int num_bytes, Request::Flags flags)
void completeDrain()
Checks if all state is cleared and if so, completes drain.
void memAttrsAArch64(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
statistics::Vector walksLongTerminatedAtLevel
void doL1LongDescriptorWrapper()
Addr pfn() const
Return the physical frame, bits shifted right.
std::list< WalkerState * > pendingQueue
Queue of requests that have passed are waiting because the walker is currently busy.
Addr vaddr
The virtual address that is being translated with tagging removed.
Level 2 page table descriptor.
RequestorID requestorId
Requestor id assigned by the MMU.
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
bool rw() const
Read/write access protection flag.
uint8_t apTable() const
Two bit access protection flags for subsequent levels of lookup.
Port & getTableWalkerPort()
void nextWalk(ThreadContext *tc)
The QueuedRequestPort combines two queues, a request queue and a snoop response queue,...
Addr paddr() const
Return the physical address of the entry.
CPSR cpsr
Cached copy of the cpsr as it existed when translation began.
virtual TlbEntry::DomainType domain() const
This translation class is used to trigger the data fetch once a timing translation returns the transl...
statistics::Vector2d requestOrigin
virtual bool xn() const =0
Addr nextDescAddr(Addr va) const
Return the address of the next descriptor.
EntryType
Descriptor type.
virtual uint8_t texcb() const
bool secureLookup
Helper variables used to implement hierarchical access permissions when the long-desc.
statistics::Scalar squashedAfter
static LookupLevel toLookupLevel(uint8_t lookup_level_as_int)
virtual uint8_t offsetBits() const
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
A 2-Dimensional vecto of scalar stats.
uint32_t data
The raw bits of the entry.
A vector of scalar stats.
uint32_t data
The raw bits of the entry.
bool fetchDescriptor(Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, int queueIndex, Event *event, void(TableWalker::*doDescriptor)())
statistics::Histogram walkServiceTime
void handleResp(TableWalkerState *state, Addr addr, Addr size, Tick delay=0)
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
Addr pfn() const
Return the physical frame, bits shifted right.
void setVirt(Addr vaddr, int size, Request::Flags flags, int requestorId)
BaseMMU::Translation * stage2Tran
A pointer to the stage 2 translation that's in progress.
const PortID InvalidPortID
Addr vaddr_tainted
The virtual address that is being translated.
bool large() const
What is the size of the mapping?
RequestorID requestorId
Cached requestorId of the table walker.
static uint8_t ap(bool rw, bool user)
Return the AP bits as compatible with the AP[2:0] format.
uint8_t physAddrRange() const
Port(TableWalker *_walker, RequestorID id)
gem5::Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool shareable() const
If the section is shareable.
static const unsigned COMPLETED
bool functional
If the atomic mode should be functional.
statistics::Scalar walksShortDescriptor
Addr nextTableAddr() const
Return the address of the next page table.
virtual uint64_t getRawData() const
static const unsigned REQUESTED
uint8_t ap() const
2-bit access protection flags
uint8_t ap() const
Three bit access protection flags.
void setAp0()
Set access flag that this entry has been touched.
Fault testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level)
TableWalkerStats(statistics::Group *parent)
void handleRespPacket(PacketPtr pkt, Tick delay=0)
uint16_t asid
ASID that we're servicing the request under.
bool xnTable() const
Is execution allowed on subsequent lookup levels?
bool haveSecurity
Cached copies of system-level properties.
bool secureTable() const
Whether the subsequent levels of lookup are secure.
DrainState
Object drain/handover states.
bool haveLargeAsid64() const
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
uint64_t data
The raw bits of the entry.
uint8_t sh() const
2-bit shareability field
TlbEntry::DomainType domain() const
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual std::string name() const
void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, BaseMMU::Mode mode)
std::shared_ptr< FaultBase > Fault
void sendFunctionalReq(Addr desc_addr, int size, uint8_t *data, Request::Flags flag)
FaultSource
Generic fault source enums used to index into {short/long/aarch64}DescFaultSources[] to get the actua...
virtual uint64_t getRawData() const
bool dirty() const
This entry needs to be written back to memory.
Fault processWalkAArch64()
static uint8_t pageSizeNtoStatBin(uint8_t N)
bool delayed
Whether the response is delayed in timing mode due to additional lookups.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
EntryType
Type of page table entry ARM DDI 0406B: B3-8.
void doL0LongDescriptorWrapper()
ThreadContext * tc
Thread context that we're doing the walk for.
int physAddrRange
Current physical address range in bits.
bool global(WalkerState *currState) const
Is the translation global (no asid used)?
uint64_t Tick
Tick count type.
Tick startTime
Timestamp for calculating elapsed time in service (for stats)
Addr l2Addr() const
Address of L2 descriptor if it exists.
EntryType type() const
Return the descriptor type.
bool dirty() const
This entry needs to be written back to memory.
virtual std::string dbgHeader() const
std::shared_ptr< Request > RequestPtr
virtual Addr pfn() const =0
EventFunctionWrapper doL2DescEvent
virtual uint8_t offsetBits() const =0
TlbEntry::DomainType domain() const
Domain Client/Manager: ARM DDI 0406B: B3-31.
statistics::Vector pageSizes
bool isFetch
If the access is a fetch (for execution, and no-exec) must be checked?
Port * port
Port shared by the two table walkers.
virtual uint64_t getRawData() const =0
void translateTiming(ThreadContext *tc)
void doL2LongDescriptorWrapper()
void doL1DescriptorWrapper()
RequestPtr req
Request that is currently being serviced.
L2Descriptor()
Default ctor.
void processWalkWrapper()
bool haveVirtualization() const
unsigned numSquashable
The number of walks belonging to squashed instructions that can be removed from the pendingQueue per ...
bool user() const
User/privileged level access protection flag.
BaseMMU::Translation * transState
Translation state for delayed requests.
virtual bool secure(bool have_security, WalkerState *currState) const =0
GrainSize grainSize
Width of the granule size in bits.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
TableWalker * tableWalker
ReqPacketQueue reqQueue
Packet queue used to store outgoing requests.
HTCR htcr
Cached copy of the htcr as it existed when translation began.
bool secure(bool have_security, WalkerState *currState) const
bool isWrite
If the access is a write.
A virtual base opaque structure used to hold state associated with the packet (e.g....
bool checkVAddrSizeFaultAArch64(Addr addr, int top_bit, GrainSize granule, int tsz, bool low_range)
VTCR_t vtcr
Cached copy of the vtcr as it existed when translation began.
Fault generateLongDescFault(ArmFault::FaultSource src)
bool xn() const
Is the translation not allow execution?
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Long-descriptor format (LPAE)
bool contiguousHint() const
Contiguous hint bit.
Addr pfn() const
Return the physical frame, bits shifted right.
Stage2Walk(TableWalker &_parent, uint8_t *_data, Event *_event, Addr vaddr)
statistics::Histogram pendingWalks
statistics::Histogram walkWaitTime
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void markDelayed()
Signal that the translation has been delayed due to a hw page table walk.
LookupLevel lookupLevel
Current lookup level for this descriptor.
virtual bool global(WalkerState *currState) const =0
SnoopRespPacketQueue snoopRespQueue
Packet queue used to store outgoing snoop responses.
bool supersection() const
Is the page a Supersection (16 MiB)?
bool aarch64
True if the current lookup is performed in AArch64 state.
bool af() const
Returns true if the access flag (AF) is set.
virtual uint8_t offsetBits() const
bool stage2Req
Flag indicating if a second stage of lookup is required.
std::list< WalkerState * > stateQueues[MAX_LOOKUP_LEVELS]
Queues of requests for all the different lookup levels.
void sendTimingReq(Addr desc_addr, int size, uint8_t *data, Request::Flags flag, Tick delay, Event *event)
void setPort(Port *_port)
Addr paddr() const
Return the physcal address of the entry, bits in position.
uint8_t rwTable() const
R/W protection flag for subsequent levels of lookup.
unsigned levels
Page entries walked during service (for stats)
EventFunctionWrapper doL3LongDescEvent
TableWalker(const Params &p)
Ports are used to interface objects to each other.
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
bool hpd
Hierarchical access permission disable.
uint8_t offsetBits() const
Return the bit width of the page/block offset.
uint8_t memAttr() const
Memory attributes, only used by stage 2 translations.
bool xn() const
Is execution allowed on this mapping?
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void drainResume() override
Resume execution after a successful drain.
bool _dirty
This entry has been modified (access flag set) and needs to be written back to memory.
void memAttrs(ThreadContext *tc, TlbEntry &te, SCTLR sctlr, uint8_t texcb, bool s)
SCR scr
Cached copy of the scr as it existed when translation began.
MMU * mmu
The MMU to forward second stage look upts to.
void doL2DescriptorWrapper()
uint8_t attrIndx() const
Attribute index.
void memAttrsLPAE(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
bool isUncacheable
True if table walks are uncacheable (for table descriptors)
L2Descriptor(L1Descriptor &parent)
bool dirty() const
This entry needs to be written back to memory.
Addr paddr(Addr va) const
Return complete physical address given a VA.
bool shareable() const
If the section is shareable.
bool checkAddrSizeFaultAArch64(Addr addr, int pa_range)
Returns true if the address exceeds the range permitted by the system-wide setting or by the TCR_ELx ...
uint8_t ap() const
Three bit access protection flags.
virtual std::string dbgHeader() const
EventFunctionWrapper doL2LongDescEvent
void setAp0()
Set access flag that this entry has been touched.
bool invalid() const
Is the entry invalid.
const bool isStage2
Indicates whether this table walker is part of the stage 2 mmu.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
ClockedObjectParams Params
Parameters of ClockedObject.
virtual uint64_t getRawData() const
void doL3LongDescriptorWrapper()
bool secure(bool have_security, WalkerState *currState) const
Returns true if this entry targets the secure physical address map.
gem5::ArmISA::TableWalker::TableWalkerStats stats
virtual uint8_t ap() const =0
void setAf()
Set access flag that this entry has been touched.
HCR hcr
Cached copy of the htcr as it existed when translation began.
Fault readDataUntimed(ThreadContext *tc, Addr vaddr, Addr desc_addr, uint8_t *data, int num_bytes, Request::Flags flags, bool functional)
bool aarch64
If the access is performed in AArch64 state.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
bool timing
If the mode is timing or atomic.
virtual bool shareable() const
Bitfield< 21, 20 > stride
uint8_t userTable() const
User/privileged mode protection flag for subsequent levels of lookup.
virtual TlbEntry::DomainType domain() const =0
Fault fault
The fault that we are going to return.
EventFunctionWrapper doL1LongDescEvent
bool secure(bool have_security, WalkerState *currState) const
Returns true if this entry targets the secure physical address map.
Addr paddr(Addr va) const
Return the physcal address of the entry, bits in position.
TLB * tlb
TLB that is initiating these table walks.
TLB::ArmTranslationType tranType
The translation type that has been requested.
L1Descriptor l1Desc
Short-format descriptors.
statistics::Vector walksShortTerminatedAtLevel
PacketPtr createPacket(Addr desc_addr, int size, uint8_t *data, Request::Flags flag, Tick delay, Event *event)
BaseMMU::Mode mode
Save mode for use in delayed response.
bool pxn() const
Is privileged execution allowed on this mapping? (LPAE only)
#define panic(...)
This implements a cprintf based panic() function.
bool pending
If a timing translation is currently in progress.
void insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
EventFunctionWrapper doL0LongDescEvent
statistics::Scalar squashedBefore
Generated on Tue Sep 21 2021 12:24:46 for gem5 by doxygen 1.8.17