gem5
|
Declaration of base class for page table. More...
#include <page_table.hh>
Classes | |
struct | cacheElement |
Public Types | |
enum | MappingFlags : uint32_t { Zero = 0, Clobber = 1, NotPresent = 2, Uncacheable = 4, ReadOnly = 8 } |
Public Member Functions | |
PageTableBase (const std::string &__name, uint64_t _pid, Addr _pageSize=TheISA::PageBytes) | |
virtual | ~PageTableBase () |
virtual void | initState (ThreadContext *tc)=0 |
const std::string | name () const |
Addr | pageAlign (Addr a) |
Addr | pageOffset (Addr a) |
virtual void | map (Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0)=0 |
Maps a virtual memory region to a physical memory region. More... | |
virtual void | remap (Addr vaddr, int64_t size, Addr new_vaddr)=0 |
virtual void | unmap (Addr vaddr, int64_t size)=0 |
virtual bool | isUnmapped (Addr vaddr, int64_t size)=0 |
Check if any pages in a region are already allocated. More... | |
virtual bool | lookup (Addr vaddr, TheISA::TlbEntry &entry)=0 |
Lookup function. More... | |
bool | translate (Addr vaddr, Addr &paddr) |
Translate function. More... | |
bool | translate (Addr vaddr) |
Simplified translate function (just check for translation) More... | |
Fault | translate (RequestPtr req) |
Perform a translation on the memory request, fills in paddr field of req. More... | |
void | updateCache (Addr vaddr, TheISA::TlbEntry entry) |
Update the page table cache. More... | |
void | eraseCacheEntry (Addr vaddr) |
Erase an entry from the page table cache. More... | |
virtual void | getMappings (std::vector< std::pair< Addr, Addr >> *addr_mappings) |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
virtual void | serialize (CheckpointOut &cp) const =0 |
Serialize an object. More... | |
virtual void | unserialize (CheckpointIn &cp)=0 |
Unserialize an object. More... | |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Protected Attributes | |
struct cacheElement | pTableCache [3] |
const Addr | pageSize |
const Addr | offsetMask |
const uint64_t | pid |
const std::string | _name |
Additional Inherited Members | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
Declaration of base class for page table.
Definition at line 57 of file page_table.hh.
enum PageTableBase::MappingFlags : uint32_t |
Enumerator | |
---|---|
Zero | |
Clobber | |
NotPresent | |
Uncacheable | |
ReadOnly |
Definition at line 96 of file page_table.hh.
|
inline |
Definition at line 76 of file page_table.hh.
References isPowerOf2(), pageSize, pTableCache, and PageTableBase::cacheElement::valid.
|
inlinevirtual |
Definition at line 87 of file page_table.hh.
|
inline |
Erase an entry from the page table cache.
vaddr | virtual address (page aligned) to check |
Definition at line 186 of file page_table.hh.
References pTableCache, and PageTableBase::cacheElement::valid.
Referenced by FuncPageTable::map(), FuncPageTable::remap(), and FuncPageTable::unmap().
|
inlinevirtual |
Reimplemented in FuncPageTable.
Definition at line 198 of file page_table.hh.
Referenced by Process::clone().
|
pure virtual |
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
Referenced by Process::initState().
|
pure virtual |
Check if any pages in a region are already allocated.
vaddr | The starting virtual address of the region. |
size | The length of the region. |
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
|
pure virtual |
Lookup function.
vaddr | The virtual address. |
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
Referenced by SparcISA::RemoteGDB::acc(), MipsISA::RemoteGDB::acc(), PowerISA::RemoteGDB::acc(), RiscvISA::RemoteGDB::acc(), X86ISA::RemoteGDB::acc(), ArmISA::RemoteGDB::acc(), AlphaISA::NDtbMissFault::invoke(), SparcISA::FastInstructionAccessMMUMiss::invoke(), SparcISA::FastDataAccessMMUMiss::invoke(), AlphaISA::ItbPageFault::invoke(), X86ISA::GpuTLB::CpuSidePort::recvFunctional(), and translate().
|
pure virtual |
Maps a virtual memory region to a physical memory region.
vaddr | The starting virtual address of the region. |
paddr | The starting physical address where the region is mapped. |
size | The length of the region. |
flags | Generic mapping flags that can be set by or-ing values from MappingFlags enum. |
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
Referenced by Process::allocateMem(), Process::map(), and Process::replicatePage().
|
inline |
Definition at line 107 of file page_table.hh.
References _name.
Definition at line 109 of file page_table.hh.
References offsetMask.
Referenced by SparcISA::FastInstructionAccessMMUMiss::invoke(), SparcISA::FastDataAccessMMUMiss::invoke(), FuncPageTable::lookup(), X86ISA::GpuTLB::CpuSidePort::recvFunctional(), and translate().
Definition at line 110 of file page_table.hh.
References offsetMask.
Referenced by FuncPageTable::isUnmapped(), FuncPageTable::map(), FuncPageTable::remap(), translate(), and FuncPageTable::unmap().
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
Referenced by mremapFunc().
Translate function.
vaddr | The virtual address. |
paddr | Physical address from translation. |
Definition at line 173 of file page_table.cc.
References DPRINTF, lookup(), pageOffset(), and X86ISA::TlbEntry().
Referenced by brkFunc(), Process::clone(), ComputeUnit::sendRequest(), translate(), GenericTLB::translateAtomic(), RiscvISA::TLB::translateData(), MipsISA::TLB::translateData(), PowerISA::TLB::translateData(), RiscvISA::TLB::translateInst(), MipsISA::TLB::translateInst(), PowerISA::TLB::translateInst(), ArmISA::TLB::translateSe(), SETranslatingPortProxy::tryMemsetBlob(), SETranslatingPortProxy::tryReadBlob(), SETranslatingPortProxy::tryReadString(), SETranslatingPortProxy::tryWriteBlob(), and SETranslatingPortProxy::tryWriteString().
|
inline |
Simplified translate function (just check for translation)
vaddr | The virtual address. |
Definition at line 153 of file page_table.hh.
References translate().
Referenced by translate().
Fault PageTableBase::translate | ( | RequestPtr | req | ) |
Perform a translation on the memory request, fills in paddr field of req.
req | The memory request. |
Definition at line 186 of file page_table.cc.
References Request::getSize(), Request::getVaddr(), NoFault, pageAlign(), pageSize, panic, Request::setPaddr(), and translate().
|
pure virtual |
Implemented in FuncPageTable, and MultiLevelPageTable< ISAOps >.
Referenced by mremapFunc().
|
inline |
Update the page table cache.
vaddr | virtual address (page aligned) to check |
pte | page table entry to return |
Definition at line 167 of file page_table.hh.
References PageTableBase::cacheElement::entry, pTableCache, PageTableBase::cacheElement::vaddr, MipsISA::vaddr, and PageTableBase::cacheElement::valid.
Referenced by FuncPageTable::lookup(), FuncPageTable::map(), and FuncPageTable::remap().
|
protected |
Definition at line 72 of file page_table.hh.
Referenced by name().
|
protected |
Definition at line 69 of file page_table.hh.
Referenced by pageAlign(), and pageOffset().
|
protected |
Definition at line 68 of file page_table.hh.
Referenced by FuncPageTable::isUnmapped(), FuncPageTable::map(), PageTableBase(), FuncPageTable::remap(), translate(), and FuncPageTable::unmap().
|
protected |
Definition at line 71 of file page_table.hh.
Referenced by FuncPageTable::map().
|
protected |
Definition at line 66 of file page_table.hh.
Referenced by eraseCacheEntry(), FuncPageTable::lookup(), PageTableBase(), and updateCache().