50 #include "debug/Checkpoint.hh" 51 #include "debug/Drain.hh" 52 #include "debug/TLB.hh" 53 #include "debug/TLBVerbose.hh" 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),
113 fatal_if(!
port,
"Table walker must have a valid port\n");
114 fatal_if(!
tlb,
"Table walker must have a valid TLB\n");
120 if (if_name ==
"port") {
124 fatal(
"Cannot access table walker port through stage-two walker\n");
132 asid(0), vmid(0), isHyp(false), transState(nullptr),
133 vaddr(0), vaddr_tainted(0),
134 sctlr(0), scr(0), cpsr(0), tcr(0),
135 htcr(0), hcr(0), vtcr(0),
136 isWrite(false), isFetch(false), isSecure(false),
137 isUncacheable(false),
138 secureLookup(false), rwTable(false), userTable(false), xnTable(false),
139 pxnTable(false),
hpd(false), stage2Req(false),
140 stage2Tran(nullptr), timing(false), functional(false),
142 delayed(false), tableWalker(nullptr)
154 DPRINTF(Drain,
"TableWalker done draining, processing drain event\n");
162 bool state_queues_not_empty =
false;
166 state_queues_not_empty =
true;
172 DPRINTF(Drain,
"TableWalker not drained\n");
175 DPRINTF(Drain,
"TableWalker free, no need to drain\n");
192 uint8_t _vmid,
bool _isHyp,
TLB::Mode _mode,
197 assert(!(_functional && _timing));
206 DPRINTF(TLBVerbose,
"creating new instance of WalkerState\n");
210 }
else if (_functional) {
214 DPRINTF(TLBVerbose,
"creating functional instance of WalkerState\n");
218 }
else if (_timing) {
227 return std::make_shared<ReExec>();
290 panic(
"Invalid exception level");
315 if (long_desc_format) {
332 else if (long_desc_format)
355 else if (long_desc_format)
400 curr_state_copy->
tc, curr_state_copy->
mode);
402 delete curr_state_copy;
410 unsigned num_squashed = 0;
418 DPRINTF(
TLB,
"Squashing table walk for address %#x\n",
424 std::make_shared<UnimpFault>(
"Squashed Inst"),
465 const auto irgn0_mask = 0x1;
466 const auto irgn1_mask = 0x40;
473 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x, bits:%#x\n",
485 return std::make_shared<PrefetchAbort>(
491 return std::make_shared<DataAbort>(
505 return std::make_shared<PrefetchAbort>(
511 return std::make_shared<DataAbort>(
524 DPRINTF(
TLB,
" - Descriptor at address %#x (%s)\n", l1desc_addr,
529 f =
testWalk(l1desc_addr,
sizeof(uint32_t),
567 Addr ttbr, ttbr0_max, ttbr1_min, desc_addr;
571 DPRINTF(
TLB,
"Beginning table walk for address %#x, TTBCR: %#x\n",
583 DPRINTF(
TLB,
" - Selecting VTTBR (long-desc.)\n");
589 DPRINTF(
TLB,
" - Selecting HTTBR (long-desc.)\n");
600 ttbr0_max = (1
ULL << 32) -
603 ttbr0_max = (1
ULL << 32) - 1;
616 DPRINTF(
TLB,
" - Selecting TTBR0 (long-desc.)\n");
620 return std::make_shared<PrefetchAbort>(
626 return std::make_shared<DataAbort>(
638 if (ttbr0_max < (1
ULL << 30))
639 start_lookup_level =
L2;
641 DPRINTF(
TLB,
" - Selecting TTBR1 (long-desc.)\n");
645 return std::make_shared<PrefetchAbort>(
651 return std::make_shared<DataAbort>(
664 if (ttbr1_min >= (1
ULL << 31) + (1
ULL << 30))
665 start_lookup_level =
L2;
669 return std::make_shared<PrefetchAbort>(
675 return std::make_shared<DataAbort>(
686 if (start_lookup_level ==
L1) {
688 desc_addr =
mbits(ttbr, 39, n) |
690 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
694 n = (tsz >= 2 ? 14 - tsz : 12);
695 desc_addr =
mbits(ttbr, 39, n) |
697 DPRINTF(
TLB,
" - Descriptor at address %#x (%s) (long-desc.)\n",
726 sizeof(uint64_t), flag, start_lookup_level,
758 DPRINTF(
TLB,
"Beginning table walk for address %#llx, TCR: %#llx\n",
780 DPRINTF(
TLB,
" - Selecting VTTBR0 (AArch64 stage 2)\n");
795 start_lookup_level = SLL[sl_tg];
797 "Cannot discern lookup level from vtcr.{sl0,tg0}");
803 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
814 DPRINTF(
TLB,
" - Selecting TTBR1 (AArch64)\n");
834 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
844 DPRINTF(
TLB,
" - Selecting TTBR1 (AArch64)\n");
864 DPRINTF(
TLB,
" - Selecting TTBR0 (AArch64)\n");
884 f = std::make_shared<PrefetchAbort>(
889 f = std::make_shared<DataAbort>(
909 warn_once(
"Reserved granule size requested; gem5's IMPLEMENTATION " 910 "DEFINED behavior takes this to mean 4KB granules\n");
925 static const GrainMap GM[] = {
931 const unsigned *lookup = NULL;
933 for (
unsigned i = 0;
i < 3; ++
i) {
934 if (tg == GM[
i].grain_size) {
935 lookup = GM[
i].lookup_level_cutoff;
942 if (tsz > lookup[
L]) {
948 "Table walker couldn't find lookup level\n");
954 int base_addr_lo = 3 + tsz -
stride * (3 - start_lookup_level) - tg;
955 Addr base_addr =
mbits(ttbr, 47, base_addr_lo);
966 DPRINTF(
TLB,
"Address size fault before any lookup\n");
969 f = std::make_shared<PrefetchAbort>(
975 f = std::make_shared<DataAbort>(
997 Addr desc_addr = base_addr |
999 stride * (3 - start_lookup_level) + tg) << 3);
1032 sizeof(uint64_t), flag, start_lookup_level,
1036 sizeof(uint64_t), flag, -1, NULL,
1046 uint8_t texcb,
bool s)
1050 DPRINTF(TLBVerbose,
"memAttrs texcb:%d s:%d\n", texcb, s);
1054 if (sctlr.tre == 0 || ((sctlr.tre == 1) && (sctlr.m == 0))) {
1090 panic(
"Reserved texcb value!\n");
1093 panic(
"Implementation-defined texcb value!\n");
1109 panic(
"Reserved texcb value!\n");
1114 if (
bits(texcb, 1,0) == 0 ||
bits(texcb, 3,2) == 0)
1120 panic(
"More than 32 states for 5 bits?\n");
1128 DPRINTF(TLBVerbose,
"memAttrs PRRR:%08x NMRR:%08x\n", prrr, nmrr);
1129 uint8_t curr_tr = 0, curr_ir = 0, curr_or = 0;
1130 switch(
bits(texcb, 2,0)) {
1168 panic(
"Imp defined type\n");
1179 DPRINTF(TLBVerbose,
"StronglyOrdered\n");
1187 DPRINTF(TLBVerbose,
"Device ds1:%d ds0:%d s:%d\n",
1188 prrr.ds1, prrr.ds0, s);
1199 DPRINTF(TLBVerbose,
"Normal ns1:%d ns0:%d s:%d\n",
1200 prrr.ns1, prrr.ns0, s);
1208 panic(
"Reserved type");
1245 DPRINTF(TLBVerbose,
"memAttrs: shareable: %d, innerAttrs: %d, " 1258 uint8_t
sh = lDescriptor.
sh();
1263 uint8_t attr_3_2 = (attr >> 2) & 0x3;
1264 uint8_t attr_1_0 = attr & 0x3;
1266 DPRINTF(TLBVerbose,
"memAttrsLPAE MemAttr:%#x sh:%#x\n", attr, sh);
1268 if (attr_3_2 == 0) {
1277 attr_3_2 == 2 ? 2 : 1;
1279 attr_1_0 == 2 ? 6 : 5;
1283 uint8_t attrIndx = lDescriptor.
attrIndx();
1291 attr = (mair >> (8 * (attrIndx % 4))) & 0xff;
1292 uint8_t attr_7_4 =
bits(attr, 7, 4);
1293 uint8_t attr_3_0 =
bits(attr, 3, 0);
1294 DPRINTF(TLBVerbose,
"memAttrsLPAE AttrIndx:%#x sh:%#x, attr %#x\n", attrIndx, sh, attr);
1304 if (attr_3_0 == 0x0)
1306 else if (attr_3_0 == 0x4)
1309 panic(
"Unpredictable behavior\n");
1317 if (attr_3_0 == 0x4)
1320 else if (attr_3_0 < 0x8)
1321 panic(
"Unpredictable behavior\n");
1331 if (attr_7_4 & 0x4) {
1338 if (attr_3_0 != 0x4 && attr_3_0 < 0x8)
1339 panic(
"Unpredictable behavior\n");
1342 panic(
"Unpredictable behavior\n");
1366 panic(
"Unpredictable behavior\n");
1372 te.
shareable = (sh & 0x2) ?
true :
false;
1384 uint8_t
sh = lDescriptor.
sh();
1388 uint8_t attr_hi = (attr >> 2) & 0x3;
1389 uint8_t attr_lo = attr & 0x3;
1391 DPRINTF(TLBVerbose,
"memAttrsAArch64 MemAttr:%#x sh:%#x\n", attr, sh);
1402 attr_hi == 2 ? 2 : 1;
1404 attr_lo == 2 ? 6 : 5;
1408 (attr_lo == 1) || (attr_lo == 2);
1411 uint8_t attrIndx = lDescriptor.
attrIndx();
1413 DPRINTF(TLBVerbose,
"memAttrsAArch64 AttrIndx:%#x sh:%#x\n", attrIndx, sh);
1429 panic(
"Invalid exception level");
1434 attr =
bits(mair, 8 * attrIndx + 7, 8 * attrIndx);
1435 attr_lo =
bits(attr, 3, 0);
1436 attr_hi =
bits(attr, 7, 4);
1457 warn_if(!attr_hi,
"Unpredictable behavior");
1486 DPRINTF(
TLB,
"L1 descriptor for %#x is %#x\n",
1499 DPRINTF(
TLB,
"L1 Descriptor Reserved/Ignore, causing fault\n");
1502 std::make_shared<PrefetchAbort>(
1509 std::make_shared<DataAbort>(
1532 panic(
"Haven't implemented supersections\n");
1541 DPRINTF(
TLB,
"L1 descriptor points to page table at: %#x (%s)\n",
1577 panic(
"A new type in a 2 bit field?\n");
1585 return std::make_shared<PrefetchAbort>(
1591 return std::make_shared<DataAbort>(
1611 DPRINTF(
TLB,
"L%d descriptor for %#llx is %#llx (%s)\n",
1618 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, pxn: %d, " 1619 "xn: %d, ap: %d, af: %d, type: %d\n",
1628 DPRINTF(TLBVerbose,
"Analyzing L%d descriptor: %#llx, type: %d\n",
1638 DPRINTF(
TLB,
"L%d descriptor Invalid, causing fault type %d\n",
1659 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1666 DPRINTF(
TLB,
"L%d descriptor causing Access Fault\n",
1696 DPRINTF(
TLB,
"L%d descriptor points to L%d descriptor at: %#x (%s)\n",
1705 DPRINTF(
TLB,
"L%d descriptor causing Address Size Fault\n",
1736 Event *
event = NULL;
1745 panic(
"Wrong lookup level in table walk\n");
1751 sizeof(uint64_t), flag, -1,
event,
1759 panic(
"A new type in a 2 bit field?\n");
1773 DPRINTF(
TLB,
"L2 descriptor for %#x is %#x\n",
1780 DPRINTF(
TLB,
"L2 descriptor invalid, causing fault\n");
1805 DPRINTF(
TLB,
"Generating access fault at L2, afe: %d, ap: %d\n",
1856 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1886 DPRINTF(TLBVerbose,
"calling doL2Descriptor for vaddr:%#x\n",
1897 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1953 DPRINTF(TLBVerbose,
"calling doLongDescriptor for vaddr:%#x\n",
1973 DPRINTF(TLBVerbose,
"calling translateTiming again\n");
1988 panic(
"Max. number of lookups already reached in table walk\n");
2012 DPRINTF(TLBVerbose,
"Fetching descriptor at address: 0x%x stage2Req: %d\n",
2029 fault = tran->
fault;
2040 if (queueIndex >= 0) {
2041 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
2047 (this->*doDescriptor)();
2053 if (queueIndex >= 0) {
2054 DPRINTF(TLBVerbose,
"Adding to walker fifo: queue size before adding: %d\n",
2062 (this->*doDescriptor)();
2065 descAddr, numBytes, flags,
masterId);
2071 (this->*doDescriptor)();
2091 te.
size = (1<<te.
N) - 1;
2092 te.
pfn = descriptor.
pfn();
2097 te.
xn = descriptor.
xn();
2109 if (longDescriptor) {
2118 te.
hap = lDescriptor.
ap();
2128 te.
ap = descriptor.
ap();
2135 DPRINTF(
TLB,
" - N:%d pfn:%#x size:%#x global:%d valid:%d\n",
2137 DPRINTF(
TLB,
" - vpn:%#x xn:%d pxn:%d ap:%d domain:%d asid:%d " 2138 "vmid:%d hyp:%d nc:%d ns:%d\n", te.
vpn, te.
xn, te.
pxn,
2141 DPRINTF(
TLB,
" - domain from L%d desc:%d data:%#x\n",
2154 ArmTableWalkerParams::create()
2162 switch (lookup_level_as_int) {
2170 panic(
"Invalid lookup level conversion");
2216 panic(
"unknown page size");
2228 .
desc(
"Table walker walks requested")
2233 .
desc(
"Table walker walks initiated with short descriptors")
2239 .
desc(
"Table walker walks initiated with long descriptors")
2245 .
name(
name() +
".walksShortTerminationLevel")
2246 .
desc(
"Level at which table walker walks " 2247 "with short descriptors terminate")
2255 .
name(
name() +
".walksLongTerminationLevel")
2256 .
desc(
"Level at which table walker walks " 2257 "with long descriptors terminate")
2266 .
name(
name() +
".walksSquashedBefore")
2267 .
desc(
"Table walks squashed before starting")
2272 .
name(
name() +
".walksSquashedAfter")
2273 .
desc(
"Table walks squashed after completion")
2280 .
desc(
"Table walker wait (enqueue to first request) latency")
2286 .
name(
name() +
".walkCompletionTime")
2287 .
desc(
"Table walker service (enqueue to completion) latency")
2294 .
desc(
"Table walker pending requests distribution")
2301 .
desc(
"Table walker page sizes translated")
2316 .
name(
name() +
".walkRequestOrigin")
2317 .
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)
The request is to an uncacheable address.
Ports are used to interface objects to each other.
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType)
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
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.
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.
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
DrainState drainState() const
Return the current drain state of an object.
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
void signalDrainDone() const
Signal that an object is drained.
The request targets the secure memory space.
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.
virtual void regStats()
Callback to set stat parameters.
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
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)
int decodePhysAddrRange64(uint8_t pa_enc)
Returns the n.
EventFunctionWrapper doL1DescEvent
virtual uint8_t offsetBits() const =0
bool ELIs64(ThreadContext *tc, ExceptionLevel el)
HCR hcr
Cached copy of the htcr as it existed when translation began.
MasterID masterId
Master id assigned by the MMU.
Tick curTick()
The current simulated tick.
Stats::Vector statWalksLongTerminatedAtLevel
void insertTableEntry(DescriptorBase &descriptor, bool longDescriptor)
int physAddrRange
Current physical address range in bits.
Fault fault
The fault that we are going to return.
ByteOrder byteOrder(ThreadContext *tc)
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)
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
Draining buffers pending serialization/handover.
#define ULL(N)
uint64_t constant
virtual const std::string name() const
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.
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)
TlbEntry::DomainType domain() const
Domain Client/Manager: ARM DDI 0406B: B3-31.
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
L1Descriptor l1Desc
Short-format descriptors.
void nextWalk(ThreadContext *tc)
uint32_t data
The raw bits of the entry.
The request is a page table walk.
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.
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.
TLB::Translation * stage2Tran
A pointer to the stage 2 translation that's in progress.
Stats::Vector statPageSizes