|
The Pedigree Project 0.1
|
#include <VirtualAddressSpace.h>
Inheritance diagram for X64VirtualAddressSpace:
Collaboration diagram for X64VirtualAddressSpace:Public Member Functions | |
| virtual bool | isAddressValid (void *virtualAddress) |
| virtual bool | isMapped (void *virtualAddress) |
| virtual size_t | runtimeMappingPages (uintptr_t base, size_t length) |
| virtual bool | map (physical_uintptr_t physAddress, void *virtualAddress, size_t flags) |
| bool | tryMapUserPage (physical_uintptr_t physical, void *address, size_t flags, size_t *committedTablePages=nullptr) override |
| bool | tryDetachUserPage (void *address, physical_uintptr_t expected) override |
| virtual bool | mapHuge (physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags) |
| virtual bool | getMapping (void *virtualAddress, physical_uintptr_t &physAddress, size_t &flags) |
| virtual bool | handleCopyOnWriteFault (void *virtualAddress, bool userMode) |
| ResidentCopyStatus | copyResidentUserPage (uintptr_t userAddress, void *kernelBuffer, size_t bytes, bool write) override |
| virtual bool | tryWriteUser32 (uintptr_t address, uint32_t value) |
| virtual bool | tryReadUser32 (uintptr_t address, uint32_t &value) |
| virtual bool | tryReadUserPointer (uintptr_t address, uintptr_t &value) |
| virtual bool | tryCompareExchangeUser32 (uintptr_t address, uint32_t &expected, uint32_t desired, bool &exchanged) |
| virtual void | setFlags (void *virtualAddress, size_t newFlags) |
| MUST_USE_RESULT bool | trySetFlags (void *virtualAddress, size_t newFlags) override |
| virtual void | unmap (void *virtualAddress) |
| virtual bool | detachMapping (void *virtualAddress, physical_uintptr_t &physical, size_t &flags, size_t requiredFlags=0) |
| RemapStatus | prepareRemap (const PageRemapRequest &request, UniquePointer< PreparedPageRemap > &plan) override |
| void | setRemapPreparationFailureForTest (ssize_t allocations) override |
| virtual Stack * | allocateStack () |
| virtual Stack * | allocateStack (size_t stackSz) |
| virtual void | freeStack (Stack *pStack) |
| virtual bool | memIsInKernelHeap (void *pMem) |
| virtual bool | memIsInHeap (void *pMem) |
| virtual void * | getEndOfHeap () |
| virtual VirtualAddressSpace * | clone (bool copyOnWrite=true) |
| virtual void | revertToKernelAddressSpace () |
| bool | mapPageStructures (physical_uintptr_t physAddress, void *virtualAddress, size_t flags) |
| bool | mapPageStructuresAbove4GB (physical_uintptr_t physAddress, void *virtualAddress, size_t flags) |
| virtual | ~X64VirtualAddressSpace () |
| virtual uintptr_t | getKernelStart () const |
| virtual uintptr_t | getUserStart () const |
| virtual uintptr_t | getUserReservedStart () const |
| virtual uintptr_t | getDynamicLinkerAddress () const |
| virtual uintptr_t | getKernelHeapStart () const |
| virtual uintptr_t | getKernelHeapEnd () const |
| virtual uintptr_t | getDynamicStart () const |
| virtual uintptr_t | getDynamicEnd () const |
| virtual uintptr_t | getGlobalInfoBlock () const |
| virtual uintptr_t | getKernelCacheStart () const |
| virtual uintptr_t | getKernelCacheEnd () const |
| virtual uintptr_t | getKernelEventBlockStart () const |
| virtual uintptr_t | getKernelModulesStart () const |
| virtual uintptr_t | getKernelModulesEnd () const |
| virtual uintptr_t | getKernelVirtualPagestack () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd1 () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd2 () const |
Public Member Functions inherited from VirtualAddressSpace | |
| RawUserMemory & | rawUserMemory () |
| MemoryLockAccount * | memoryLockAccount () const |
| void | setMemoryLockAccount (MemoryLockAccount *account) |
| UserMemoryPolicy * | userMemoryPolicy () const |
| void | setUserMemoryPolicy (UserMemoryPolicy *policy) |
| virtual void * | expandHeap (ssize_t incr, size_t flags) |
| virtual | ~VirtualAddressSpace () |
| void | setHeap (void *heap, void *heapEnd) |
Private Member Functions | |
| bool | tryAccessUserWord (uintptr_t address, size_t width, uintptr_t &value, const uintptr_t *replacement) |
| X64VirtualAddressSpace () | |
| X64VirtualAddressSpace (void *Heap, physical_uintptr_t PhysicalPML4, void *VirtualStack) | |
| X64VirtualAddressSpace (const X64VirtualAddressSpace &) | |
| X64VirtualAddressSpace & | operator= (const X64VirtualAddressSpace &) |
| bool | getPageTableEntry (void *virtualAddress, uint64_t *&pageTableEntry) const |
| size_t | detachEmptyTables (void *virtualAddress, physical_uintptr_t *detachedTables) |
| bool | invalidateMapping (void *virtualAddress, X64MappingMutationScope &mutation) |
| uint64_t | toFlags (size_t flags, void *virtualAddress, bool bFinal=false) const PURE |
| size_t | fromFlags (uint64_t Flags, bool bFinal=false) const PURE |
| bool | conditionalTableEntryAllocation (uint64_t *tableEntry, uint64_t flags) |
| bool | conditionalTableEntryMapping (uint64_t *tableEntry, uint64_t physAddress, uint64_t flags) |
| bool | mapUnlocked (physical_uintptr_t physAddress, void *virtualAddress, size_t flags, X64MappingMutationScope &mutation, bool locked=false) |
| bool | unmapUnlocked (void *virtualAddress, X64MappingMutationScope &mutation, bool requireMapped=true) |
| Stack * | doAllocateStack (size_t sSize) |
| Stack * | allocateTrackedUserStack (size_t size) |
Private Attributes | |
| physical_uintptr_t | m_PhysicalPML4 |
| Atomic< uint64_t > | m_ResidentProcessors |
| ssize_t | m_RemapPreparationFailure = -1 |
| void * | m_pStackTop |
| Vector< Stack * > | m_freeStacks |
| bool | m_bKernelSpace |
| Spinlock | m_Lock |
| Spinlock | m_StacksLock |
Static Private Attributes | |
| static X64VirtualAddressSpace | m_KernelSpace |
Friends | |
| class | ProcessorBase |
| class | Multiprocessor |
| class | X64PreparedPageRemap |
| VirtualAddressSpace & | VirtualAddressSpace::getKernelAddressSpace () |
| VirtualAddressSpace * | VirtualAddressSpace::create () |
Additional Inherited Members | |
Public Types inherited from VirtualAddressSpace | |
| enum class | ResidentCopyStatus { Success , Inaccessible , Unsupported } |
| enum class | RemapStatus { Success , InvalidRange , Unsupported , NoMemory , Retry } |
| using | RemapAdmission = bool(*)(void *context) |
Static Public Member Functions inherited from VirtualAddressSpace | |
| static EXPORTED_PUBLIC VirtualAddressSpace & | getKernelAddressSpace () |
| static VirtualAddressSpace * | create () |
Public Attributes inherited from VirtualAddressSpace | |
| void * | m_Heap |
| void * | m_HeapEnd |
Static Public Attributes inherited from VirtualAddressSpace | |
| static const size_t | KernelMode = 0x01 |
| static const size_t | Write = 0x02 |
| static const size_t | Execute = 0x04 |
| static const size_t | WriteThrough = 0x08 |
| static const size_t | CacheDisable = 0x10 |
| static const size_t | CopyOnWrite = 0x20 |
| static const size_t | Swapped = 0x40 |
| static const size_t | Shared = 0x200 |
| static const size_t | WriteCombine = 0x400 |
| static const size_t | Accessed = 0x800 |
| static const size_t | Dirty = 0x1000 |
| static const size_t | ClearDirty = 0x2000 |
| static const size_t | NoAccess = 0x4000 |
| static const size_t | WriteProtected = 0x8000 |
| static const size_t | Borrowed = 0x10000 |
| static const size_t | RuntimeMapping = 0x20000 |
| static constexpr size_t | MaximumRemapPages = 65536 |
| static physical_uintptr_t | m_ZeroPage = 0 |
Protected Member Functions inherited from VirtualAddressSpace | |
| bool | admitRawMemoryChange (const PreparedMemoryLock &plan, bool privileged, MemoryLockCharge &charge) const |
| void | commitRawMemoryChange (PreparedMemoryLock &plan, MemoryLockCharge charge) |
| bool | prepareZeroPage () |
| VirtualAddressSpace (void *Heap) | |
Protected Attributes inherited from VirtualAddressSpace | |
| uint64_t | m_HeapRegionId = 0 |
The X64VirtualAddressSpace implements the VirtualAddressSpace class for the x64 processor architecture, that means it wraps around the processor's paging functionality.
Definition at line 87 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
virtual |
The destructor cleans up the address space
Definition at line 1229 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::freePage(), PhysicalMemoryManager::instance(), m_bKernelSpace, m_PhysicalPML4, m_ResidentProcessors, and revertToKernelAddressSpace().
|
private |
The default constructor
Definition at line 1244 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::allocatePage(), PhysicalMemoryManager::instance(), m_KernelSpace, m_PhysicalPML4, and physicalAddress().
|
private |
The constructor for already present paging structures
| [in] | Heap | virtual address of the beginning of the heap |
| [in] | PhysicalPageDirectory | physical address of the page directory |
| [in] | VirtualStack | virtual address of the top of the next kernel stack |
Definition at line 1265 of file x64/VirtualAddressSpace.cc.
|
private |
The copy-constructor
|
virtual |
Allocates a single stack for a thread. Will use the default kernel thread size.
Implements VirtualAddressSpace.
Definition at line 1020 of file x64/VirtualAddressSpace.cc.
References doAllocateStack(), and m_KernelSpace.
Referenced by allocateStack().
Here is the caller graph for this function:
|
virtual |
Allocates a single stack of the given size for a thread.
Reimplemented from VirtualAddressSpace.
Definition at line 1027 of file x64/VirtualAddressSpace.cc.
References allocateStack(), and doAllocateStack().
|
private |
Definition at line 1105 of file x64/VirtualAddressSpace.cc.
|
virtual |
Clone this VirtualAddressSpace. That means that we copy-on-write-map the application * image. *
| [in] | copyOnWrite | whether the new address space copies pages on write, or shares them with the parent address space. |
Implements VirtualAddressSpace.
Definition at line 650 of file x64/VirtualAddressSpace.cc.
References Spinlock::acquire(), Vector< T >::begin(), VirtualAddressSpace::create(), Vector< T >::end(), fromFlags(), PhysicalMemoryManager::instance(), invalidateMapping(), m_freeStacks, VirtualAddressSpace::m_Heap, VirtualAddressSpace::m_HeapEnd, m_Lock, m_PhysicalPML4, m_pStackTop, m_StacksLock, mapUnlocked(), physicalAddress(), PhysicalMemoryManager::pin(), Vector< T >::pushBack(), and Spinlock::release().
|
private |
Allocate and map the table entry if none is present
| [in] | tableEntry | pointer to the current table entry |
| [in] | flags | flags that are used for the mapping |
Definition at line 1542 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::allocatePage(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), physicalAddress(), and toFlags().
Referenced by mapHuge(), and mapUnlocked().
Here is the caller graph for this function:
|
private |
map the table entry if none is present
| [in] | tableEntry | pointer to the current table entry |
| [in] | physAddress | physical address of the page used as the table |
| [in] | flags | flags that are used for the mapping |
Definition at line 1577 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::getPageSize(), physicalAddress(), and toFlags().
Referenced by mapPageStructures().
Here is the caller graph for this function:
|
overridevirtual |
One-page, no-fault copy with a resident nonpageable kernel buffer.
Reimplemented from VirtualAddressSpace.
Definition at line 434 of file x64/VirtualAddressSpace.cc.
References getKernelStart(), PhysicalMemoryManager::getPageSize(), getUserStart(), m_Lock, m_PhysicalPML4, and physicalAddress().
|
private |
Detach empty paging structures for the given address without freeing their physical storage.
The caller invalidates the address before releasing the returned pages, so no processor can retain a paging-structure-cache reference into reused storage.
Definition at line 1337 of file x64/VirtualAddressSpace.cc.
References Process::getAddressSpace(), Thread::getParent(), ProcessorBase::information(), and m_PhysicalPML4.
|
virtual |
Atomically snapshot and detach a resident mapping. A flags mismatch leaves the mapping intact, but still returns its physical address and flags.
Reimplemented from VirtualAddressSpace.
Definition at line 602 of file x64/VirtualAddressSpace.cc.
References fromFlags(), getPageTableEntry(), m_Lock, and unmapUnlocked().
|
private |
Allocates a stack with a given size.
Definition at line 1033 of file x64/VirtualAddressSpace.cc.
References Spinlock::acquire(), PhysicalMemoryManager::allocatePage(), VirtualAddressSpace::CopyOnWrite, Vector< T >::count(), ProcessorBase::getInterrupts(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), VirtualAddressSpace::KernelMode, m_freeStacks, m_KernelSpace, m_Lock, m_pStackTop, m_StacksLock, map(), PhysicalMemoryManager::pin(), Vector< T >::popBack(), Spinlock::release(), and VirtualAddressSpace::Write.
Referenced by allocateStack(), and allocateStack().
Here is the caller graph for this function:
|
virtual |
Frees a stack allocated with allocateStack.
Implements VirtualAddressSpace.
Definition at line 1187 of file x64/VirtualAddressSpace.cc.
References Spinlock::acquire(), PhysicalMemoryManager::freePage(), getMapping(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), isMapped(), m_freeStacks, m_StacksLock, Vector< T >::pushBack(), Spinlock::release(), and unmap().
|
private |
Convert processor's representation of the flags to the processor independant representation
| [in] | Flags | the processor specific flag representation |
| [in] | bFinal | whether this is for the actual page or just an intermediate PTE/PDE |
Definition at line 1505 of file x64/VirtualAddressSpace.cc.
References VirtualAddressSpace::Accessed, VirtualAddressSpace::Borrowed, VirtualAddressSpace::CacheDisable, VirtualAddressSpace::CopyOnWrite, VirtualAddressSpace::Dirty, VirtualAddressSpace::Execute, VirtualAddressSpace::KernelMode, VirtualAddressSpace::NoAccess, VirtualAddressSpace::RuntimeMapping, VirtualAddressSpace::Shared, VirtualAddressSpace::Swapped, VirtualAddressSpace::Write, VirtualAddressSpace::WriteCombine, VirtualAddressSpace::WriteProtected, and VirtualAddressSpace::WriteThrough.
Referenced by clone(), detachMapping(), and getMapping().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the end of dynamic memory mapping area.
Reimplemented from VirtualAddressSpace.
Definition at line 198 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by prepareRemap().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the dynamic linker in the address space.
Implements VirtualAddressSpace.
Definition at line 178 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the start of dynamic memory mapping area.
Reimplemented from VirtualAddressSpace.
Definition at line 193 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by prepareRemap().
Here is the caller graph for this function:
|
virtual |
Gets a pointer to the byte after the end of the heap.
Implements VirtualAddressSpace.
Definition at line 85 of file x64/VirtualAddressSpace.cc.
References VirtualAddressSpace::m_Heap, and VirtualAddressSpace::m_HeapEnd.
Referenced by memIsInHeap().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the global info block location.
Reimplemented from VirtualAddressSpace.
Definition at line 203 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the end of the kernel's cache region.
Implements VirtualAddressSpace.
Definition at line 213 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the start of the kernel's cache region.
Implements VirtualAddressSpace.
Definition at line 208 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the start of the kernel's event handling block.
Implements VirtualAddressSpace.
Definition at line 218 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the end of the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 188 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the start of the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 183 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the end of the kernel's module region.
Implements VirtualAddressSpace.
Definition at line 228 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the start of the kernel's module region.
Implements VirtualAddressSpace.
Definition at line 223 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets start address of the kernel in the address space.
Implements VirtualAddressSpace.
Definition at line 163 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by copyResidentUserPage(), and tryWriteUser32().
Here is the caller graph for this function:
|
inlinevirtual |
Gets address of the physical page stack, if one exists.
Reimplemented from VirtualAddressSpace.
Definition at line 233 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the first additional page stack, if one exists.
Reimplemented from VirtualAddressSpace.
Definition at line 238 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
inlinevirtual |
Gets address of the second additional page stack, if one exists.
Reimplemented from VirtualAddressSpace.
Definition at line 243 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
virtual |
Query the physical address and flags of a mapped or swapped-out page. Returns false without modifying the outputs when no mapping exists. The result does not pin the page; callers must protect its lifetime while using the returned physical address.
Implements VirtualAddressSpace.
Definition at line 314 of file x64/VirtualAddressSpace.cc.
References fromFlags(), and getPageTableEntry().
Referenced by freeStack().
Here is the caller graph for this function:
|
private |
Get the page table entry, if it exists and check whether a page is mapped or marked as swapped out.
| [in] | virtualAddress | the virtual address |
| [out] | pageTableEntry | pointer to the page table entry |
Definition at line 1276 of file x64/VirtualAddressSpace.cc.
References m_PhysicalPML4.
Referenced by detachMapping(), getMapping(), handleCopyOnWriteFault(), setFlags(), trySetFlags(), tryWriteUser32(), and unmapUnlocked().
Here is the caller graph for this function:
|
inlinevirtual |
Gets start address of reserved areas of the userpace address space.
Implements VirtualAddressSpace.
Definition at line 173 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by prepareRemap().
Here is the caller graph for this function:
|
inlinevirtual |
Gets start address of the region usable and cloneable for userspace.
Implements VirtualAddressSpace.
Definition at line 168 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by copyResidentUserPage(), prepareRemap(), and tryWriteUser32().
Here is the caller graph for this function:
|
virtual |
Resolve a write-protection fault on a copy-on-write mapping.
The replacement page is initialised before it becomes visible. Concurrent callers revalidate the mapping and treat an already-writable replacement as a successfully handled stale fault when the faulting privilege level may access it.
| [in] | userMode | true when the faulting access came from user mode. |
Implements VirtualAddressSpace.
Definition at line 330 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::allocatePage(), PhysicalMemoryManager::freePage(), PhysicalMemoryManager::getPageSize(), getPageTableEntry(), PhysicalMemoryManager::instance(), invalidateMapping(), m_Lock, page_align(), and physicalAddress().
|
private |
Invalidate an address under a lease acquired before its first PTE write. Private address spaces have no processor-residency mask to narrow the destination set safely.
Definition at line 1314 of file x64/VirtualAddressSpace.cc.
References Process::getAddressSpace(), Thread::getParent(), ProcessorBase::information(), m_bKernelSpace, and m_ResidentProcessors.
Referenced by clone(), X64PreparedPageRemap::commit(), handleCopyOnWriteFault(), mapHuge(), mapUnlocked(), revertToKernelAddressSpace(), setFlags(), trySetFlags(), and unmapUnlocked().
Here is the caller graph for this function:
|
virtual |
Is a particular virtual address valid?
| [in] | virtualAddress | the virtual address to check |
Implements VirtualAddressSpace.
Definition at line 94 of file x64/VirtualAddressSpace.cc.
|
virtual |
Checks whether a mapping the the specific virtual address exists. Pages marked as swapped out are not considered mapped; retained NoAccess pages are.
| [in] | virtualAddress | the virtual address |
Implements VirtualAddressSpace.
Definition at line 101 of file x64/VirtualAddressSpace.cc.
References m_Lock, and m_PhysicalPML4.
Referenced by freeStack().
Here is the caller graph for this function:
|
virtual |
Map a specific physical page (of size PhysicalMemoryManager::getPageSize()) at a specific location into the virtual address space.
| [in] | physicalAddress | the address of the physical page that should be mapped into the virtual address space. |
| [in] | virtualAddress | the virtual address at which the page apears within the virtual address space. |
| [in] | flags | flags that describe which accesses should be allowed on the page. |
Implements VirtualAddressSpace.
Definition at line 139 of file x64/VirtualAddressSpace.cc.
References m_Lock, and mapUnlocked().
Referenced by doAllocateStack().
Here is the caller graph for this function:
|
virtual |
Map a region of memory using the largest possible frame size. Where possible the largest page size should be used, degrading into smaller page sizes as needed (e.g. 1 GB, 2 MB, 4K) to reduce the overhead of the mapping on the system. Default implementation calls map() in a loop.
Reimplemented from VirtualAddressSpace.
Definition at line 151 of file x64/VirtualAddressSpace.cc.
References conditionalTableEntryAllocation(), PhysicalMemoryManager::freePage(), PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), invalidateMapping(), m_Lock, m_PhysicalPML4, VirtualAddressSpace::mapHuge(), mapHuge(), toFlags(), and unmapUnlocked().
Referenced by mapHuge().
Here is the caller graph for this function:| bool X64VirtualAddressSpace::mapPageStructures | ( | physical_uintptr_t | physAddress, |
| void * | virtualAddress, | ||
| size_t | flags | ||
| ) |
Map the page directory pointer table, the page directory, the page table or the page frame if none is currently present
| [in] | physAddress | the physical page that should be used as page table or page frame |
| [in] | virtualAddress | the virtual address that should be checked for the existance of a page directory pointer table, page directory, page table or page frame |
| [in] | flags | the flags used for the mapping |
Definition at line 899 of file x64/VirtualAddressSpace.cc.
References conditionalTableEntryMapping(), ProcessorBase::m_Initialised, m_Lock, m_PhysicalPML4, panic(), and toFlags().
Referenced by X86CommonPhysicalMemoryManager::PageStack::maybeMap().
Here is the caller graph for this function:| bool X64VirtualAddressSpace::mapPageStructuresAbove4GB | ( | physical_uintptr_t | physAddress, |
| void * | virtualAddress, | ||
| size_t | flags | ||
| ) |
Definition at line 945 of file x64/VirtualAddressSpace.cc.
|
private |
Perform a mapping proper, without taking the lock.
| [in] | locked | whether the lock was taken before calling or not. |
Definition at line 228 of file x64/VirtualAddressSpace.cc.
References Scheduler::acquireProcess(), conditionalTableEntryAllocation(), Process::getAddressSpace(), Scheduler::getNumProcesses(), Scheduler::instance(), invalidateMapping(), ProcessorBase::m_Initialised, m_Lock, m_PhysicalPML4, and toFlags().
Referenced by clone(), and map().
Here is the caller graph for this function:
|
virtual |
Determines if a given point is within the virtual address space region dedicated to the kernel heap.
Implements VirtualAddressSpace.
Definition at line 74 of file x64/VirtualAddressSpace.cc.
References getEndOfHeap(), and VirtualAddressSpace::m_Heap.
|
virtual |
Determines whether a given address is within the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 64 of file x64/VirtualAddressSpace.cc.
|
private |
The copy-constructor
|
overridevirtual |
Preparation changes no live leaf or reservation; Retry changes neither.
Reimplemented from VirtualAddressSpace.
Definition at line 270 of file VirtualAddressSpace-remap.cc.
References UniquePointer< T >::adopt(), getDynamicEnd(), getDynamicStart(), getUserReservedStart(), getUserStart(), and m_bKernelSpace.
|
virtual |
Undo a clone() - this happens when an application is Exec()'d - we destroy all mappings not in the kernel address space so the space is 'clean'.
Implements VirtualAddressSpace.
Definition at line 799 of file x64/VirtualAddressSpace.cc.
References PhysicalMemoryManager::freePage(), PhysicalMemoryManager::instance(), invalidateMapping(), VirtualAddressSpace::m_Heap, VirtualAddressSpace::m_HeapEnd, m_Lock, m_PhysicalPML4, and physicalAddress().
Referenced by ~X64VirtualAddressSpace().
Here is the caller graph for this function:
|
virtual |
Reimplemented from VirtualAddressSpace.
Definition at line 988 of file x64/VirtualAddressSpace.cc.
|
virtual |
Set the flags of the page at a specific virtual address.
| [in] | virtualAddress | the virtual address |
| [in] | newFlags | the flags |
Implements VirtualAddressSpace.
Definition at line 548 of file x64/VirtualAddressSpace.cc.
References getPageTableEntry(), invalidateMapping(), m_Lock, and toFlags().
|
inlineoverridevirtual |
One-shot failure after the given number of successful preparation allocations.
Reimplemented from VirtualAddressSpace.
Definition at line 128 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
private |
Convert the processor independant flags to the processor's representation of the flags
| [in] | flags | the processor independant flag representation |
| [in] | bFinal | whether this is for the actual page or just an intermediate PTE/PDE |
Definition at line 1453 of file x64/VirtualAddressSpace.cc.
References VirtualAddressSpace::Accessed, VirtualAddressSpace::Borrowed, VirtualAddressSpace::CacheDisable, VirtualAddressSpace::ClearDirty, VirtualAddressSpace::CopyOnWrite, VirtualAddressSpace::Dirty, VirtualAddressSpace::Execute, VirtualAddressSpace::KernelMode, VirtualAddressSpace::NoAccess, VirtualAddressSpace::RuntimeMapping, VirtualAddressSpace::Shared, VirtualAddressSpace::Swapped, VirtualAddressSpace::Write, VirtualAddressSpace::WriteCombine, VirtualAddressSpace::WriteProtected, and VirtualAddressSpace::WriteThrough.
Referenced by conditionalTableEntryAllocation(), conditionalTableEntryMapping(), mapHuge(), mapPageStructures(), mapUnlocked(), setFlags(), and trySetFlags().
Here is the caller graph for this function:
|
private |
Definition at line 474 of file x64/VirtualAddressSpace.cc.
|
virtual |
A successful access may still report a failed comparison.
Reimplemented from VirtualAddressSpace.
Definition at line 420 of file x64/VirtualAddressSpace.cc.
|
overridevirtual |
Reimplemented from VirtualAddressSpace.
Definition at line 83 of file VirtualAddressSpace-paging.cc.
|
overridevirtual |
Reimplemented from VirtualAddressSpace.
Definition at line 8 of file VirtualAddressSpace-paging.cc.
|
virtual |
Atomic, no-fault accesses through a resident userspace mapping.
Reimplemented from VirtualAddressSpace.
Definition at line 407 of file x64/VirtualAddressSpace.cc.
|
virtual |
Reimplemented from VirtualAddressSpace.
Definition at line 416 of file x64/VirtualAddressSpace.cc.
|
overridevirtual |
Changes an existing mapping, returning false without publishing failed protection.
Reimplemented from VirtualAddressSpace.
Definition at line 568 of file x64/VirtualAddressSpace.cc.
References getPageTableEntry(), invalidateMapping(), m_Lock, and toFlags().
|
virtual |
Stores one 32-bit value through a resident userspace mapping without switching into this address space. Implementations reject mappings that could fault or change backing storage while the write is in progress.
Reimplemented from VirtualAddressSpace.
Definition at line 518 of file x64/VirtualAddressSpace.cc.
References getKernelStart(), PhysicalMemoryManager::getPageSize(), getPageTableEntry(), getUserStart(), m_Lock, and physicalAddress().
|
virtual |
Remove the page at the specific virtual address from the virtual address space.
| [in] | virtualAddress | the virtual address |
Implements VirtualAddressSpace.
Definition at line 590 of file x64/VirtualAddressSpace.cc.
References m_Lock, and unmapUnlocked().
Referenced by freeStack().
Here is the caller graph for this function:
|
private |
Perform an unmap without taking the lock.
Definition at line 623 of file x64/VirtualAddressSpace.cc.
References getPageTableEntry(), and invalidateMapping().
Referenced by detachMapping(), mapHuge(), and unmap().
Here is the caller graph for this function:
|
friend |
Multiprocessor::initialise() needs access to m_PhysicalPML4
Definition at line 91 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
friend |
Processor::switchAddressSpace() needs access to m_PhysicalPML4
Definition at line 89 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
friend |
VirtualAddressSpace::create needs access to the constructor
VirtualAddressSpace::getKernelAddressSpace() needs access to m_KernelSpace
|
friend |
Definition at line 248 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
private |
Is this the kernel space?
Definition at line 338 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by invalidateMapping(), prepareRemap(), and ~X64VirtualAddressSpace().
List of free stacks
Definition at line 336 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by clone(), doAllocateStack(), and freeStack().
|
staticprivate |
The kernel virtual address space
Definition at line 345 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by allocateStack(), doAllocateStack(), and X64VirtualAddressSpace().
|
private |
Lock to guard against multiprocessor reentrancy.
Definition at line 340 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by clone(), X64PreparedPageRemap::commit(), copyResidentUserPage(), detachMapping(), doAllocateStack(), handleCopyOnWriteFault(), isMapped(), map(), mapHuge(), mapPageStructures(), mapUnlocked(), revertToKernelAddressSpace(), setFlags(), trySetFlags(), tryWriteUser32(), and unmap().
|
private |
Physical address of the Page Map Level 4
Definition at line 329 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by clone(), copyResidentUserPage(), detachEmptyTables(), getPageTableEntry(), isMapped(), mapHuge(), mapPageStructures(), mapUnlocked(), revertToKernelAddressSpace(), X64VirtualAddressSpace(), and ~X64VirtualAddressSpace().
|
private |
Current top of the stacks
Definition at line 334 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by clone(), and doAllocateStack().
|
private |
Definition at line 332 of file kernel/core/processor/x64/VirtualAddressSpace.h.
|
private |
CPUs which may retain private translations, including a switch in flight.
Definition at line 331 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by invalidateMapping(), and ~X64VirtualAddressSpace().
|
private |
Lock to guard against multiprocessor reentrancy for stack reuse.
Definition at line 342 of file kernel/core/processor/x64/VirtualAddressSpace.h.
Referenced by clone(), doAllocateStack(), and freeStack().