50 #include "debug/Checkpoint.hh"
51 #include "debug/Drain.hh"
52 #include "debug/TLB.hh"
53 #include "debug/TLBVerbose.hh"
57 using namespace ArmISA;
61 stage2Mmu(NULL), port(NULL), masterId(
Request::invldMasterId),
62 isStage2(p->is_stage2), tlb(NULL),
63 currState(NULL), pending(false),
64 numSquashable(p->num_squash_per_cycle),
67 doL1DescEvent(this), doL2DescEvent(this),
68 doL0LongDescEvent(this), doL1LongDescEvent(this),
69 doL2LongDescEvent(this), doL3LongDescEvent(this),
87 _haveLargeAsid64 =
false;
110 fatal_if(!
port,
"Table walker must have a valid port\n");
111 fatal_if(!
tlb,
"Table walker must have a valid TLB\n");
117 if (if_name ==
"port") {
121 fatal(
"Cannot access table walker port through stage-two walker\n");
128 tc(nullptr),
aarch64(false),
el(
EL0), physAddrRange(0), req(nullptr),
129 asid(0), vmid(0), isHyp(false), transState(nullptr),
130 vaddr(0), vaddr_tainted(0), isWrite(false), isFetch(false), isSecure(false),
131 secureLookup(false), rwTable(false), userTable(false), xnTable(false),
132 pxnTable(false), stage2Req(false), doingStage2(false),
133 stage2Tran(nullptr), timing(false), functional(false),
135 delayed(false), tableWalker(nullptr)
147 DPRINTF(Drain,
"TableWalker done draining, processing drain event\n");
155 bool state_queues_not_empty =
false;
159 state_queues_not_empty =
true;
165 DPRINTF(Drain,
"TableWalker not drained\n");
168 DPRINTF(Drain,
"TableWalker free, no need to drain\n");
185 uint8_t _vmid,
bool _isHyp,
TLB::Mode _mode,
190 assert(!(_functional && _timing));
199 DPRINTF(TLBVerbose,
"creating new instance of WalkerState\n");
203 }
else if (_functional) {
207 DPRINTF(TLBVerbose,
"creating functional instance of WalkerState\n");
211 }
else if (_timing) {
220 return std::make_shared<ReExec>();
276 panic(
"Invalid exception level");
306 if (long_desc_format) {
323 else if (long_desc_format)
346 else if (long_desc_format)
397 curr_state_copy->
tc, curr_state_copy->
mode);
399 delete curr_state_copy;
407 unsigned num_squashed = 0;
415 DPRINTF(
TLB,
"Squashing table walk for address %#x\n",
421 std::make_shared<UnimpFault>(
"Squashed Inst"),
460 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x, bits:%#x\n",
472 return std::make_shared<PrefetchAbort>(
478 return std::make_shared<DataAbort>(
491 return std::make_shared<PrefetchAbort>(
497 return std::make_shared<DataAbort>(
510 DPRINTF(
TLB,
" - Descriptor at address %#x (%s)\n", l1desc_addr,
515 f =
testWalk(l1desc_addr,
sizeof(uint32_t),
553 Addr ttbr, ttbr0_max, ttbr1_min, desc_addr;
557 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x\n",
569 DPRINTF(
TLB,
" - Selecting VTTBR (long-desc.)\n");
574 DPRINTF(
TLB,
" - Selecting HTTBR (long-desc.)\n");
584 ttbr0_max = (1
ULL << 32) -
587 ttbr0_max = (1
ULL << 32) - 1;
598 DPRINTF(
TLB,
" - Selecting TTBR0 (long-desc.)\n");
602 return std::make_shared<PrefetchAbort>(
608 return std::make_shared<DataAbort>(
619 if (ttbr0_max < (1
ULL << 30))
620 start_lookup_level =
L2;
622 DPRINTF(
TLB,
" - Selecting TTBR1 (long-desc.)\n");
626 return std::make_shared<PrefetchAbort>(
632 return std::make_shared<DataAbort>(
643 if (ttbr1_min >= (1
ULL << 31) + (1
ULL << 30))
644 start_lookup_level =
L2;
648 return std::make_shared<PrefetchAbort>(
654 return std::make_shared<DataAbort>(
664 if (start_lookup_level ==
L1) {
666 desc_addr =
mbits(ttbr, 39, n) |
668 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
672 n = (tsz >= 2 ? 14 - tsz : 12);
673 desc_addr =
mbits(ttbr, 39, n) |
675 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
704 sizeof(uint64_t), flag, start_lookup_level,
736 DPRINTF(
TLB,
"Beginning table walk for address %#llx, TCR: %#llx\n",
739 static const GrainSize GrainMapDefault[] =
741 static const GrainSize GrainMap_EL1_tg1[] =
758 DPRINTF(
TLB,
" - Selecting VTTBR0 (AArch64 stage 2)\n");
773 start_lookup_level = SLL[sl_tg];
775 "Cannot discern lookup level from vtcr.{sl0,tg0}");
778 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
787 DPRINTF(
TLB,
" - Selecting TTBR1 (AArch64)\n");
805 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
824 f = std::make_shared<PrefetchAbort>(
829 f = std::make_shared<DataAbort>(
849 warn_once(
"Reserved granule size requested; gem5's IMPLEMENTATION "
850 "DEFINED behavior takes this to mean 4KB granules\n");
865 static const GrainMap GM[] = {
871 const unsigned *lookup = NULL;
873 for (
unsigned i = 0;
i < 3; ++
i) {
874 if (tg == GM[
i].grain_size) {
875 lookup = GM[
i].lookup_level_cutoff;
882 if (tsz > lookup[
L]) {
888 "Table walker couldn't find lookup level\n");
894 int base_addr_lo = 3 + tsz -
stride * (3 - start_lookup_level) - tg;
895 Addr base_addr =
mbits(ttbr, 47, base_addr_lo);
906 DPRINTF(
TLB,
"Address size fault before any lookup\n");
909 f = std::make_shared<PrefetchAbort>(
915 f = std::make_shared<DataAbort>(
937 Addr desc_addr = base_addr |
939 stride * (3 - start_lookup_level) + tg) << 3);
972 sizeof(uint64_t), flag, start_lookup_level,
976 sizeof(uint64_t), flag, -1, NULL,
986 uint8_t texcb,
bool s)
990 DPRINTF(TLBVerbose,
"memAttrs texcb:%d s:%d\n", texcb, s);
994 if (sctlr.tre == 0 || ((sctlr.tre == 1) && (sctlr.m == 0))) {
1030 panic(
"Reserved texcb value!\n");
1033 panic(
"Implementation-defined texcb value!\n");
1049 panic(
"Reserved texcb value!\n");
1054 if (
bits(texcb, 1,0) == 0 ||
bits(texcb, 3,2) == 0)
1060 panic(
"More than 32 states for 5 bits?\n");
1068 DPRINTF(TLBVerbose,
"memAttrs PRRR:%08x NMRR:%08x\n", prrr, nmrr);
1069 uint8_t curr_tr = 0, curr_ir = 0, curr_or = 0;
1070 switch(
bits(texcb, 2,0)) {
1108 panic(
"Imp defined type\n");
1119 DPRINTF(TLBVerbose,
"StronglyOrdered\n");
1127 DPRINTF(TLBVerbose,
"Device ds1:%d ds0:%d s:%d\n",
1128 prrr.ds1, prrr.ds0, s);
1139 DPRINTF(TLBVerbose,
"Normal ns1:%d ns0:%d s:%d\n",
1140 prrr.ns1, prrr.ns0, s);
1148 panic(
"Reserved type");
1185 DPRINTF(TLBVerbose,
"memAttrs: shareable: %d, innerAttrs: %d, "
1198 uint8_t
sh = lDescriptor.
sh();
1203 uint8_t attr_3_2 = (attr >> 2) & 0x3;
1204 uint8_t attr_1_0 = attr & 0x3;
1206 DPRINTF(TLBVerbose,
"memAttrsLPAE MemAttr:%#x sh:%#x\n", attr, sh);
1208 if (attr_3_2 == 0) {
1217 attr_3_2 == 2 ? 2 : 1;
1219 attr_1_0 == 2 ? 6 : 5;
1223 uint8_t attrIndx = lDescriptor.
attrIndx();
1231 attr = (mair >> (8 * (attrIndx % 4))) & 0xff;
1232 uint8_t attr_7_4 =
bits(attr, 7, 4);
1233 uint8_t attr_3_0 =
bits(attr, 3, 0);
1234 DPRINTF(TLBVerbose,
"memAttrsLPAE AttrIndx:%#x sh:%#x, attr %#x\n", attrIndx, sh, attr);
1244 if (attr_3_0 == 0x0)
1246 else if (attr_3_0 == 0x4)
1249 panic(
"Unpredictable behavior\n");
1257 if (attr_3_0 == 0x4)
1260 else if (attr_3_0 < 0x8)
1261 panic(
"Unpredictable behavior\n");
1271 if (attr_7_4 & 0x4) {
1278 if (attr_3_0 != 0x4 && attr_3_0 < 0x8)
1279 panic(
"Unpredictable behavior\n");
1282 panic(
"Unpredictable behavior\n");
1306 panic(
"Unpredictable behavior\n");
1312 te.
shareable = (sh & 0x2) ?
true :
false;
1324 uint8_t
sh = lDescriptor.
sh();
1328 uint8_t attr_hi = (attr >> 2) & 0x3;
1329 uint8_t attr_lo = attr & 0x3;
1331 DPRINTF(TLBVerbose,
"memAttrsAArch64 MemAttr:%#x sh:%#x\n", attr, sh);
1342 attr_hi == 2 ? 2 : 1;
1344 attr_lo == 2 ? 6 : 5;
1348 (attr_lo == 1) || (attr_lo == 2);
1351 uint8_t attrIndx = lDescriptor.
attrIndx();
1353 DPRINTF(TLBVerbose,
"memAttrsAArch64 AttrIndx:%#x sh:%#x\n", attrIndx, sh);
1369 panic(
"Invalid exception level");
1374 attr =
bits(mair, 8 * attrIndx + 7, 8 * attrIndx);
1375 attr_lo =
bits(attr, 3, 0);
1376 attr_hi =
bits(attr, 7, 4);
1397 warn_if(!attr_hi,
"Unpredictable behavior");
1422 DPRINTF(
TLB,
"L1 descriptor for %#x is %#x\n",
1433 DPRINTF(
TLB,
"L1 Descriptor Reserved/Ignore, causing fault\n");
1436 std::make_shared<PrefetchAbort>(
1443 std::make_shared<DataAbort>(
1466 panic(
"Haven't implemented supersections\n");
1475 DPRINTF(
TLB,
"L1 descriptor points to page table at: %#x (%s)\n",
1506 panic(
"A new type in a 2 bit field?\n");
1517 DPRINTF(
TLB,
"L%d descriptor for %#llx is %#llx (%s)\n",
1524 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, pxn: %d, "
1525 "xn: %d, ap: %d, af: %d, type: %d\n",
1534 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, type: %d\n",
1549 DPRINTF(
TLB,
"L%d descriptor Invalid, causing fault type %d\n",
1578 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1583 DPRINTF(
TLB,
"L%d descriptor causing Access Fault\n",
1626 DPRINTF(
TLB,
"L%d descriptor points to L%d descriptor at: %#x (%s)\n",
1635 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1674 Event *
event = NULL;
1683 panic(
"Wrong lookup level in table walk\n");
1689 sizeof(uint64_t), flag, -1,
event,
1697 panic(
"A new type in a 2 bit field?\n");
1708 DPRINTF(
TLB,
"L2 descriptor for %#x is %#x\n",
1713 DPRINTF(
TLB,
"L2 descriptor invalid, causing fault\n");
1737 DPRINTF(
TLB,
"Generating access fault at L2, afe: %d, ap: %d\n",
1788 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1819 DPRINTF(TLBVerbose,
"calling doL2Descriptor for vaddr:%#x\n",
1833 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1890 DPRINTF(TLBVerbose,
"calling doLongDescriptor for vaddr:%#x\n",
1912 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1929 panic(
"Max. number of lookups already reached in table walk\n");
1953 DPRINTF(TLBVerbose,
"Fetching descriptor at address: 0x%x stage2Req: %d\n",
1970 fault = tran->
fault;
1981 if (queueIndex >= 0) {
1982 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
1988 (this->*doDescriptor)();
1994 if (queueIndex >= 0) {
1995 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
2003 (this->*doDescriptor)();
2010 (this->*doDescriptor)();
2031 te.
size = (1<<te.
N) - 1;
2032 te.
pfn = descriptor.
pfn();
2037 te.
xn = descriptor.
xn();
2049 if (longDescriptor) {
2058 te.
hap = lDescriptor.
ap();
2068 te.
ap = descriptor.
ap();
2075 DPRINTF(
TLB,
" - N:%d pfn:%#x size:%#x global:%d valid:%d\n",
2077 DPRINTF(
TLB,
" - vpn:%#x xn:%d pxn:%d ap:%d domain:%d asid:%d "
2078 "vmid:%d hyp:%d nc:%d ns:%d\n", te.
vpn, te.
xn, te.
pxn,
2081 DPRINTF(
TLB,
" - domain from L%d desc:%d data:%#x\n",
2094 ArmTableWalkerParams::create()
2102 switch (lookup_level_as_int) {
2110 panic(
"Invalid lookup level conversion");
2156 panic(
"unknown page size");
2168 .
desc(
"Table walker walks requested")
2173 .
desc(
"Table walker walks initiated with short descriptors")
2179 .
desc(
"Table walker walks initiated with long descriptors")
2185 .
name(
name() +
".walksShortTerminationLevel")
2186 .
desc(
"Level at which table walker walks "
2187 "with short descriptors terminate")
2195 .
name(
name() +
".walksLongTerminationLevel")
2196 .
desc(
"Level at which table walker walks "
2197 "with long descriptors terminate")
2206 .
name(
name() +
".walksSquashedBefore")
2207 .
desc(
"Table walks squashed before starting")
2212 .
name(
name() +
".walksSquashedAfter")
2213 .
desc(
"Table walks squashed after completion")
2220 .
desc(
"Table walker wait (enqueue to first request) latency")
2226 .
name(
name() +
".walkCompletionTime")
2227 .
desc(
"Table walker service (enqueue to completion) latency")
2234 .
desc(
"Table walker pending requests distribution")
2241 .
desc(
"Table walker page sizes translated")
2256 .
name(
name() +
".walkRequestOrigin")
2257 .
desc(
"Table walker requests started/completed, data/inst")
uint8_t ap() const
Three bit access protection flags.
void regStats() override
Register statistics for this object.
EventWrapper< TableWalker,&TableWalker::doL2LongDescriptorWrapper > doL2LongDescEvent
const FlagsType pdf
Print the percent of the total that this entry represents.
void memAttrsLPAE(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
void doL2DescriptorWrapper()
EntryType type() const
Return the descriptor type.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Derived & init(size_type _x, size_type _y)
decltype(nullptr) constexpr NoFault
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Cycles is a wrapper class for representing cycle counts, i.e.
uint8_t attrIndx() const
Attribute index.
static ExceptionLevel currEL(ThreadContext *tc)
bool isFetch
If the access is a fetch (for execution, and no-exec) must be checked?
LookupLevel lookupLevel
Current lookup level for this descriptor.
bool doingStage2
Indicates whether the translation has been passed onto the second stage mmu, and no more work is requ...
virtual TlbEntry::DomainType domain() const =0
EventWrapper< TableWalker,&TableWalker::processWalkWrapper > doProcessEvent
uint32_t data
The raw bits of the entry.
virtual Addr pfn() const =0
DrainState
Object drain/handover states.
void doL3LongDescriptorWrapper()
unsigned numSquashable
The number of walks belonging to squashed instructions that can be removed from the pendingQueue per ...
Addr l2Addr() const
Address of L2 descriptor if it exists.
std::list< WalkerState * > stateQueues[MAX_LOOKUP_LEVELS]
Queues of requests for all the different lookup levels.
const FlagsType nonan
Don't print if this is NAN.
TableWalker * tableWalker
GrainSize grainSize
Width of the granule size in bits.
bool pending
If a timing translation is currently in progress.
Bitfield< 21, 20 > stride
static uint8_t pageSizeNtoStatBin(uint8_t N)
Stats::Vector statWalksShortTerminatedAtLevel
Fault testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level)
bool isWrite
If the access is a write.
TableWalker(const Params *p)
panic_if(!root,"Invalid expression\n")
Stats::Histogram statPendingWalks
DrainState drain() override
Notify an object that it needs to drain its state.
DmaPort & getPort()
Get the port that ultimately belongs to the stage-two MMU, but is used by the two table walkers...
bool haveSecurity
Cached copies of system-level properties.
bool af() const
Returns true if the access flag (AF) is set.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Stats::Scalar statWalksShortDescriptor
bool timing
If the mode is timing or atomic.
Stats::Scalar statSquashedBefore
void processWalkWrapper()
Histogram & init(size_type size)
Set the parameters of this histogram.
virtual BaseCPU * getCpuPtr()=0
uint8_t offsetBits() const
Return the bit width of the page/block offset.
uint8_t physAddrRange() const
Returns the supported physical address range in bits.
bool stage2Req
Flag indicating if a second stage of lookup is required.
TLB::Translation * transState
Translation state for delayed requests.
HTCR htcr
Cached copy of the htcr as it existed when translation began.
void doL2LongDescriptorWrapper()
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Addr vaddr
The virtual address that is being translated with tagging removed.
virtual bool secure(bool have_security, WalkerState *currState) const =0
Derived & init(size_type size)
Set this vector to have the given size.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
DmaPort * port
Port shared by the two table walkers.
uint8_t memAttr() const
Memory attributes, only used by stage 2 translations.
Fault testWalk(Addr pa, Addr size, Addr va, bool is_secure, Mode mode, TlbEntry::DomainType domain, LookupLevel lookup_level)
void memAttrs(ThreadContext *tc, TlbEntry &te, SCTLR sctlr, uint8_t texcb, bool s)
bool xnTable() const
Is execution allowed on subsequent lookup levels?
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
bool xn() const
Is execution allowed on this mapping?
virtual uint8_t offsetBits() const =0
uint8_t ap() const
Three bit access protection flags.
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
EventWrapper< TableWalker,&TableWalker::doL1DescriptorWrapper > doL1DescEvent
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...
HCR hcr
Cached copy of the htcr as it existed when translation began.
static OperatingMode currOpMode(ThreadContext *tc)
MasterID masterId
Master id assigned by the MMU.
Tick curTick()
The current simulated tick.
Stats::Vector statWalksLongTerminatedAtLevel
bool haveLPAE() const
Returns true if this system implements the Large Physical Address Extension.
void insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
int physAddrRange
Current physical address range in bits.
Fault fault
The fault that we are going to return.
bool invalid() const
Is the entry invalid.
The request is a page table walk.
static LookupLevel toLookupLevel(uint8_t lookup_level_as_int)
virtual bool xn() const =0
bool supersection() const
Is the page a Supersection (16MB)?
uint64_t Tick
Tick count type.
Fault translateTiming(RequestPtr req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType=NormalTran)
bool pxn() const
Is privileged execution allowed on this mapping? (LPAE only)
void setMMU(Stage2MMU *m, MasterID master_id)
The request is to an uncacheable address.
ExceptionLevel el
Current exception level.
Fault readDataTimed(ThreadContext *tc, Addr descAddr, Stage2Translation *translation, int numBytes, Request::Flags flags)
void doL1LongDescriptorWrapper()
bool isSecure
If the access comes from the secure state.
virtual uint8_t texcb() const
bool fetchDescriptor(Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, int queueIndex, Event *event, void(TableWalker::*doDescriptor)())
void doLongDescriptorWrapper(LookupLevel curr_lookup_level)
Event * LongDescEventByLevel[4]
Fault readDataUntimed(ThreadContext *tc, Addr oVAddr, Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, bool isFunctional)
Stats::Histogram statWalkServiceTime
TLB::ArmTranslationType tranType
The translation type that has been requested.
bool functional
If the atomic mode should be functional.
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
TlbEntry * lookup(Addr vpn, uint16_t asn, uint8_t vmid, bool hyp, bool secure, bool functional, bool ignore_asn, uint8_t target_el)
Lookup an entry in the TLB.
void doL0LongDescriptorWrapper()
virtual bool global(WalkerState *currState) const =0
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Addr nextDescAddr(Addr va) const
Return the address of the next descriptor.
bool haveSecurity() const
Returns true if this system implements the Security Extensions.
static unsigned adjustTableSizeAArch64(unsigned tsz)
uint8_t sh() const
2-bit shareability field
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint8_t userTable() const
User/privileged mode protection flag for subsequent levels of lookup.
Draining buffers pending serialization/handover.
TlbEntry::DomainType domain() const
Domain Client/Manager: ARM DDI 0406B: B3-31.
#define ULL(N)
uint64_t constant
uint8_t rwTable() const
R/W protection flag for subsequent levels of lookup.
bool pxnTable() const
Is privileged execution allowed on subsequent lookup levels?
void completeDrain()
Checks if all state is cleared and if so, completes drain.
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Stats::Histogram statWalkWaitTime
const Params * params() const
Stats::Scalar statSquashedAfter
static const unsigned REQUESTED
const FlagsType total
Print the total.
TLB * tlb
TLB that is initiating these table walks.
RequestPtr dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag=0)
This translation class is used to trigger the data fetch once a timing translation returns the transl...
virtual MiscReg readMiscReg(int misc_reg)=0
void drainResume() override
Resume execution after a successful drain.
virtual uint8_t ap() const =0
EventWrapper< TableWalker,&TableWalker::doL3LongDescriptorWrapper > doL3LongDescEvent
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
std::list< WalkerState * > pendingQueue
Queue of requests that have passed are waiting because the walker is currently busy.
Tick startTime
Timestamp for calculating elapsed time in service (for stats)
Stats::Scalar statWalks
Statistics.
virtual const std::string name() const
uint64_t data
The raw bits of the entry.
ThreadContext * tc
Thread context that we're doing the walk for.
bool longDescFormatInUse(ThreadContext *tc)
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
const unsigned MaxPhysAddrRange
void insert(Addr vaddr, TlbEntry &pte)
static const unsigned COMPLETED
virtual uint64_t getRawData() const =0
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)
EventWrapper< TableWalker,&TableWalker::doL0LongDescriptorWrapper > doL0LongDescEvent
Derived & ysubname(off_type index, const std::string &subname)
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
LongDescriptor longDesc
Long-format descriptor (LPAE and AArch64)
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
void signalDrainDone() const
Signal that an object is drained.
void doL1DescriptorWrapper()
BaseTLB::Mode mode
Save mode for use in delayed response.
void schedule(Event &event, Tick when)
uint16_t asid
ASID that we're servicing the request under.
Stats::Scalar statWalksLongDescriptor
VTCR_t vtcr
Cached copy of the vtcr as it existed when translation began.
Stats::Vector2d statRequestOrigin
DrainState drainState() const
Return the current drain state of an object.
EventWrapper< TableWalker,&TableWalker::doL1LongDescriptorWrapper > doL1LongDescEvent
The request targets the secure memory space.
virtual bool shareable() const
L1Descriptor l1Desc
Short-format descriptors.
void nextWalk(ThreadContext *tc)
uint32_t data
The raw bits of the entry.
virtual std::string dbgHeader() const =0
bool secureTable() const
Whether the subsequent levels of lookup are secure.
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TTBCR tcr)
Removes the tag from tagged addresses if that mode is enabled.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
EventWrapper< TableWalker,&TableWalker::doL2DescriptorWrapper > doL2DescEvent
bool secureLookup
Helper variables used to implement hierarchical access permissions when the long-desc.
Stage2MMU * stage2Mmu
The MMU to forward second stage look upts to.
bool aarch64
True if the current lookup is performed in AArch64 state.
int flattenMiscRegNsBanked(MiscRegIndex reg, ThreadContext *tc)
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
bool aarch64
If the access is performed in AArch64 state.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
Fault processWalkAArch64()
ArmTableWalkerParams Params
const bool isStage2
Indicates whether this table walker is part of the stage 2 mmu.
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 ...
const FlagsType nozero
Don't print if this is zero.
const FlagsType dist
Print the distribution.
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
virtual void finish(const Fault &fault, RequestPtr req, ThreadContext *tc, Mode mode)=0
virtual bool squashed() const
This function is used by the page table walker to determine if it should translate the a pending requ...
std::shared_ptr< FaultBase > Fault
Long-descriptor format (LPAE)
void regStats() override
Register statistics for this object.
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
uint8_t ap() const
2-bit access protection flags
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
void memAttrsAArch64(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a master port with a given name and index.
Addr vaddr_tainted
The virtual address that is being translated.
RequestPtr req
Request that is currently being serviced.
bool delayed
Whether the response is delayed in timing mode due to additional lookups.
void setAttributes(bool lpae)
void sendFunctional(PacketPtr pkt)
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
ProbePointArg< PacketInfo > Packet
Packet probe point.
TLB::Translation * stage2Tran
A pointer to the stage 2 translation that's in progress.
Stats::Vector statPageSizes