gem5  v20.1.0.0
pagetable_walker.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 ARM Limited
3  * All rights reserved.
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2007 The Hewlett-Packard Development Company
15  * All rights reserved.
16  *
17  * The license below extends only to copyright in the software and shall
18  * not be construed as granting a license to any other intellectual
19  * property including but not limited to intellectual property relating
20  * to a hardware implementation of the functionality of the software
21  * licensed hereunder. You may use the software subject to the license
22  * terms below provided that you ensure that this notice is replicated
23  * unmodified and in its entirety in all distributions of the software,
24  * modified or unmodified, in source code or in binary form.
25  *
26  * Redistribution and use in source and binary forms, with or without
27  * modification, are permitted provided that the following conditions are
28  * met: redistributions of source code must retain the above copyright
29  * notice, this list of conditions and the following disclaimer;
30  * redistributions in binary form must reproduce the above copyright
31  * notice, this list of conditions and the following disclaimer in the
32  * documentation and/or other materials provided with the distribution;
33  * neither the name of the copyright holders nor the names of its
34  * contributors may be used to endorse or promote products derived from
35  * this software without specific prior written permission.
36  *
37  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
38  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
41  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  */
49 
51 
52 #include <memory>
53 
54 #include "arch/x86/faults.hh"
55 #include "arch/x86/pagetable.hh"
56 #include "arch/x86/tlb.hh"
57 #include "base/bitfield.hh"
58 #include "base/trie.hh"
59 #include "cpu/base.hh"
60 #include "cpu/thread_context.hh"
61 #include "debug/PageTableWalker.hh"
62 #include "mem/packet_access.hh"
63 #include "mem/request.hh"
64 
65 namespace X86ISA {
66 
67 Fault
69  const RequestPtr &_req, BaseTLB::Mode _mode)
70 {
71  // TODO: in timing mode, instead of blocking when there are other
72  // outstanding requests, see if this request can be coalesced with
73  // another one (i.e. either coalesce or start walk)
74  WalkerState * newState = new WalkerState(this, _translation, _req);
75  newState->initState(_tc, _mode, sys->isTimingMode());
76  if (currStates.size()) {
77  assert(newState->isTiming());
78  DPRINTF(PageTableWalker, "Walks in progress: %d\n", currStates.size());
79  currStates.push_back(newState);
80  return NoFault;
81  } else {
82  currStates.push_back(newState);
83  Fault fault = newState->startWalk();
84  if (!newState->isTiming()) {
85  currStates.pop_front();
86  delete newState;
87  }
88  return fault;
89  }
90 }
91 
92 Fault
93 Walker::startFunctional(ThreadContext * _tc, Addr &addr, unsigned &logBytes,
94  BaseTLB::Mode _mode)
95 {
96  funcState.initState(_tc, _mode);
97  return funcState.startFunctional(addr, logBytes);
98 }
99 
100 bool
102 {
103  return walker->recvTimingResp(pkt);
104 }
105 
106 bool
108 {
109  WalkerSenderState * senderState =
110  dynamic_cast<WalkerSenderState *>(pkt->popSenderState());
111  WalkerState * senderWalk = senderState->senderWalk;
112  bool walkComplete = senderWalk->recvPacket(pkt);
113  delete senderState;
114  if (walkComplete) {
116  for (iter = currStates.begin(); iter != currStates.end(); iter++) {
117  WalkerState * walkerState = *(iter);
118  if (walkerState == senderWalk) {
119  iter = currStates.erase(iter);
120  break;
121  }
122  }
123  delete senderWalk;
124  // Since we block requests when another is outstanding, we
125  // need to check if there is a waiting request to be serviced
126  if (currStates.size() && !startWalkWrapperEvent.scheduled())
127  // delay sending any new requests until we are finished
128  // with the responses
130  }
131  return true;
132 }
133 
134 void
136 {
137  walker->recvReqRetry();
138 }
139 
140 void
142 {
144  for (iter = currStates.begin(); iter != currStates.end(); iter++) {
145  WalkerState * walkerState = *(iter);
146  if (walkerState->isRetrying()) {
147  walkerState->retry();
148  }
149  }
150 }
151 
152 bool Walker::sendTiming(WalkerState* sendingState, PacketPtr pkt)
153 {
154  WalkerSenderState* walker_state = new WalkerSenderState(sendingState);
155  pkt->pushSenderState(walker_state);
156  if (port.sendTimingReq(pkt)) {
157  return true;
158  } else {
159  // undo the adding of the sender state and delete it, as we
160  // will do it again the next time we attempt to send it
161  pkt->popSenderState();
162  delete walker_state;
163  return false;
164  }
165 
166 }
167 
168 Port &
169 Walker::getPort(const std::string &if_name, PortID idx)
170 {
171  if (if_name == "port")
172  return port;
173  else
174  return ClockedObject::getPort(if_name, idx);
175 }
176 
177 void
179  BaseTLB::Mode _mode, bool _isTiming)
180 {
181  assert(state == Ready);
182  started = false;
183  tc = _tc;
184  mode = _mode;
185  timing = _isTiming;
186 }
187 
188 void
190 {
191  unsigned num_squashed = 0;
192  WalkerState *currState = currStates.front();
193  while ((num_squashed < numSquashable) && currState &&
194  currState->translation->squashed()) {
195  currStates.pop_front();
196  num_squashed++;
197 
198  DPRINTF(PageTableWalker, "Squashing table walk for address %#x\n",
199  currState->req->getVaddr());
200 
201  // finish the translation which will delete the translation object
202  currState->translation->finish(
203  std::make_shared<UnimpFault>("Squashed Inst"),
204  currState->req, currState->tc, currState->mode);
205 
206  // delete the current request if there are no inflight packets.
207  // if there is something in flight, delete when the packets are
208  // received and inflight is zero.
209  if (currState->numInflight() == 0) {
210  delete currState;
211  } else {
212  currState->squash();
213  }
214 
215  // check the next translation request, if it exists
216  if (currStates.size())
217  currState = currStates.front();
218  else
219  currState = NULL;
220  }
221  if (currState && !currState->wasStarted())
222  currState->startWalk();
223 }
224 
225 Fault
227 {
228  Fault fault = NoFault;
229  assert(!started);
230  started = true;
231  setupWalk(req->getVaddr());
232  if (timing) {
233  nextState = state;
234  state = Waiting;
235  timingFault = NoFault;
236  sendPackets();
237  } else {
238  do {
239  walker->port.sendAtomic(read);
240  PacketPtr write = NULL;
241  fault = stepWalk(write);
242  assert(fault == NoFault || read == NULL);
243  state = nextState;
244  nextState = Ready;
245  if (write)
246  walker->port.sendAtomic(write);
247  } while (read);
248  state = Ready;
249  nextState = Waiting;
250  }
251  return fault;
252 }
253 
254 Fault
256 {
257  Fault fault = NoFault;
258  assert(!started);
259  started = true;
260  setupWalk(addr);
261 
262  do {
263  walker->port.sendFunctional(read);
264  // On a functional access (page table lookup), writes should
265  // not happen so this pointer is ignored after stepWalk
266  PacketPtr write = NULL;
267  fault = stepWalk(write);
268  assert(fault == NoFault || read == NULL);
269  state = nextState;
270  nextState = Ready;
271  } while (read);
272  logBytes = entry.logBytes;
273  addr = entry.paddr;
274 
275  return fault;
276 }
277 
278 Fault
280 {
281  assert(state != Ready && state != Waiting);
282  Fault fault = NoFault;
283  write = NULL;
284  PageTableEntry pte;
285  if (dataSize == 8)
286  pte = read->getLE<uint64_t>();
287  else
288  pte = read->getLE<uint32_t>();
289  VAddr vaddr = entry.vaddr;
290  bool uncacheable = pte.pcd;
291  Addr nextRead = 0;
292  bool doWrite = false;
293  bool doTLBInsert = false;
294  bool doEndWalk = false;
295  bool badNX = pte.nx && mode == BaseTLB::Execute && enableNX;
296  switch(state) {
297  case LongPML4:
298  DPRINTF(PageTableWalker,
299  "Got long mode PML4 entry %#016x.\n", (uint64_t)pte);
300  nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.longl3 * dataSize;
301  doWrite = !pte.a;
302  pte.a = 1;
303  entry.writable = pte.w;
304  entry.user = pte.u;
305  if (badNX || !pte.p) {
306  doEndWalk = true;
307  fault = pageFault(pte.p);
308  break;
309  }
310  entry.noExec = pte.nx;
311  nextState = LongPDP;
312  break;
313  case LongPDP:
314  DPRINTF(PageTableWalker,
315  "Got long mode PDP entry %#016x.\n", (uint64_t)pte);
316  nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.longl2 * dataSize;
317  doWrite = !pte.a;
318  pte.a = 1;
319  entry.writable = entry.writable && pte.w;
320  entry.user = entry.user && pte.u;
321  if (badNX || !pte.p) {
322  doEndWalk = true;
323  fault = pageFault(pte.p);
324  break;
325  }
326  nextState = LongPD;
327  break;
328  case LongPD:
329  DPRINTF(PageTableWalker,
330  "Got long mode PD entry %#016x.\n", (uint64_t)pte);
331  doWrite = !pte.a;
332  pte.a = 1;
333  entry.writable = entry.writable && pte.w;
334  entry.user = entry.user && pte.u;
335  if (badNX || !pte.p) {
336  doEndWalk = true;
337  fault = pageFault(pte.p);
338  break;
339  }
340  if (!pte.ps) {
341  // 4 KB page
342  entry.logBytes = 12;
343  nextRead =
344  ((uint64_t)pte & (mask(40) << 12)) + vaddr.longl1 * dataSize;
345  nextState = LongPTE;
346  break;
347  } else {
348  // 2 MB page
349  entry.logBytes = 21;
350  entry.paddr = (uint64_t)pte & (mask(31) << 21);
351  entry.uncacheable = uncacheable;
352  entry.global = pte.g;
353  entry.patBit = bits(pte, 12);
354  entry.vaddr = entry.vaddr & ~((2 * (1 << 20)) - 1);
355  doTLBInsert = true;
356  doEndWalk = true;
357  break;
358  }
359  case LongPTE:
360  DPRINTF(PageTableWalker,
361  "Got long mode PTE entry %#016x.\n", (uint64_t)pte);
362  doWrite = !pte.a;
363  pte.a = 1;
364  entry.writable = entry.writable && pte.w;
365  entry.user = entry.user && pte.u;
366  if (badNX || !pte.p) {
367  doEndWalk = true;
368  fault = pageFault(pte.p);
369  break;
370  }
371  entry.paddr = (uint64_t)pte & (mask(40) << 12);
372  entry.uncacheable = uncacheable;
373  entry.global = pte.g;
374  entry.patBit = bits(pte, 12);
375  entry.vaddr = entry.vaddr & ~((4 * (1 << 10)) - 1);
376  doTLBInsert = true;
377  doEndWalk = true;
378  break;
379  case PAEPDP:
380  DPRINTF(PageTableWalker,
381  "Got legacy mode PAE PDP entry %#08x.\n", (uint32_t)pte);
382  nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.pael2 * dataSize;
383  if (!pte.p) {
384  doEndWalk = true;
385  fault = pageFault(pte.p);
386  break;
387  }
388  nextState = PAEPD;
389  break;
390  case PAEPD:
391  DPRINTF(PageTableWalker,
392  "Got legacy mode PAE PD entry %#08x.\n", (uint32_t)pte);
393  doWrite = !pte.a;
394  pte.a = 1;
395  entry.writable = pte.w;
396  entry.user = pte.u;
397  if (badNX || !pte.p) {
398  doEndWalk = true;
399  fault = pageFault(pte.p);
400  break;
401  }
402  if (!pte.ps) {
403  // 4 KB page
404  entry.logBytes = 12;
405  nextRead = ((uint64_t)pte & (mask(40) << 12)) + vaddr.pael1 * dataSize;
406  nextState = PAEPTE;
407  break;
408  } else {
409  // 2 MB page
410  entry.logBytes = 21;
411  entry.paddr = (uint64_t)pte & (mask(31) << 21);
412  entry.uncacheable = uncacheable;
413  entry.global = pte.g;
414  entry.patBit = bits(pte, 12);
415  entry.vaddr = entry.vaddr & ~((2 * (1 << 20)) - 1);
416  doTLBInsert = true;
417  doEndWalk = true;
418  break;
419  }
420  case PAEPTE:
421  DPRINTF(PageTableWalker,
422  "Got legacy mode PAE PTE entry %#08x.\n", (uint32_t)pte);
423  doWrite = !pte.a;
424  pte.a = 1;
425  entry.writable = entry.writable && pte.w;
426  entry.user = entry.user && pte.u;
427  if (badNX || !pte.p) {
428  doEndWalk = true;
429  fault = pageFault(pte.p);
430  break;
431  }
432  entry.paddr = (uint64_t)pte & (mask(40) << 12);
433  entry.uncacheable = uncacheable;
434  entry.global = pte.g;
435  entry.patBit = bits(pte, 7);
436  entry.vaddr = entry.vaddr & ~((4 * (1 << 10)) - 1);
437  doTLBInsert = true;
438  doEndWalk = true;
439  break;
440  case PSEPD:
441  DPRINTF(PageTableWalker,
442  "Got legacy mode PSE PD entry %#08x.\n", (uint32_t)pte);
443  doWrite = !pte.a;
444  pte.a = 1;
445  entry.writable = pte.w;
446  entry.user = pte.u;
447  if (!pte.p) {
448  doEndWalk = true;
449  fault = pageFault(pte.p);
450  break;
451  }
452  if (!pte.ps) {
453  // 4 KB page
454  entry.logBytes = 12;
455  nextRead =
456  ((uint64_t)pte & (mask(20) << 12)) + vaddr.norml2 * dataSize;
457  nextState = PTE;
458  break;
459  } else {
460  // 4 MB page
461  entry.logBytes = 21;
462  entry.paddr = bits(pte, 20, 13) << 32 | bits(pte, 31, 22) << 22;
463  entry.uncacheable = uncacheable;
464  entry.global = pte.g;
465  entry.patBit = bits(pte, 12);
466  entry.vaddr = entry.vaddr & ~((4 * (1 << 20)) - 1);
467  doTLBInsert = true;
468  doEndWalk = true;
469  break;
470  }
471  case PD:
472  DPRINTF(PageTableWalker,
473  "Got legacy mode PD entry %#08x.\n", (uint32_t)pte);
474  doWrite = !pte.a;
475  pte.a = 1;
476  entry.writable = pte.w;
477  entry.user = pte.u;
478  if (!pte.p) {
479  doEndWalk = true;
480  fault = pageFault(pte.p);
481  break;
482  }
483  // 4 KB page
484  entry.logBytes = 12;
485  nextRead = ((uint64_t)pte & (mask(20) << 12)) + vaddr.norml2 * dataSize;
486  nextState = PTE;
487  break;
488  case PTE:
489  DPRINTF(PageTableWalker,
490  "Got legacy mode PTE entry %#08x.\n", (uint32_t)pte);
491  doWrite = !pte.a;
492  pte.a = 1;
493  entry.writable = pte.w;
494  entry.user = pte.u;
495  if (!pte.p) {
496  doEndWalk = true;
497  fault = pageFault(pte.p);
498  break;
499  }
500  entry.paddr = (uint64_t)pte & (mask(20) << 12);
501  entry.uncacheable = uncacheable;
502  entry.global = pte.g;
503  entry.patBit = bits(pte, 7);
504  entry.vaddr = entry.vaddr & ~((4 * (1 << 10)) - 1);
505  doTLBInsert = true;
506  doEndWalk = true;
507  break;
508  default:
509  panic("Unknown page table walker state %d!\n");
510  }
511  if (doEndWalk) {
512  if (doTLBInsert)
513  if (!functional)
514  walker->tlb->insert(entry.vaddr, entry);
515  endWalk();
516  } else {
517  PacketPtr oldRead = read;
518  //If we didn't return, we're setting up another read.
519  Request::Flags flags = oldRead->req->getFlags();
520  flags.set(Request::UNCACHEABLE, uncacheable);
521  RequestPtr request = std::make_shared<Request>(
522  nextRead, oldRead->getSize(), flags, walker->requestorId);
523  read = new Packet(request, MemCmd::ReadReq);
524  read->allocate();
525  // If we need to write, adjust the read packet to write the modified
526  // value back to memory.
527  if (doWrite) {
528  write = oldRead;
529  write->setLE<uint64_t>(pte);
530  write->cmd = MemCmd::WriteReq;
531  } else {
532  write = NULL;
533  delete oldRead;
534  }
535  }
536  return fault;
537 }
538 
539 void
541 {
542  nextState = Ready;
543  delete read;
544  read = NULL;
545 }
546 
547 void
549 {
550  VAddr addr = vaddr;
551  CR3 cr3 = tc->readMiscRegNoEffect(MISCREG_CR3);
552  // Check if we're in long mode or not
553  Efer efer = tc->readMiscRegNoEffect(MISCREG_EFER);
554  dataSize = 8;
555  Addr topAddr;
556  if (efer.lma) {
557  // Do long mode.
558  state = LongPML4;
559  topAddr = (cr3.longPdtb << 12) + addr.longl4 * dataSize;
560  enableNX = efer.nxe;
561  } else {
562  // We're in some flavor of legacy mode.
563  CR4 cr4 = tc->readMiscRegNoEffect(MISCREG_CR4);
564  if (cr4.pae) {
565  // Do legacy PAE.
566  state = PAEPDP;
567  topAddr = (cr3.paePdtb << 5) + addr.pael3 * dataSize;
568  enableNX = efer.nxe;
569  } else {
570  dataSize = 4;
571  topAddr = (cr3.pdtb << 12) + addr.norml2 * dataSize;
572  if (cr4.pse) {
573  // Do legacy PSE.
574  state = PSEPD;
575  } else {
576  // Do legacy non PSE.
577  state = PD;
578  }
579  enableNX = false;
580  }
581  }
582 
583  nextState = Ready;
584  entry.vaddr = vaddr;
585 
587  if (cr3.pcd)
588  flags.set(Request::UNCACHEABLE);
589 
590  RequestPtr request = std::make_shared<Request>(
591  topAddr, dataSize, flags, walker->requestorId);
592 
593  read = new Packet(request, MemCmd::ReadReq);
594  read->allocate();
595 }
596 
597 bool
599 {
600  assert(pkt->isResponse());
601  assert(inflight);
602  assert(state == Waiting);
603  inflight--;
604  if (squashed) {
605  // if were were squashed, return true once inflight is zero and
606  // this WalkerState will be freed there.
607  return (inflight == 0);
608  }
609  if (pkt->isRead()) {
610  // should not have a pending read it we also had one outstanding
611  assert(!read);
612 
613  // @todo someone should pay for this
614  pkt->headerDelay = pkt->payloadDelay = 0;
615 
616  state = nextState;
617  nextState = Ready;
618  PacketPtr write = NULL;
619  read = pkt;
620  timingFault = stepWalk(write);
621  state = Waiting;
622  assert(timingFault == NoFault || read == NULL);
623  if (write) {
624  writes.push_back(write);
625  }
626  sendPackets();
627  } else {
628  sendPackets();
629  }
630  if (inflight == 0 && read == NULL && writes.size() == 0) {
631  state = Ready;
632  nextState = Waiting;
633  if (timingFault == NoFault) {
634  /*
635  * Finish the translation. Now that we know the right entry is
636  * in the TLB, this should work with no memory accesses.
637  * There could be new faults unrelated to the table walk like
638  * permissions violations, so we'll need the return value as
639  * well.
640  */
641  bool delayedResponse;
642  Fault fault = walker->tlb->translate(req, tc, NULL, mode,
643  delayedResponse, true);
644  assert(!delayedResponse);
645  // Let the CPU continue.
646  translation->finish(fault, req, tc, mode);
647  } else {
648  // There was a fault during the walk. Let the CPU know.
649  translation->finish(timingFault, req, tc, mode);
650  }
651  return true;
652  }
653 
654  return false;
655 }
656 
657 void
659 {
660  //If we're already waiting for the port to become available, just return.
661  if (retrying)
662  return;
663 
664  //Reads always have priority
665  if (read) {
666  PacketPtr pkt = read;
667  read = NULL;
668  inflight++;
669  if (!walker->sendTiming(this, pkt)) {
670  retrying = true;
671  read = pkt;
672  inflight--;
673  return;
674  }
675  }
676  //Send off as many of the writes as we can.
677  while (writes.size()) {
678  PacketPtr write = writes.back();
679  writes.pop_back();
680  inflight++;
681  if (!walker->sendTiming(this, write)) {
682  retrying = true;
683  writes.push_back(write);
684  inflight--;
685  return;
686  }
687  }
688 }
689 
690 unsigned
692 {
693  return inflight;
694 }
695 
696 bool
698 {
699  return retrying;
700 }
701 
702 bool
704 {
705  return timing;
706 }
707 
708 bool
710 {
711  return started;
712 }
713 
714 void
716 {
717  squashed = true;
718 }
719 
720 void
722 {
723  retrying = false;
724  sendPackets();
725 }
726 
727 Fault
729 {
730  DPRINTF(PageTableWalker, "Raising page fault.\n");
731  HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
732  if (mode == BaseTLB::Execute && !enableNX)
734  return std::make_shared<PageFault>(entry.vaddr, present, mode,
735  m5reg.cpl == 3, false);
736 }
737 
738 /* end namespace X86ISA */ }
739 
741 X86PagetableWalkerParams::create()
742 {
743  return new X86ISA::Walker(this);
744 }
X86ISA::MISCREG_M5_REG
@ MISCREG_M5_REG
Definition: misc.hh:137
pagetable.hh
X86ISA::Walker::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Definition: pagetable_walker.cc:107
BaseTLB::Translation::finish
virtual void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
BaseTLB::Translation::squashed
virtual bool squashed() const
This function is used by the page table walker to determine if it should translate the a pending requ...
Definition: tlb.hh:84
Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:460
X86ISA::Walker::WalkerState::pageFault
Fault pageFault(bool present)
Definition: pagetable_walker.cc:728
Packet::isResponse
bool isResponse() const
Definition: packet.hh:560
BaseTLB::Read
@ Read
Definition: tlb.hh:57
System::isTimingMode
bool isTimingMode() const
Is the system in timing mode?
Definition: system.hh:269
X86ISA::Walker::WalkerState::tc
ThreadContext * tc
Definition: pagetable_walker.hh:95
X86ISA::Walker::WalkerState::setupWalk
void setupWalk(Addr vaddr)
Definition: pagetable_walker.cc:548
Packet::payloadDelay
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Definition: packet.hh:412
X86ISA::Walker::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: pagetable_walker.cc:169
Flags< FlagsType >
X86ISA::Walker::WalkerState::recvPacket
bool recvPacket(PacketPtr pkt)
Definition: pagetable_walker.cc:598
X86ISA::Walker::sendTiming
bool sendTiming(WalkerState *sendingState, PacketPtr pkt)
Definition: pagetable_walker.cc:152
X86ISA::present
Bitfield< 7 > present
Definition: misc.hh:992
Packet::isRead
bool isRead() const
Definition: packet.hh:556
BaseTLB::Mode
Mode
Definition: tlb.hh:57
MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:82
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
X86ISA::Walker::WalkerState::retry
void retry()
Definition: pagetable_walker.cc:721
pagetable_walker.hh
X86ISA::Walker::WalkerSenderState::senderWalk
WalkerState * senderWalk
Definition: pagetable_walker.hh:153
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:82
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:340
X86ISA::Walker::WalkerState
Definition: pagetable_walker.hh:78
Packet::getSize
unsigned getSize() const
Definition: packet.hh:764
X86ISA::Walker::WalkerState::stepWalk
Fault stepWalk(PacketPtr &write)
Definition: pagetable_walker.cc:279
X86ISA::Walker::funcState
WalkerState funcState
Definition: pagetable_walker.hh:149
X86ISA::MISCREG_EFER
@ MISCREG_EFER
Definition: misc.hh:245
X86ISA::Walker::startWalkWrapperEvent
EventFunctionWrapper startWalkWrapperEvent
Event used to call startWalkWrapper.
Definition: pagetable_walker.hh:182
faults.hh
X86ISA::Walker::recvReqRetry
void recvReqRetry()
Definition: pagetable_walker.cc:141
request.hh
Packet::headerDelay
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:394
MemCmd::WriteReq
@ WriteReq
Definition: packet.hh:85
Request::PHYSICAL
@ PHYSICAL
The virtual address is also the physical address.
Definition: request.hh:106
EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1005
X86ISA::MISCREG_CR4
@ MISCREG_CR4
Definition: misc.hh:109
X86ISA::Walker::WalkerState
friend class WalkerState
Definition: pagetable_walker.hh:144
X86ISA::Walker::startFunctional
Fault startFunctional(ThreadContext *_tc, Addr &addr, unsigned &logBytes, BaseTLB::Mode mode)
Definition: pagetable_walker.cc:93
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
bitfield.hh
RequestPort::sendTimingReq
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition: port.hh:492
X86ISA::Walker::start
Fault start(ThreadContext *_tc, BaseTLB::Translation *translation, const RequestPtr &req, BaseTLB::Mode mode)
Definition: pagetable_walker.cc:68
SimObject::getPort
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Definition: sim_object.cc:123
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
X86ISA::Walker::sys
System * sys
Definition: pagetable_walker.hh:170
X86ISA::Walker::WalkerState::isTiming
bool isTiming()
Definition: pagetable_walker.cc:703
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
X86ISA::Walker::WalkerState::initState
void initState(ThreadContext *_tc, BaseTLB::Mode _mode, bool _isTiming=false)
Definition: pagetable_walker.cc:178
Clocked::clockEdge
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...
Definition: clocked_object.hh:174
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
X86ISA::Walker::WalkerState::squash
void squash()
Definition: pagetable_walker.cc:715
X86ISA::Walker
Definition: pagetable_walker.hh:56
X86ISA::Walker::WalkerPort::walker
Walker * walker
Definition: pagetable_walker.hh:68
X86ISA::Walker::WalkerState::numInflight
unsigned numInflight() const
Definition: pagetable_walker.cc:691
BaseTLB::Translation
Definition: tlb.hh:59
Flags::set
void set(Type flags)
Definition: flags.hh:87
X86ISA::Walker::WalkerState::endWalk
void endWalk()
Definition: pagetable_walker.cc:540
Request::UNCACHEABLE
@ UNCACHEABLE
The request is to an uncacheable address.
Definition: request.hh:114
NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:245
X86ISA::Walker::WalkerState::translation
TLB::Translation * translation
Definition: pagetable_walker.hh:106
X86ISA::Walker::startWalkWrapper
void startWalkWrapper()
Definition: pagetable_walker.cc:189
X86ISA
This is exposed globally, independent of the ISA.
Definition: acpi.hh:55
ProbePoints::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:103
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
X86ISA::Walker::WalkerState::mode
BaseTLB::Mode mode
Definition: pagetable_walker.hh:107
X86ISA::Walker::WalkerPort::recvReqRetry
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: pagetable_walker.cc:135
packet_access.hh
X86ISA::Walker::WalkerState::startFunctional
Fault startFunctional(Addr &addr, unsigned &logBytes)
Definition: pagetable_walker.cc:255
X86ISA::Walker::currStates
std::list< WalkerState * > currStates
Definition: pagetable_walker.hh:147
X86ISA::Walker::WalkerState::req
RequestPtr req
Definition: pagetable_walker.hh:96
X86ISA::MISCREG_CR3
@ MISCREG_CR3
Definition: misc.hh:108
X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:79
Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:335
Packet::getLE
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Definition: packet_access.hh:75
Packet::pushSenderState
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
Definition: packet.cc:332
X86ISA::Walker::port
WalkerPort port
Definition: pagetable_walker.hh:75
base.hh
X86ISA::Walker::WalkerPort::recvTimingResp
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Definition: pagetable_walker.cc:101
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
X86ISA::Walker::WalkerState::sendPackets
void sendPackets()
Definition: pagetable_walker.cc:658
Packet::popSenderState
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:340
Packet::setLE
void setLE(T v)
Set the value in the data pointer to v as little endian.
Definition: packet_access.hh:105
X86ISA::Walker::WalkerState::wasStarted
bool wasStarted()
Definition: pagetable_walker.cc:709
X86ISA::mask
mask
Definition: misc.hh:796
X86ISA::Walker::WalkerSenderState
Definition: pagetable_walker.hh:151
X86ISA::Walker::numSquashable
unsigned numSquashable
Definition: pagetable_walker.hh:174
tlb.hh
std::list
STL list class.
Definition: stl.hh:51
X86ISA::Walker::WalkerState::isRetrying
bool isRetrying()
Definition: pagetable_walker.cc:697
X86ISA::Walker::WalkerState::startWalk
Fault startWalk()
Definition: pagetable_walker.cc:226
BaseTLB::Execute
@ Execute
Definition: tlb.hh:57
thread_context.hh
trie.hh
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
bits
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:75

Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17