Go to the documentation of this file.
38 #ifndef __ARCH_ARM_TABLE_WALKER_HH__
39 #define __ARCH_ARM_TABLE_WALKER_HH__
53 #include "params/ArmTableWalker.hh"
83 virtual bool xn()
const = 0;
84 virtual uint8_t
ap()
const = 0;
88 virtual std::string
dbgHeader()
const = 0;
92 panic(
"texcb() not implemented for this class\n");
96 panic(
"shareable() not implemented for this class\n");
134 return "Inserting Section Descriptor into TLB\n";
161 panic(
"Super sections not implemented\n");
170 panic(
"Super sections not implemented\n");
179 panic(
"Super sections not implemented\n");
303 return "Inserting L2 Descriptor into TLB\n";
321 return large() ? 16 : 12;
456 return "Inserting Page descriptor into TLB\n";
459 return "Inserting Block descriptor into TLB\n";
461 return "Inserting Table descriptor into TLB\n";
463 panic(
"Trying to insert and invalid descriptor\n");
475 return have_security &&
538 panic(
"Invalid AArch64 VM granule size\n");
547 panic(
"Invalid AArch64 VM granule size\n");
553 panic(
"AArch64 page table entry must be block or page\n");
584 Addr table_address = 0;
589 table_address |=
bits(
data, 15, 12) << 48;
594 return table_address;
606 int va_hi = va_lo +
stride - 1;
707 return ((!
rw) << 2) | (
user << 1);
1016 Stage2Walk *translation,
int num_bytes,
1105 bool timing,
bool functional,
bool secure,
1113 uint8_t texcb,
bool s);
1115 LongDescriptor &lDescriptor);
1117 LongDescriptor &lDescriptor);
1166 GrainSize granule,
int tsz,
bool low_range);
1189 #endif //__ARCH_ARM_TABLE_WALKER_HH__
This is a simple scalar statistic, like a counter.
EventFunctionWrapper doL1DescEvent
Fault testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level, bool stage2)
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)
enums::ArmLookupLevel LookupLevel
L1Descriptor()
Default ctor.
bool secure(bool have_security, WalkerState *currState) const override
Returns true if this entry targets the secure physical address map.
Addr pfn() const override
Return the physical frame, bits shifted right.
bool isSecure
If the access comes from the secure state.
Event * LongDescEventByLevel[4]
statistics::Scalar walksLongDescriptor
TlbEntry walkEntry
Initial walk entry allowing to skip lookup levels.
bool pxnTable() const
Is privileged execution allowed on subsequent lookup levels?
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
ExceptionLevel el
Current exception level.
void sendAtomicReq(Addr desc_addr, int size, uint8_t *data, Request::Flags flag, Tick delay)
uint8_t ap() const override
Three bit access protection flags.
LongDescriptor longDesc
Long-format descriptor (LPAE and AArch64)
EventFunctionWrapper doProcessEvent
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()
std::list< WalkerState * > pendingQueue
Queue of requests that have passed are waiting because the walker is currently busy.
const ArmRelease * release
Cached copies of system-level properties.
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 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,...
const PageTableOps * getPageTableOps(GrainSize trans_granule)
Addr paddr() const
Return the physical address of the entry.
CPSR cpsr
Cached copy of the cpsr as it existed when translation began.
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
bool secure(bool have_security, WalkerState *currState) const override
Returns true if this entry targets the secure physical address map.
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.
uint8_t offsetBits() const override
statistics::Scalar squashedAfter
uint8_t offsetBits() const override
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.
Addr pfn() const override
Return the physical frame, bits shifted right.
bool fetchDescriptor(Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, int queueIndex, Event *event, void(TableWalker::*doDescriptor)())
uint8_t ap() const override
2-bit access protection flags
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.
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.
Fault walk(const RequestPtr &req, ThreadContext *tc, uint16_t asid, vmid_t _vmid, bool hyp, BaseMMU::Mode mode, BaseMMU::Translation *_trans, bool timing, bool functional, bool secure, MMU::ArmTranslationType tran_type, bool stage2, const TlbEntry *walk_entry)
bool shareable() const override
If the section is shareable.
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.
MMU::ArmTranslationType tranType
The translation type that has been requested.
static uint8_t ap(bool rw, bool user)
Return the AP bits as compatible with the AP[2:0] format.
uint8_t physAddrRange() const
bool global(WalkerState *currState) const override
Is the translation global (no asid used)?
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.
uint8_t ap() const override
Three bit access protection flags.
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.
static const unsigned REQUESTED
void setAp0()
Set access flag that this entry has been touched.
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 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.
std::tuple< Addr, Addr, LookupLevel > walkAddresses(Addr ttbr, GrainSize tg, int tsz, int pa_range)
Returns a tuple made of: 1) The address of the first page table 2) The address of the first descripto...
uint8_t sh() const
2-bit shareability field
uint64_t getRawData() const override
ThreadContext is the external interface to all thread state for anything outside of the CPU.
uint8_t texcb() const override
Memory region attributes: ARM DDI 0406B: B3-32.
virtual std::string name() const
Addr pfn() const override
Return the physical frame, bits shifted right.
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...
bool shareable() const override
If the section is shareable.
bool dirty() const
This entry needs to be written back to memory.
TlbEntry::DomainType domain() const override
Domain Client/Manager: ARM DDI 0406B: B3-31.
Fault processWalkAArch64()
static uint8_t pageSizeNtoStatBin(uint8_t N)
bool delayed
Whether the response is delayed in timing mode due to additional lookups.
std::list< WalkerState * > stateQueues[LookupLevel::Num_ArmLookupLevel]
Queues of requests for all the different lookup levels.
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.
uint64_t getRawData() const override
int physAddrRange
Current physical address range in bits.
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.
std::shared_ptr< Request > RequestPtr
virtual Addr pfn() const =0
bool secure(bool have_security, WalkerState *currState) const override
void insertPartialTableEntry(LongDescriptor &descriptor)
EventFunctionWrapper doL2DescEvent
virtual uint8_t offsetBits() const =0
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)
bool global(WalkerState *currState) const override
Is the translation global (no asid used)?
void doL2LongDescriptorWrapper()
void doL1DescriptorWrapper()
RequestPtr req
Request that is currently being serviced.
L2Descriptor()
Default ctor.
void processWalkWrapper()
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
MMU::ArmTranslationType tranType
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.
uint64_t getRawData() const override
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)
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.
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.
bool xn() const override
Is the translation not allow execution?
bool stage2Req
Flag indicating if a second stage of lookup is required.
void sendTimingReq(Addr desc_addr, int size, uint8_t *data, Request::Flags flag, Tick delay, Event *event)
Fault readDataUntimed(ThreadContext *tc, Addr vaddr, Addr desc_addr, uint8_t *data, int num_bytes, Request::Flags flags, BaseMMU::Mode mode, MMU::ArmTranslationType tran_type, bool functional)
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.
TlbEntry::DomainType domain() const override
bool hpd
Hierarchical access permission disable.
uint8_t memAttr() const
Memory attributes, only used by stage 2 translations.
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.
TlbEntry::DomainType domain() const override
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()
std::string dbgHeader() const override
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.
uint8_t offsetBits() const override
Return the bit width of the page/block offset.
std::string dbgHeader() const override
bool xn() const override
Is execution allowed on this mapping?
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 ...
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.
void doL3LongDescriptorWrapper()
gem5::ArmISA::TableWalker::TableWalkerStats stats
std::string dbgHeader() const override
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.
bool aarch64
If the access is performed in AArch64 state.
static LookupLevel toLookupLevel(uint8_t lookup_level_as_int)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
bool timing
If the mode is timing or atomic.
bool global(WalkerState *currState) const override
Is the translation global (no asid used)?
virtual bool shareable() const
Bitfield< 21, 20 > stride
uint8_t texcb() const override
Memory region attributes: ARM DDI 0406B: B3-32.
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.
bool xn() const override
Is execution allowed on this mapping?
EventFunctionWrapper doL1LongDescEvent
Addr paddr(Addr va) const
Return the physcal address of the entry, bits in position.
TLB * tlb
TLB that is initiating these table walks.
L1Descriptor l1Desc
Short-format descriptors.
Stage2Walk(TableWalker &_parent, uint8_t *_data, Event *_event, Addr vaddr, BaseMMU::Mode mode, MMU::ArmTranslationType tran_type)
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 Dec 21 2021 11:34:22 for gem5 by doxygen 1.8.17