gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tlb.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
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  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Gabe Black
38  */
39 
40 #include "arch/x86/tlb.hh"
41 
42 #include <cstring>
43 #include <memory>
44 
45 #include "arch/x86/faults.hh"
48 #include "arch/x86/regs/misc.hh"
49 #include "arch/x86/regs/msr.hh"
50 #include "arch/x86/x86_traits.hh"
51 #include "base/trace.hh"
52 #include "cpu/thread_context.hh"
53 #include "debug/TLB.hh"
54 #include "mem/page_table.hh"
55 #include "mem/request.hh"
56 #include "sim/full_system.hh"
57 #include "sim/process.hh"
58 
59 namespace X86ISA {
60 
61 TLB::TLB(const Params *p)
62  : BaseTLB(p), configAddress(0), size(p->size),
63  tlb(size), lruSeq(0), m5opRange(p->system->m5opRange())
64 {
65  if (!size)
66  fatal("TLBs must have a non-zero size.\n");
67 
68  for (int x = 0; x < size; x++) {
69  tlb[x].trieHandle = NULL;
70  freeList.push_back(&tlb[x]);
71  }
72 
73  walker = p->walker;
74  walker->setTLB(this);
75 }
76 
77 void
79 {
80  // Find the entry with the lowest (and hence least recently updated)
81  // sequence number.
82 
83  unsigned lru = 0;
84  for (unsigned i = 1; i < size; i++) {
85  if (tlb[i].lruSeq < tlb[lru].lruSeq)
86  lru = i;
87  }
88 
89  assert(tlb[lru].trieHandle);
90  trie.remove(tlb[lru].trieHandle);
91  tlb[lru].trieHandle = NULL;
92  freeList.push_back(&tlb[lru]);
93 }
94 
95 TlbEntry *
96 TLB::insert(Addr vpn, const TlbEntry &entry)
97 {
98  // If somebody beat us to it, just use that existing entry.
99  TlbEntry *newEntry = trie.lookup(vpn);
100  if (newEntry) {
101  assert(newEntry->vaddr == vpn);
102  return newEntry;
103  }
104 
105  if (freeList.empty())
106  evictLRU();
107 
108  newEntry = freeList.front();
109  freeList.pop_front();
110 
111  *newEntry = entry;
112  newEntry->lruSeq = nextSeq();
113  newEntry->vaddr = vpn;
114  newEntry->trieHandle =
115  trie.insert(vpn, TlbEntryTrie::MaxBits - entry.logBytes, newEntry);
116  return newEntry;
117 }
118 
119 TlbEntry *
120 TLB::lookup(Addr va, bool update_lru)
121 {
122  TlbEntry *entry = trie.lookup(va);
123  if (entry && update_lru)
124  entry->lruSeq = nextSeq();
125  return entry;
126 }
127 
128 void
130 {
131  DPRINTF(TLB, "Invalidating all entries.\n");
132  for (unsigned i = 0; i < size; i++) {
133  if (tlb[i].trieHandle) {
134  trie.remove(tlb[i].trieHandle);
135  tlb[i].trieHandle = NULL;
136  freeList.push_back(&tlb[i]);
137  }
138  }
139 }
140 
141 void
143 {
145 }
146 
147 void
149 {
150  DPRINTF(TLB, "Invalidating all non global entries.\n");
151  for (unsigned i = 0; i < size; i++) {
152  if (tlb[i].trieHandle && !tlb[i].global) {
153  trie.remove(tlb[i].trieHandle);
154  tlb[i].trieHandle = NULL;
155  freeList.push_back(&tlb[i]);
156  }
157  }
158 }
159 
160 void
161 TLB::demapPage(Addr va, uint64_t asn)
162 {
163  TlbEntry *entry = trie.lookup(va);
164  if (entry) {
165  trie.remove(entry->trieHandle);
166  entry->trieHandle = NULL;
167  freeList.push_back(entry);
168  }
169 }
170 
171 Fault
173 {
174  DPRINTF(TLB, "Addresses references internal memory.\n");
175  Addr vaddr = req->getVaddr();
176  Addr prefix = (vaddr >> 3) & IntAddrPrefixMask;
177  if (prefix == IntAddrPrefixCPUID) {
178  panic("CPUID memory space not yet implemented!\n");
179  } else if (prefix == IntAddrPrefixMSR) {
180  vaddr = (vaddr >> 3) & ~IntAddrPrefixMask;
181  req->setFlags(Request::MMAPPED_IPR);
182 
183  MiscRegIndex regNum;
184  if (!msrAddrToIndex(regNum, vaddr))
185  return std::make_shared<GeneralProtection>(0);
186 
187  //The index is multiplied by the size of a RegVal so that
188  //any memory dependence calculations will not see these as
189  //overlapping.
190  req->setPaddr((Addr)regNum * sizeof(RegVal));
191  return NoFault;
192  } else if (prefix == IntAddrPrefixIO) {
193  // TODO If CPL > IOPL or in virtual mode, check the I/O permission
194  // bitmap in the TSS.
195 
196  Addr IOPort = vaddr & ~IntAddrPrefixMask;
197  // Make sure the address fits in the expected 16 bit IO address
198  // space.
199  assert(!(IOPort & ~0xFFFF));
200  if (IOPort == 0xCF8 && req->getSize() == 4) {
201  req->setFlags(Request::MMAPPED_IPR);
202  req->setPaddr(MISCREG_PCI_CONFIG_ADDRESS * sizeof(RegVal));
203  } else if ((IOPort & ~mask(2)) == 0xCFC) {
207  if (bits(configAddress, 31, 31)) {
208  req->setPaddr(PhysAddrPrefixPciConfig |
209  mbits(configAddress, 30, 2) |
210  (IOPort & mask(2)));
211  } else {
212  req->setPaddr(PhysAddrPrefixIO | IOPort);
213  }
214  } else {
216  req->setPaddr(PhysAddrPrefixIO | IOPort);
217  }
218  return NoFault;
219  } else {
220  panic("Access to unrecognized internal address space %#x.\n",
221  prefix);
222  }
223 }
224 
225 Fault
227  ThreadContext *tc, Mode mode) const
228 {
229  Addr paddr = req->getPaddr();
230 
231  if (m5opRange.contains(paddr)) {
233  } else if (FullSystem) {
234  // Check for an access to the local APIC
235  LocalApicBase localApicBase =
237  AddrRange apicRange(localApicBase.base * PageBytes,
238  (localApicBase.base + 1) * PageBytes);
239 
240  if (apicRange.contains(paddr)) {
241  // The Intel developer's manuals say the below restrictions apply,
242  // but the linux kernel, because of a compiler optimization, breaks
243  // them.
244  /*
245  // Check alignment
246  if (paddr & ((32/8) - 1))
247  return new GeneralProtection(0);
248  // Check access size
249  if (req->getSize() != (32/8))
250  return new GeneralProtection(0);
251  */
252  // Force the access to be uncacheable.
254  req->setPaddr(x86LocalAPICAddress(tc->contextId(),
255  paddr - apicRange.start()));
256  }
257  }
258 
259  return NoFault;
260 }
261 
262 Fault
264  ThreadContext *tc, Translation *translation,
265  Mode mode, bool &delayedResponse, bool timing)
266 {
267  Request::Flags flags = req->getFlags();
268  int seg = flags & SegmentFlagMask;
269  bool storeCheck = flags & (StoreCheck << FlagShift);
270 
271  delayedResponse = false;
272 
273  // If this is true, we're dealing with a request to a non-memory address
274  // space.
275  if (seg == SEGMENT_REG_MS) {
276  return translateInt(req, tc);
277  }
278 
279  Addr vaddr = req->getVaddr();
280  DPRINTF(TLB, "Translating vaddr %#x.\n", vaddr);
281 
282  HandyM5Reg m5Reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
283 
284  // If protected mode has been enabled...
285  if (m5Reg.prot) {
286  DPRINTF(TLB, "In protected mode.\n");
287  // If we're not in 64-bit mode, do protection/limit checks
288  if (m5Reg.mode != LongMode) {
289  DPRINTF(TLB, "Not in long mode. Checking segment protection.\n");
290  // Check for a NULL segment selector.
291  if (!(seg == SEGMENT_REG_TSG || seg == SYS_SEGMENT_REG_IDTR ||
292  seg == SEGMENT_REG_HS || seg == SEGMENT_REG_LS)
293  && !tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg)))
294  return std::make_shared<GeneralProtection>(0);
295  bool expandDown = false;
296  SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg));
297  if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) {
298  if (!attr.writable && (mode == Write || storeCheck))
299  return std::make_shared<GeneralProtection>(0);
300  if (!attr.readable && mode == Read)
301  return std::make_shared<GeneralProtection>(0);
302  expandDown = attr.expandDown;
303 
304  }
307  bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift));
308  unsigned logSize = sizeOverride ? (unsigned)m5Reg.altAddr
309  : (unsigned)m5Reg.defAddr;
310  int size = (1 << logSize) * 8;
311  Addr offset = bits(vaddr - base, size - 1, 0);
312  Addr endOffset = offset + req->getSize() - 1;
313  if (expandDown) {
314  DPRINTF(TLB, "Checking an expand down segment.\n");
315  warn_once("Expand down segments are untested.\n");
316  if (offset <= limit || endOffset <= limit)
317  return std::make_shared<GeneralProtection>(0);
318  } else {
319  if (offset > limit || endOffset > limit)
320  return std::make_shared<GeneralProtection>(0);
321  }
322  }
323  if (m5Reg.submode != SixtyFourBitMode ||
324  (flags & (AddrSizeFlagBit << FlagShift)))
325  vaddr &= mask(32);
326  // If paging is enabled, do the translation.
327  if (m5Reg.paging) {
328  DPRINTF(TLB, "Paging enabled.\n");
329  // The vaddr already has the segment base applied.
330  TlbEntry *entry = lookup(vaddr);
331  if (mode == Read) {
332  rdAccesses++;
333  } else {
334  wrAccesses++;
335  }
336  if (!entry) {
337  DPRINTF(TLB, "Handling a TLB miss for "
338  "address %#x at pc %#x.\n",
339  vaddr, tc->instAddr());
340  if (mode == Read) {
341  rdMisses++;
342  } else {
343  wrMisses++;
344  }
345  if (FullSystem) {
346  Fault fault = walker->start(tc, translation, req, mode);
347  if (timing || fault != NoFault) {
348  // This gets ignored in atomic mode.
349  delayedResponse = true;
350  return fault;
351  }
352  entry = lookup(vaddr);
353  assert(entry);
354  } else {
355  Process *p = tc->getProcessPtr();
356  const EmulationPageTable::Entry *pte =
357  p->pTable->lookup(vaddr);
358  if (!pte && mode != Execute) {
359  // Check if we just need to grow the stack.
360  if (p->fixupStackFault(vaddr)) {
361  // If we did, lookup the entry for the new page.
362  pte = p->pTable->lookup(vaddr);
363  }
364  }
365  if (!pte) {
366  return std::make_shared<PageFault>(vaddr, true, mode,
367  true, false);
368  } else {
369  Addr alignedVaddr = p->pTable->pageAlign(vaddr);
370  DPRINTF(TLB, "Mapping %#x to %#x\n", alignedVaddr,
371  pte->paddr);
372  entry = insert(alignedVaddr, TlbEntry(
373  p->pTable->pid(), alignedVaddr, pte->paddr,
376  }
377  DPRINTF(TLB, "Miss was serviced.\n");
378  }
379  }
380 
381  DPRINTF(TLB, "Entry found with paddr %#x, "
382  "doing protection checks.\n", entry->paddr);
383  // Do paging protection checks.
384  bool inUser = (m5Reg.cpl == 3 &&
385  !(flags & (CPL0FlagBit << FlagShift)));
386  CR0 cr0 = tc->readMiscRegNoEffect(MISCREG_CR0);
387  bool badWrite = (!entry->writable && (inUser || cr0.wp));
388  if ((inUser && !entry->user) || (mode == Write && badWrite)) {
389  // The page must have been present to get into the TLB in
390  // the first place. We'll assume the reserved bits are
391  // fine even though we're not checking them.
392  return std::make_shared<PageFault>(vaddr, true, mode, inUser,
393  false);
394  }
395  if (storeCheck && badWrite) {
396  // This would fault if this were a write, so return a page
397  // fault that reflects that happening.
398  return std::make_shared<PageFault>(vaddr, true, Write, inUser,
399  false);
400  }
401 
402  Addr paddr = entry->paddr | (vaddr & mask(entry->logBytes));
403  DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr);
404  req->setPaddr(paddr);
405  if (entry->uncacheable)
407  } else {
408  //Use the address which already has segmentation applied.
409  DPRINTF(TLB, "Paging disabled.\n");
410  DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, vaddr);
411  req->setPaddr(vaddr);
412  }
413  } else {
414  // Real mode
415  DPRINTF(TLB, "In real mode.\n");
416  DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, vaddr);
417  req->setPaddr(vaddr);
418  }
419 
420  return finalizePhysical(req, tc, mode);
421 }
422 
423 Fault
425 {
426  bool delayedResponse;
427  return TLB::translate(req, tc, NULL, mode, delayedResponse, false);
428 }
429 
430 void
432  Translation *translation, Mode mode)
433 {
434  bool delayedResponse;
435  assert(translation);
436  Fault fault =
437  TLB::translate(req, tc, translation, mode, delayedResponse, true);
438  if (!delayedResponse)
439  translation->finish(fault, req, tc, mode);
440  else
441  translation->markDelayed();
442 }
443 
444 Walker *
446 {
447  return walker;
448 }
449 
450 void
452 {
453  using namespace Stats;
455  rdAccesses
456  .name(name() + ".rdAccesses")
457  .desc("TLB accesses on read requests");
458 
459  wrAccesses
460  .name(name() + ".wrAccesses")
461  .desc("TLB accesses on write requests");
462 
463  rdMisses
464  .name(name() + ".rdMisses")
465  .desc("TLB misses on read requests");
466 
467  wrMisses
468  .name(name() + ".wrMisses")
469  .desc("TLB misses on write requests");
470 
471 }
472 
473 void
475 {
476  // Only store the entries in use.
477  uint32_t _size = size - freeList.size();
478  SERIALIZE_SCALAR(_size);
480 
481  uint32_t _count = 0;
482  for (uint32_t x = 0; x < size; x++) {
483  if (tlb[x].trieHandle != NULL)
484  tlb[x].serializeSection(cp, csprintf("Entry%d", _count++));
485  }
486 }
487 
488 void
490 {
491  // Do not allow to restore with a smaller tlb.
492  uint32_t _size;
493  UNSERIALIZE_SCALAR(_size);
494  if (_size > size) {
495  fatal("TLB size less than the one in checkpoint!");
496  }
497 
499 
500  for (uint32_t x = 0; x < _size; x++) {
501  TlbEntry *newEntry = freeList.front();
502  freeList.pop_front();
503 
504  newEntry->unserializeSection(cp, csprintf("Entry%d", x));
505  newEntry->trieHandle = trie.insert(newEntry->vaddr,
506  TlbEntryTrie::MaxBits - newEntry->logBytes, newEntry);
507  }
508 }
509 
510 Port *
512 {
513  return &walker->getPort("port");
514 }
515 
516 } // namespace X86ISA
517 
518 X86ISA::TLB *
519 X86TLBParams::create()
520 {
521  return new X86ISA::TLB(this);
522 }
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
#define DPRINTF(x,...)
Definition: trace.hh:229
const Addr PhysAddrPrefixPciConfig
Definition: x86_traits.hh:73
offset
Definition: misc.hh:1026
The request is to an uncacheable address.
Definition: request.hh:115
Ports are used to interface objects to each other.
Definition: port.hh:60
Handle insert(Key key, unsigned width, Value *val)
Method which inserts a key/value pair into the trie.
Definition: trie.hh:188
const int FlagShift
Definition: ldstflags.hh:52
decltype(nullptr) constexpr NoFault
Definition: types.hh:245
uint64_t lruSeq
Definition: pagetable.hh:93
Stats::Scalar rdMisses
Definition: tlb.hh:108
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:175
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: tlb.cc:489
Bitfield< 7 > i
void setConfigAddress(uint32_t addr)
Definition: tlb.cc:142
Port * getTableWalkerPort() override
Get the table walker port.
Definition: tlb.cc:511
void unserializeSection(CheckpointIn &cp, const char *name)
Unserialize an a child object.
Definition: serialize.cc:183
std::vector< TlbEntry > tlb
Definition: tlb.hh:96
unsigned logBytes
Definition: pagetable.hh:74
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
bool contains(const Addr &a) const
Determine if the range contains an address.
Definition: addr_range.hh:406
std::shared_ptr< Request > RequestPtr
Definition: request.hh:83
virtual void markDelayed()=0
Signal that the translation has been delayed due to a hw page table walk.
static const unsigned MaxBits
Definition: trie.hh:113
Fault start(ThreadContext *_tc, BaseTLB::Translation *translation, const RequestPtr &req, BaseTLB::Mode mode)
TLB(const Params *p)
Definition: tlb.cc:61
The request is required to be strictly ordered by CPU models and is non-speculative.
Definition: request.hh:125
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:136
virtual Process * getProcessPtr()=0
uint64_t RegVal
Definition: types.hh:168
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:66
uint32_t configAddress
Definition: tlb.hh:65
Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const override
Do post-translation physical address finalization.
Definition: tlb.cc:226
const Addr IntAddrPrefixCPUID
Definition: x86_traits.hh:68
const Addr PageBytes
Definition: isa_traits.hh:53
Bitfield< 14 > expandDown
Definition: misc.hh:998
Definition: cprintf.cc:42
Bitfield< 4, 0 > mode
void flushNonGlobal()
Definition: tlb.cc:148
TlbEntryTrie trie
Definition: tlb.hh:100
Fault translate(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, bool &delayedResponse, bool timing)
Definition: tlb.cc:263
ThreadContext is the external interface to all thread state for anything outside of the CPU...
MiscRegIndex
Definition: misc.hh:102
void setTLB(TLB *_tlb)
const Addr IntAddrPrefixMask
Definition: x86_traits.hh:67
Stats::Scalar rdAccesses
Definition: tlb.hh:106
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:72
Definition: tlb.hh:52
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:645
Addr pageAlign(Addr a)
Definition: page_table.hh:107
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:162
static MiscRegIndex MISCREG_SEG_ATTR(int index)
Definition: misc.hh:535
uint64_t nextSeq()
Definition: tlb.hh:122
static MiscRegIndex MISCREG_SEG_LIMIT(int index)
Definition: misc.hh:528
TlbEntryTrie::Handle trieHandle
Definition: pagetable.hh:95
void regStats() override
Callback to set stat parameters.
Definition: tlb.cc:451
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode) override
Definition: tlb.cc:431
mask
Definition: misc.hh:798
Value * lookup(Key key)
Method which looks up the Value corresponding to a particular key.
Definition: trie.hh:274
void evictLRU()
Definition: tlb.cc:78
Bitfield< 51, 12 > base
Definition: pagetable.hh:142
Stats::Scalar wrMisses
Definition: tlb.hh:109
Walker * getWalker()
Definition: tlb.cc:445
const Addr IntAddrPrefixMSR
Definition: x86_traits.hh:69
virtual void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
Bitfield< 59, 56 > tlb
This request is to a memory mapped register.
Definition: request.hh:127
virtual Addr instAddr() const =0
Stats::Scalar wrAccesses
Definition: tlb.hh:107
static MiscRegIndex MISCREG_SEG_SEL(int index)
Definition: misc.hh:507
Bitfield< 2, 0 > seg
Definition: types.hh:84
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
virtual const std::string name() const
Definition: sim_object.hh:120
const Request::FlagsType M5_VAR_USED SegmentFlagMask
Definition: ldstflags.hh:51
Bitfield< 8 > va
Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode) override
Definition: tlb.cc:424
#define warn_once(...)
Definition: logging.hh:216
Bitfield< 15 > system
Definition: misc.hh:999
const Addr IntAddrPrefixIO
Definition: x86_traits.hh:70
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:643
bool msrAddrToIndex(MiscRegIndex &regNum, Addr addr)
Find and return the misc reg corresponding to an MSR address.
Definition: msr.cc:149
void flushAll() override
Remove all entries from the TLB.
Definition: tlb.cc:129
Mode
Definition: tlb.hh:59
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Definition: statistics.hh:279
X86TLBParams Params
Definition: tlb.hh:69
bool fixupStackFault(Addr vaddr)
Attempt to fix up a fault at vaddr by allocating a page on the stack.
Definition: process.cc:362
Value * remove(Handle handle)
Method to delete a value from the trie.
Definition: trie.hh:289
BitfieldType< SegDescriptorLimit > limit
Definition: misc.hh:926
TlbEntry * lookup(Addr va, bool update_lru=true)
Definition: tlb.cc:120
EmulationPageTable * pTable
Definition: process.hh:181
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
Declarations of a non-full system Page Table.
static MiscRegIndex MISCREG_SEG_BASE(int index)
Definition: misc.hh:514
std::ostream CheckpointOut
Definition: serialize.hh:68
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: tlb.cc:474
This is exposed globally, independent of the ISA.
Definition: acpi.hh:57
Fault translateInt(const RequestPtr &req, ThreadContext *tc)
Definition: tlb.cc:172
void demapPage(Addr va, uint64_t asn) override
Definition: tlb.cc:161
EntryList freeList
Definition: tlb.hh:98
virtual ContextID contextId() const =0
const Entry * lookup(Addr vaddr)
Lookup function.
Definition: page_table.cc:134
const Addr PhysAddrPrefixIO
Definition: x86_traits.hh:72
Addr start() const
Get the start address of the range.
Definition: addr_range.hh:297
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Definition: statistics.hh:312
uint64_t lruSeq
Definition: tlb.hh:101
Bitfield< 0 > p
Definition: pagetable.hh:152
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Walker * walker
Definition: tlb.hh:82
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:96
T bits(T val, int first, int last)
Extract the bitfield from position &#39;first&#39; to &#39;last&#39; (inclusive) from &#39;val&#39; and right justify it...
Definition: bitfield.hh:72
AddrRange m5opRange
Definition: tlb.hh:103
static Addr x86LocalAPICAddress(const uint8_t id, const uint16_t addr)
Definition: x86_traits.hh:93
Bitfield< 1 > x
Definition: types.hh:105
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
Bitfield< 3 > addr
Definition: types.hh:81
uint64_t pid() const
Definition: page_table.hh:83
TlbEntry * insert(Addr vpn, const TlbEntry &entry)
Definition: tlb.cc:96
uint32_t size
Definition: tlb.hh:94

Generated on Fri Feb 28 2020 16:26:56 for gem5 by doxygen 1.8.13