gem5  v22.1.0.0
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | List of all members
gem5::EmulationPageTable Class Reference

#include <page_table.hh>

Inheritance diagram for gem5::EmulationPageTable:
gem5::Serializable gem5::MultiLevelPageTable< EntryTypes >

Classes

struct  Entry
 
class  PageTableTranslationGen
 

Public Types

enum  MappingFlags : uint32_t { Clobber = 1 , Uncacheable = 4 , ReadOnly = 8 }
 

Public Member Functions

 EmulationPageTable (const std::string &__name, uint64_t _pid, Addr _pageSize)
 
uint64_t pid () const
 
virtual ~EmulationPageTable ()
 
virtual void initState ()
 
const std::string name () const
 
Addr pageAlign (Addr a)
 
Addr pageOffset (Addr a)
 
Addr pageSize ()
 
virtual void map (Addr vaddr, Addr paddr, int64_t size, uint64_t flags=0)
 Maps a virtual memory region to a physical memory region. More...
 
virtual void remap (Addr vaddr, int64_t size, Addr new_vaddr)
 
virtual void unmap (Addr vaddr, int64_t size)
 
virtual bool isUnmapped (Addr vaddr, int64_t size)
 Check if any pages in a region are already allocated. More...
 
const Entrylookup (Addr vaddr)
 Lookup function. More...
 
bool translate (Addr vaddr, Addr &paddr)
 Translate function. More...
 
bool translate (Addr vaddr)
 Simplified translate function (just check for translation) More...
 
TranslationGenPtr translateRange (Addr vaddr, Addr size)
 
Fault translate (const RequestPtr &req)
 Perform a translation on the memory request, fills in paddr field of req. More...
 
const std::string externalize () const
 Dump all items in the pTable, to a concatenation of strings of the form Addr:Entry;. More...
 
void getMappings (std::vector< std::pair< Addr, Addr >> *addr_mappings)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
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)
 

Public Attributes

bool shared
 

Protected Types

typedef std::unordered_map< Addr, EntryPTable
 
typedef PTable::iterator PTableItr
 

Protected Attributes

PTable pTable
 
const Addr _pageSize
 
const Addr offsetMask
 
const uint64_t _pid
 
const std::string _name
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Detailed Description

Definition at line 53 of file page_table.hh.

Member Typedef Documentation

◆ PTable

typedef std::unordered_map<Addr, Entry> gem5::EmulationPageTable::PTable
protected

Definition at line 66 of file page_table.hh.

◆ PTableItr

typedef PTable::iterator gem5::EmulationPageTable::PTableItr
protected

Definition at line 67 of file page_table.hh.

Member Enumeration Documentation

◆ MappingFlags

Enumerator
Clobber 
Uncacheable 
ReadOnly 

Definition at line 96 of file page_table.hh.

Constructor & Destructor Documentation

◆ EmulationPageTable()

gem5::EmulationPageTable::EmulationPageTable ( const std::string &  __name,
uint64_t  _pid,
Addr  _pageSize 
)
inline

Definition at line 78 of file page_table.hh.

References _pageSize, and gem5::isPowerOf2().

◆ ~EmulationPageTable()

virtual gem5::EmulationPageTable::~EmulationPageTable ( )
inlinevirtual

Definition at line 88 of file page_table.hh.

Member Function Documentation

◆ externalize()

const std::string gem5::EmulationPageTable::externalize ( ) const

Dump all items in the pTable, to a concatenation of strings of the form Addr:Entry;.

Definition at line 224 of file page_table.cc.

References pTable, and ss.

Referenced by gem5::BaseRemoteGDB::cmdDumpPageTable().

◆ getMappings()

void gem5::EmulationPageTable::getMappings ( std::vector< std::pair< Addr, Addr >> *  addr_mappings)

Definition at line 97 of file page_table.cc.

References pTable.

Referenced by gem5::Process::clone().

◆ initState()

virtual void gem5::EmulationPageTable::initState ( )
inlinevirtual

Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.

Definition at line 106 of file page_table.hh.

Referenced by gem5::doClone(), and gem5::Process::initState().

◆ isUnmapped()

bool gem5::EmulationPageTable::isUnmapped ( Addr  vaddr,
int64_t  size 
)
virtual

Check if any pages in a region are already allocated.

Parameters
vaddrThe starting virtual address of the region.
sizeThe length of the region.
Returns
True if no pages in the region are mapped.

Definition at line 120 of file page_table.cc.

References _pageSize, gem5::ArmISA::offset, pageOffset(), pTable, and gem5::MipsISA::vaddr.

Referenced by gem5::MemState::remapRegion(), and gem5::MemState::unmapRegion().

◆ lookup()

const EmulationPageTable::Entry * gem5::EmulationPageTable::lookup ( Addr  vaddr)

Lookup function.

Parameters
vaddrThe virtual address.
Returns
The page table entry corresponding to vaddr.

Definition at line 133 of file page_table.cc.

References pageAlign(), pTable, and gem5::MipsISA::vaddr.

Referenced by gem5::ArmISA::RemoteGDB::acc(), gem5::Process::allocateMem(), gem5::MemState::isUnmapped(), translate(), and gem5::X86ISA::TLB::translateFunctional().

