47 #include "debug/Checkpoint.hh" 48 #include "debug/Drain.hh" 49 #include "debug/TLB.hh" 50 #include "debug/TLBVerbose.hh" 58 stage2Mmu(NULL), port(NULL), masterId(
Request::invldMasterId),
59 isStage2(p->is_stage2),
tlb(NULL),
60 currState(NULL), pending(false),
61 numSquashable(p->num_squash_per_cycle),
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");
129 asid(0), vmid(0), isHyp(false), transState(nullptr),
130 vaddr(0), vaddr_tainted(0),
131 sctlr(0), scr(0), cpsr(0), tcr(0),
132 htcr(0), hcr(0), vtcr(0),
133 isWrite(false), isFetch(false), isSecure(false),
134 isUncacheable(false),
135 secureLookup(false), rwTable(false), userTable(false), xnTable(false),
136 pxnTable(false),
hpd(false), stage2Req(false),
137 stage2Tran(nullptr), timing(false), functional(false),
139 delayed(false), tableWalker(nullptr)
151 DPRINTF(Drain,
"TableWalker done draining, processing drain event\n");
159 bool state_queues_not_empty =
false;
163 state_queues_not_empty =
true;
169 DPRINTF(Drain,
"TableWalker not drained\n");
172 DPRINTF(Drain,
"TableWalker free, no need to drain\n");
189 uint8_t _vmid,
bool _isHyp,
TLB::Mode _mode,
194 assert(!(_functional && _timing));
203 DPRINTF(TLBVerbose,
"creating new instance of WalkerState\n");
207 }
else if (_functional) {
211 DPRINTF(TLBVerbose,
"creating functional instance of WalkerState\n");
215 }
else if (_timing) {
224 return std::make_shared<ReExec>();
287 panic(
"Invalid exception level");
312 if (long_desc_format) {
329 else if (long_desc_format)
352 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"),
462 const auto irgn0_mask = 0x1;
463 const auto irgn1_mask = 0x40;
470 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x, bits:%#x\n",
482 return std::make_shared<PrefetchAbort>(
488 return std::make_shared<DataAbort>(
502 return std::make_shared<PrefetchAbort>(
508 return std::make_shared<DataAbort>(
521 DPRINTF(
TLB,
" - Descriptor at address %#x (%s)\n", l1desc_addr,
526 f =
testWalk(l1desc_addr,
sizeof(uint32_t),
564 Addr ttbr, ttbr0_max, ttbr1_min, desc_addr;
568 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x\n",
580 DPRINTF(
TLB,
" - Selecting VTTBR (long-desc.)\n");
586 DPRINTF(
TLB,
" - Selecting HTTBR (long-desc.)\n");
597 ttbr0_max = (1
ULL << 32) -
600 ttbr0_max = (1
ULL << 32) - 1;
613 DPRINTF(
TLB,
" - Selecting TTBR0 (long-desc.)\n");
617 return std::make_shared<PrefetchAbort>(
623 return std::make_shared<DataAbort>(
635 if (ttbr0_max < (1
ULL << 30))
636 start_lookup_level =
L2;
638 DPRINTF(
TLB,
" - Selecting TTBR1 (long-desc.)\n");
642 return std::make_shared<PrefetchAbort>(
648 return std::make_shared<DataAbort>(
661 if (ttbr1_min >= (1
ULL << 31) + (1
ULL << 30))
662 start_lookup_level =
L2;
666 return std::make_shared<PrefetchAbort>(
672 return std::make_shared<DataAbort>(
683 if (start_lookup_level ==
L1) {
685 desc_addr =
mbits(ttbr, 39, n) |
687 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
691 n = (tsz >= 2 ? 14 - tsz : 12);
692 desc_addr =
mbits(ttbr, 39, n) |
694 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
723 sizeof(uint64_t), flag, start_lookup_level,
755 DPRINTF(
TLB,
"Beginning table walk for address %#llx, TCR: %#llx\n",
777 DPRINTF(
TLB,
" - Selecting VTTBR0 (AArch64 stage 2)\n");
792 start_lookup_level = SLL[sl_tg];
794 "Cannot discern lookup level from vtcr.{sl0,tg0}");
800 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
811 DPRINTF(
TLB,
" - Selecting TTBR1 (AArch64)\n");
831 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
841 DPRINTF(
TLB,
" - Selecting TTBR1 (AArch64)\n");
861 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
881 f = std::make_shared<PrefetchAbort>(
886 f = std::make_shared<DataAbort>(
906 warn_once(
"Reserved granule size requested; gem5's IMPLEMENTATION " 907 "DEFINED behavior takes this to mean 4KB granules\n");
922 static const GrainMap GM[] = {
928 const unsigned *lookup = NULL;
930 for (
unsigned i = 0;
i < 3; ++
i) {
931 if (tg == GM[
i].grain_size) {
932 lookup = GM[
i].lookup_level_cutoff;
939 if (tsz > lookup[
L]) {
945 "Table walker couldn't find lookup level\n");
951 int base_addr_lo = 3 + tsz -
stride * (3 - start_lookup_level) - tg;
952 Addr base_addr =
mbits(ttbr, 47, base_addr_lo);
963 DPRINTF(
TLB,
"Address size fault before any lookup\n");
966 f = std::make_shared<PrefetchAbort>(
972 f = std::make_shared<DataAbort>(
994 Addr desc_addr = base_addr |
996 stride * (3 - start_lookup_level) + tg) << 3);
1029 sizeof(uint64_t), flag, start_lookup_level,
1033 sizeof(uint64_t), flag, -1, NULL,
1043 uint8_t texcb,
bool s)
1047 DPRINTF(TLBVerbose,
"memAttrs texcb:%d s:%d\n", texcb, s);
1051 if (sctlr.tre == 0 || ((sctlr.tre == 1) && (sctlr.m == 0))) {
1087 panic(
"Reserved texcb value!\n");
1090 panic(
"Implementation-defined texcb value!\n");
1106 panic(
"Reserved texcb value!\n");
1111 if (
bits(texcb, 1,0) == 0 ||
bits(texcb, 3,2) == 0)
1117 panic(
"More than 32 states for 5 bits?\n");
1125 DPRINTF(TLBVerbose,
"memAttrs PRRR:%08x NMRR:%08x\n", prrr, nmrr);
1126 uint8_t curr_tr = 0, curr_ir = 0, curr_or = 0;
1127 switch(
bits(texcb, 2,0)) {
1165 panic(
"Imp defined type\n");
1176 DPRINTF(TLBVerbose,
"StronglyOrdered\n");
1184 DPRINTF(TLBVerbose,
"Device ds1:%d ds0:%d s:%d\n",
1185 prrr.ds1, prrr.ds0, s);
1196 DPRINTF(TLBVerbose,
"Normal ns1:%d ns0:%d s:%d\n",
1197 prrr.ns1, prrr.ns0, s);
1205 panic(
"Reserved type");
1242 DPRINTF(TLBVerbose,
"memAttrs: shareable: %d, innerAttrs: %d, " 1255 uint8_t
sh = lDescriptor.
sh();
1260 uint8_t attr_3_2 = (attr >> 2) & 0x3;
1261 uint8_t attr_1_0 = attr & 0x3;
1263 DPRINTF(TLBVerbose,
"memAttrsLPAE MemAttr:%#x sh:%#x\n", attr, sh);
1265 if (attr_3_2 == 0) {
1274 attr_3_2 == 2 ? 2 : 1;
1276 attr_1_0 == 2 ? 6 : 5;
1280 uint8_t attrIndx = lDescriptor.
attrIndx();
1288 attr = (mair >> (8 * (attrIndx % 4))) & 0xff;
1289 uint8_t attr_7_4 =
bits(attr, 7, 4);
1290 uint8_t attr_3_0 =
bits(attr, 3, 0);
1291 DPRINTF(TLBVerbose,
"memAttrsLPAE AttrIndx:%#x sh:%#x, attr %#x\n", attrIndx, sh, attr);
1301 if (attr_3_0 == 0x0)
1303 else if (attr_3_0 == 0x4)
1306 panic(
"Unpredictable behavior\n");
1314 if (attr_3_0 == 0x4)
1317 else if (attr_3_0 < 0x8)
1318 panic(
"Unpredictable behavior\n");
1328 if (attr_7_4 & 0x4) {
1335 if (attr_3_0 != 0x4 && attr_3_0 < 0x8)
1336 panic(
"Unpredictable behavior\n");
1339 panic(
"Unpredictable behavior\n");
1363 panic(
"Unpredictable behavior\n");
1369 te.
shareable = (sh & 0x2) ?
true :
false;
1381 uint8_t
sh = lDescriptor.
sh();
1385 uint8_t attr_hi = (attr >> 2) & 0x3;
1386 uint8_t attr_lo = attr & 0x3;
1388 DPRINTF(TLBVerbose,
"memAttrsAArch64 MemAttr:%#x sh:%#x\n", attr, sh);
1399 attr_hi == 2 ? 2 : 1;
1401 attr_lo == 2 ? 6 : 5;
1405 (attr_lo == 1) || (attr_lo == 2);
1408 uint8_t attrIndx = lDescriptor.
attrIndx();
1410 DPRINTF(TLBVerbose,
"memAttrsAArch64 AttrIndx:%#x sh:%#x\n", attrIndx, sh);
1426 panic(
"Invalid exception level");
1431 attr =
bits(mair, 8 * attrIndx + 7, 8 * attrIndx);
1432 attr_lo =
bits(attr, 3, 0);
1433 attr_hi =
bits(attr, 7, 4);
1454 warn_if(!attr_hi,
"Unpredictable behavior");
1483 DPRINTF(
TLB,
"L1 descriptor for %#x is %#x\n",
1496 DPRINTF(
TLB,
"L1 Descriptor Reserved/Ignore, causing fault\n");
1499 std::make_shared<PrefetchAbort>(
1506 std::make_shared<DataAbort>(
1529 panic(
"Haven't implemented supersections\n");
1538 DPRINTF(
TLB,
"L1 descriptor points to page table at: %#x (%s)\n",
1574 panic(
"A new type in a 2 bit field?\n");
1582 return std::make_shared<PrefetchAbort>(
1588 return std::make_shared<DataAbort>(
1608 DPRINTF(
TLB,
"L%d descriptor for %#llx is %#llx (%s)\n",
1615 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, pxn: %d, " 1616 "xn: %d, ap: %d, af: %d, type: %d\n",
1625 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, type: %d\n",
1635 DPRINTF(
TLB,
"L%d descriptor Invalid, causing fault type %d\n",
1656 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1663 DPRINTF(
TLB,
"L%d descriptor causing Access Fault\n",
1693 DPRINTF(
TLB,
"L%d descriptor points to L%d descriptor at: %#x (%s)\n",
1702 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1733 Event *
event = NULL;
1742 panic(
"Wrong lookup level in table walk\n");
1748 sizeof(uint64_t), flag, -1,
event,
1756 panic(
"A new type in a 2 bit field?\n");
1770 DPRINTF(
TLB,
"L2 descriptor for %#x is %#x\n",
1777 DPRINTF(
TLB,
"L2 descriptor invalid, causing fault\n");
1802 DPRINTF(
TLB,
"Generating access fault at L2, afe: %d, ap: %d\n",
1853 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1883 DPRINTF(TLBVerbose,
"calling doL2Descriptor for vaddr:%#x\n",
1894 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1950 DPRINTF(TLBVerbose,
"calling doLongDescriptor for vaddr:%#x\n",
1970 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1985 panic(
"Max. number of lookups already reached in table walk\n");
2009 DPRINTF(TLBVerbose,
"Fetching descriptor at address: 0x%x stage2Req: %d\n",
2025 fault = tran->
fault;
2036 if (queueIndex >= 0) {
2037 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
2043 (this->*doDescriptor)();
2049 if (queueIndex >= 0) {
2050 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
2058 (this->*doDescriptor)();
2061 descAddr, numBytes, flags,
masterId);
2067 (this->*doDescriptor)();
2087 te.
size = (1<<te.
N) - 1;
2088 te.
pfn = descriptor.
pfn();
2093 te.
xn = descriptor.
xn();
2105 if (longDescriptor) {
2114 te.
hap = lDescriptor.
ap();
2124 te.
ap = descriptor.
ap();
2131 DPRINTF(
TLB,
" - N:%d pfn:%#x size:%#x global:%d valid:%d\n",
2133 DPRINTF(
TLB,
" - vpn:%#x xn:%d pxn:%d ap:%d domain:%d asid:%d " 2134 "vmid:%d hyp:%d nc:%d ns:%d\n", te.
vpn, te.
xn, te.
pxn,
2137 DPRINTF(
TLB,
" - domain from L%d desc:%d data:%#x\n",
2150 ArmTableWalkerParams::create()
2158 switch (lookup_level_as_int) {
2166 panic(
"Invalid lookup level conversion");
2212 panic(
"unknown page size");
2224 .
desc(
"Table walker walks requested")
2229 .
desc(
"Table walker walks initiated with short descriptors")
2235 .
desc(
"Table walker walks initiated with long descriptors")
2241 .
name(
name() +
".walksShortTerminationLevel")
2242 .
desc(
"Level at which table walker walks " 2243 "with short descriptors terminate")
2251 .
name(
name() +
".walksLongTerminationLevel")
2252 .
desc(
"Level at which table walker walks " 2253 "with long descriptors terminate")
2262 .
name(
name() +
".walksSquashedBefore")
2263 .
desc(
"Table walks squashed before starting")
2268 .
name(
name() +
".walksSquashedAfter")
2269 .
desc(
"Table walks squashed after completion")
2276 .
desc(
"Table walker wait (enqueue to first request) latency")
2282 .
name(
name() +
".walkCompletionTime")
2283 .
desc(
"Table walker service (enqueue to completion) latency")
2290 .
desc(
"Table walker pending requests distribution")
2297 .
desc(
"Table walker page sizes translated")
2312 .
name(
name() +
".walkRequestOrigin")
2313 .
desc(
"Table walker requests started/completed, data/inst")
#define panic(...)
This implements a cprintf based panic() function.
void regStats() override
Callback to set stat parameters.
const FlagsType pdf
Print the percent of the total that this entry represents.
void memAttrsLPAE(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
Ports are used to interface objects to each other.
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType)
void doL2DescriptorWrapper()
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.
bool isFetch
If the access is a fetch (for execution, and no-exec) must be checked?
LookupLevel lookupLevel
Current lookup level for this descriptor.
#define fatal(...)
This implements a cprintf based fatal() function.
virtual TlbEntry::DomainType domain() const =0
uint32_t data
The raw bits of the entry.
virtual Addr pfn() const =0
bool haveSecurity() const
Returns true if this system implements the Security Extensions.
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.
DmaPort & getDMAPort()
Get the port that ultimately belongs to the stage-two MMU, but is used by the two table walkers...
EventFunctionWrapper doL2LongDescEvent
Bitfield< 21, 20 > stride
EntryType type() const
Return the descriptor type.
std::shared_ptr< Request > RequestPtr
static uint8_t pageSizeNtoStatBin(uint8_t N)
Stats::Vector statWalksShortTerminatedAtLevel
bool secureTable() const
Whether the subsequent levels of lookup are secure.
Fault testWalk(Addr pa, Addr size, TlbEntry::DomainType domain, LookupLevel lookup_level)
bool isWrite
If the access is a write.
TableWalker(const Params *p)
bool invalid() const
Is the entry invalid.
Stats::Histogram statPendingWalks
The request targets the secure memory space.
DrainState drain() override
Notify an object that it needs to drain its state.
virtual uint8_t texcb() const
bool haveSecurity
Cached copies of system-level properties.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Stats::Scalar statWalksShortDescriptor
static ExceptionLevel tranTypeEL(CPSR cpsr, ArmTranslationType type)
Determine the EL to use for the purpose of a translation given a specific translation type...
bool timing
If the mode is timing or atomic.
uint8_t memAttr() const
Memory attributes, only used by stage 2 translations.
uint8_t ap() const
Three bit access protection flags.
bool isUncacheable
True if table walks are uncacheable (for table descriptors)
Stats::Scalar statSquashedBefore
void processWalkWrapper()
Histogram & init(size_type size)
Set the parameters of this histogram.
virtual BaseCPU * getCpuPtr()=0
bool hpd
Hierarchical access permission disable.
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()
Addr purifyTaggedAddr(Addr addr, ThreadContext *tc, ExceptionLevel el, TCR tcr, bool isInstr)
Removes the tag from tagged addresses if that mode is enabled.
uint8_t attrIndx() const
Attribute index.
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...
EventFunctionWrapper doL0LongDescEvent
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)
Addr vaddr
The virtual address that is being translated with tagging removed.
virtual bool secure(bool have_security, WalkerState *currState) const =0
The request is to an uncacheable address.
DrainState
Object drain/handover states.
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 offsetBits() const
Return the bit width of the page/block offset.
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)
DrainState drainState() const
Return the current drain state of an object.
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
EventFunctionWrapper doL1DescEvent
virtual uint8_t offsetBits() const =0
The request is a page table walk.
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
HCR hcr
Cached copy of the htcr as it existed when translation began.
Draining buffers pending serialization/handover.
MasterID masterId
Master id assigned by the MMU.
Tick curTick()
The current simulated tick.
Stats::Vector statWalksLongTerminatedAtLevel
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
void insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
int physAddrRange
Current physical address range in bits.
Fault fault
The fault that we are going to return.
const Params * params() const
T htog(T value, ByteOrder guest_byte_order)
static LookupLevel toLookupLevel(uint8_t lookup_level_as_int)
virtual bool xn() const =0
uint64_t Tick
Tick count type.
virtual bool squashed() const
This function is used by the page table walker to determine if it should translate the a pending requ...
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void setMMU(Stage2MMU *m, MasterID master_id)
ExceptionLevel el
Current exception level.
EventFunctionWrapper doL3LongDescEvent
void doL1LongDescriptorWrapper()
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
bool isSecure
If the access comes from the secure state.
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)
bool supersection() const
Is the page a Supersection (16MB)?
bool xnTable() const
Is execution allowed on subsequent lookup levels?
Event * LongDescEventByLevel[4]
Fault readDataUntimed(ThreadContext *tc, Addr oVAddr, Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, bool isFunctional)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Stats::Histogram statWalkServiceTime
Fault generateLongDescFault(ArmFault::FaultSource src)
void schedule(Event &event, Tick when)
TLB::ArmTranslationType tranType
The translation type that has been requested.
virtual void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
bool functional
If the atomic mode should be functional.
SCTLR sctlr
Cached copy of the sctlr as it existed when translation began.
void doL0LongDescriptorWrapper()
virtual bool global(WalkerState *currState) const =0
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
static unsigned adjustTableSizeAArch64(unsigned tsz)
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual bool shareable() const
#define ULL(N)
uint64_t constant
uint8_t userTable() const
User/privileged mode protection flag for subsequent levels of lookup.
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...
uint8_t ap() const
2-bit access protection flags
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...
Stats::Histogram statWalkWaitTime
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...
void drainResume() override
Resume execution after a successful drain.
bool xn() const
Is execution allowed on this mapping?
virtual uint8_t ap() const =0
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
virtual const std::string name() const
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.
uint64_t data
The raw bits of the entry.
ThreadContext * tc
Thread context that we're doing the walk for.
bool longDescFormatInUse(ThreadContext *tc)
TlbEntry * lookup(Addr vpn, uint16_t asn, uint8_t vmid, bool hyp, bool secure, bool functional, bool ignore_asn, ExceptionLevel target_el)
Lookup an entry in the TLB.
const unsigned MaxPhysAddrRange
uint8_t physAddrRange() const
Returns the supported physical address range in bits.
bool pxn() const
Is privileged execution allowed on this mapping? (LPAE only)
void insert(Addr vaddr, TlbEntry &pte)
static const unsigned COMPLETED
virtual uint64_t getRawData() const =0
EventFunctionWrapper doProcessEvent
Derived & ysubname(off_type index, const std::string &subname)
LongDescriptor longDesc
Long-format descriptor (LPAE and AArch64)
int snsBankedIndex(MiscRegIndex reg, ThreadContext *tc)
void signalDrainDone() const
Signal that an object is drained.
TlbEntry::DomainType domain() const
Domain Client/Manager: ARM DDI 0406B: B3-31.
void doL1DescriptorWrapper()
BaseTLB::Mode mode
Save mode for use in delayed response.
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
L1Descriptor l1Desc
Short-format descriptors.
void nextWalk(ThreadContext *tc)
uint32_t data
The raw bits of the entry.
virtual std::string dbgHeader() const =0
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Addr nextDescAddr(Addr va) const
Return the address of the next descriptor.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
FaultSource
Generic fault source enums used to index into {short/long/aarch64}DescFaultSources[] to get the actua...
uint8_t sh() const
2-bit shareability field
void readDataTimed(ThreadContext *tc, Addr descAddr, Stage2Translation *translation, int numBytes, Request::Flags flags)
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.
virtual void regStats()
Callback to set stat parameters.
bool aarch64
True if the current lookup is performed in AArch64 state.
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.
bool haveLargeAsid64() const
Returns true if ASID is 16 bits in AArch64 (ARMv8)
bool af() const
Returns true if the access flag (AF) is set.
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.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
virtual RegVal readMiscReg(RegIndex misc_reg)=0
uint8_t ap() const
Three bit access protection flags.
const FlagsType dist
Print the distribution.
std::shared_ptr< FaultBase > Fault
EventFunctionWrapper doL1LongDescEvent
Long-descriptor format (LPAE)
bool pxnTable() const
Is privileged execution allowed on subsequent lookup levels?
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
void memAttrsAArch64(ThreadContext *tc, TlbEntry &te, LongDescriptor &lDescriptor)
Addr vaddr_tainted
The virtual address that is being translated.
EventFunctionWrapper doL2DescEvent
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)
uint8_t rwTable() const
R/W protection flag for subsequent levels of lookup.
ProbePointArg< PacketInfo > Packet
Packet probe point.
bool haveLPAE() const
Returns true if this system implements the Large Physical Address Extension.
ByteOrder byteOrder(const ThreadContext *tc)
TLB::Translation * stage2Tran
A pointer to the stage 2 translation that's in progress.
Stats::Vector statPageSizes