◆ map()

void gem5::EmulationPageTable::map ( Addr  vaddr,
Addr  paddr,
int64_t  size,
uint64_t  flags = 0 
)
virtual

Maps a virtual memory region to a physical memory region.

Parameters
vaddrThe starting virtual address of the region.
paddrThe starting physical address where the region is mapped.
sizeThe length of the region.
flagsGeneric mapping flags that can be set by or-ing values from MappingFlags enum.

Reimplemented in gem5::MultiLevelPageTable< EntryTypes >.

Definition at line 48 of file page_table.cc.

References _pageSize, Clobber, DPRINTF, gem5::auxv::Entry, flags, pageOffset(), panic_if, pTable, and gem5::MipsISA::vaddr.

Referenced by gem5::Process::allocateMem(), gem5::X86ISA::X86_64Process::initState(), gem5::Process::map(), gem5::MultiLevelPageTable< EntryTypes >::map(), and gem5::Process::replicatePage().

◆ name()

const std::string gem5::EmulationPageTable::name ( ) const
inline

Definition at line 109 of file page_table.hh.

References _name.

◆ pageAlign()

Addr gem5::EmulationPageTable::pageAlign ( Addr  a)
inline

Definition at line 111 of file page_table.hh.

References gem5::ArmISA::a, and offsetMask.

Referenced by lookup(), and translate().

◆ pageOffset()

Addr gem5::EmulationPageTable::pageOffset ( Addr  a)
inline

◆ pageSize()

Addr gem5::EmulationPageTable::pageSize ( )
inline

◆ pid()

uint64_t gem5::EmulationPageTable::pid ( ) const
inline

Definition at line 86 of file page_table.hh.

References _pid.

Referenced by gem5::X86ISA::X86_64Process::initState().

◆ remap()

void gem5::EmulationPageTable::remap ( Addr  vaddr,
int64_t  size,
Addr  new_vaddr 
)
virtual

◆ serialize()

void gem5::EmulationPageTable::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 186 of file page_table.cc.

References gem5::X86ISA::count, gem5::csprintf(), gem5::paramOut(), and pTable.

Referenced by gem5::MultiLevelPageTable< EntryTypes >::serialize(), and gem5::Process::serialize().

◆ translate() [1/3]

bool gem5::EmulationPageTable::translate ( Addr  vaddr)
inline

Simplified translate function (just check for translation)

Parameters
vaddrThe virtual address.
Returns
True if translation exists

Definition at line 158 of file page_table.hh.

References translate(), and gem5::MipsISA::vaddr.

◆ translate() [2/3]

bool gem5::EmulationPageTable::translate ( Addr  vaddr,
Addr paddr 
)

Translate function.

Parameters
vaddrThe virtual address.
paddrPhysical address from translation.
Returns
True if translation exists

Definition at line 143 of file page_table.cc.

References DPRINTF, lookup(), gem5::EmulationPageTable::Entry::paddr, pageOffset(), and gem5::MipsISA::vaddr.

Referenced by gem5::Process::clone(), translate(), gem5::EmulationPageTable::PageTableTranslationGen::translate(), gem5::SparcISA::TLB::translateData(), gem5::SparcISA::TLB::translateFunctional(), and gem5::SparcISA::TLB::translateInst().

◆ translate() [3/3]

Fault gem5::EmulationPageTable::translate ( const RequestPtr req)

Perform a translation on the memory request, fills in paddr field of req.

Parameters
reqThe memory request.

Definition at line 156 of file page_table.cc.

References _pageSize, gem5::NoFault, pageAlign(), panic, and translate().

◆ translateRange()

TranslationGenPtr gem5::EmulationPageTable::translateRange ( Addr  vaddr,
Addr  size 
)
inline

Definition at line 178 of file page_table.hh.

References gem5::MipsISA::vaddr.

◆ unmap()

void gem5::EmulationPageTable::unmap ( Addr  vaddr,
int64_t  size 
)
virtual

◆ unserialize()

void gem5::EmulationPageTable::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 203 of file page_table.cc.

References gem5::X86ISA::count, gem5::csprintf(), gem5::auxv::Entry, flags, gem5::ArmISA::i, gem5::paramIn(), pTable, UNSERIALIZE_SCALAR, and gem5::MipsISA::vaddr.

Referenced by gem5::MultiLevelPageTable< EntryTypes >::unserialize(), and gem5::Process::unserialize().

Member Data Documentation

◆ _name

const std::string gem5::EmulationPageTable::_name
protected

Definition at line 74 of file page_table.hh.

Referenced by name().

◆ _pageSize

const Addr gem5::EmulationPageTable::_pageSize
protected

◆ _pid

const uint64_t gem5::EmulationPageTable::_pid
protected

Definition at line 73 of file page_table.hh.

Referenced by pid().

◆ offsetMask

const Addr gem5::EmulationPageTable::offsetMask
protected

Definition at line 71 of file page_table.hh.

Referenced by pageAlign(), and pageOffset().

◆ pTable

PTable gem5::EmulationPageTable::pTable
protected

◆ shared

bool gem5::EmulationPageTable::shared

The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:23:27 for gem5 by doxygen 1.9.1