|
The Pedigree Project 0.1
|
Inheritance diagram for Armv7VirtualAddressSpace:
Collaboration diagram for Armv7VirtualAddressSpace:Public Member Functions | |
| bool | isAddressValid (void *address) override |
| bool | isMapped (void *address) override |
| bool | map (physical_uintptr_t physical, void *address, size_t flags) override |
| 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 |
| bool | getMapping (void *address, physical_uintptr_t &physical, size_t &flags) override |
| bool | handleCopyOnWriteFault (void *address, bool userMode) override |
| void | setFlags (void *address, size_t flags) override |
| bool | trySetFlags (void *address, size_t flags) override |
| void | unmap (void *address) override |
| bool | detachMapping (void *address, physical_uintptr_t &physical, size_t &flags, size_t requiredFlags=0) override |
| Stack * | allocateStack () override |
| Stack * | allocateStack (size_t bytes) override |
| void | freeStack (Stack *stack) override |
| VirtualAddressSpace * | clone (bool copyOnWrite=true) override |
| void | revertToKernelAddressSpace () override |
| bool | memIsInKernelHeap (void *address) override |
| bool | memIsInHeap (void *address) override |
| void * | getEndOfHeap () override |
| uintptr_t | getKernelStart () const override |
| uintptr_t | getUserStart () const override |
| uintptr_t | getUserReservedStart () const override |
| uintptr_t | getDynamicLinkerAddress () const override |
| uintptr_t | getKernelHeapStart () const override |
| uintptr_t | getKernelHeapEnd () const override |
| uintptr_t | getKernelCacheStart () const override |
| uintptr_t | getKernelCacheEnd () const override |
| uintptr_t | getKernelEventBlockStart () const override |
| uintptr_t | getKernelModulesStart () const override |
| uintptr_t | getKernelModulesEnd () const override |
| uintptr_t | getGlobalInfoBlock () const override |
| uintptr_t | getDynamicStart () const override |
| uintptr_t | getDynamicEnd () const override |
| physical_uintptr_t | root () const |
Public Member Functions inherited from VirtualAddressSpace | |
| RawUserMemory & | rawUserMemory () |
| virtual size_t | runtimeMappingPages (uintptr_t, size_t) |
| MemoryLockAccount * | memoryLockAccount () const |
| void | setMemoryLockAccount (MemoryLockAccount *account) |
| UserMemoryPolicy * | userMemoryPolicy () const |
| void | setUserMemoryPolicy (UserMemoryPolicy *policy) |
| virtual void * | expandHeap (ssize_t incr, size_t flags) |
| virtual bool | mapHuge (physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags) |
| virtual ResidentCopyStatus | copyResidentUserPage (uintptr_t userAddress, void *kernelBuffer, size_t bytes, bool write) |
| 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 RemapStatus | prepareRemap (const PageRemapRequest &request, UniquePointer< PreparedPageRemap > &plan) |
| virtual void | setRemapPreparationFailureForTest (ssize_t allocations) |
| virtual | ~VirtualAddressSpace () |
| void | setHeap (void *heap, void *heapEnd) |
| virtual uintptr_t | getKernelVirtualPagestack () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd1 () const |
| virtual uintptr_t | getKernelVirtualPagestackAdd2 () const |
Private Member Functions | |
| Armv7VirtualAddressSpace (bool kernel) | |
| uint32_t * | findEntry (uintptr_t address, bool create, size_t *newTables=nullptr) |
| uint32_t * | findExistingEntry (uintptr_t address, bool *section=nullptr) const |
| bool | cloneUserTables (Armv7VirtualAddressSpace &destination, bool copyOnWrite) |
| void | freeUserTables () |
Static Private Member Functions | |
| static uint32_t | pageDescriptor (physical_uintptr_t physical, size_t flags) |
Private Attributes | |
| physical_uintptr_t | m_Root |
| uintptr_t | m_StackTop |
| Spinlock | m_Lock |
Static Private Attributes | |
| static Armv7VirtualAddressSpace | m_KernelSpace |
Friends | |
| class | ProcessorBase |
| 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 |
Definition at line 18 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
override |
Definition at line 55 of file armv7/VirtualAddressSpace.cc.
|
explicitprivate |
Definition at line 44 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
Allocates a single stack for a thread. Will use the default kernel thread size.
Implements VirtualAddressSpace.
Definition at line 286 of file armv7/VirtualAddressSpace.cc.
References allocateStack().
Referenced by allocateStack(), and allocateStack().
Here is the caller graph for this function:
|
overridevirtual |
Allocates a single stack of the given size for a thread.
Reimplemented from VirtualAddressSpace.
Definition at line 290 of file armv7/VirtualAddressSpace.cc.
References allocateStack(), detachMapping(), Armv7PhysicalMemoryManager::freePage(), VirtualAddressSpace::KernelMode, map(), and VirtualAddressSpace::Write.
|
overridevirtual |
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 409 of file armv7/VirtualAddressSpace.cc.
References clone(), VirtualAddressSpace::m_Heap, and VirtualAddressSpace::m_HeapEnd.
Referenced by clone().
Here is the caller graph for this function:
|
private |
Definition at line 344 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
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 223 of file armv7/VirtualAddressSpace.cc.
References ProcessorBase::invalidate().
Referenced by allocateStack(), freeStack(), handleCopyOnWriteFault(), and unmap().
Here is the caller graph for this function:
|
private |
Definition at line 79 of file armv7/VirtualAddressSpace.cc.
|
private |
Definition at line 67 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
Frees a stack allocated with allocateStack.
Implements VirtualAddressSpace.
Definition at line 328 of file armv7/VirtualAddressSpace.cc.
References detachMapping(), and Armv7PhysicalMemoryManager::freePage().
|
private |
Definition at line 391 of file armv7/VirtualAddressSpace.cc.
|
inlineoverridevirtual |
Gets address of the end of the dynamic memory mapping area.
Reimplemented from VirtualAddressSpace.
Definition at line 85 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the dynamic linker in the address space.
Implements VirtualAddressSpace.
Definition at line 55 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the start of the dynamic memory mapping area. This is an area in which memory mappings can be created for userspace applications. Systems that do not have room in the address space for this may return zero.
Reimplemented from VirtualAddressSpace.
Definition at line 82 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
overridevirtual |
Gets a pointer to the byte after the end of the heap.
Implements VirtualAddressSpace.
Definition at line 450 of file armv7/VirtualAddressSpace.cc.
|
inlineoverridevirtual |
Gets address of the global info block location.
Reimplemented from VirtualAddressSpace.
Definition at line 79 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the end of the kernel's cache region.
Implements VirtualAddressSpace.
Definition at line 67 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the start of the kernel's cache region.
Implements VirtualAddressSpace.
Definition at line 64 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the start of the kernel's event handling block.
Implements VirtualAddressSpace.
Definition at line 70 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the end of the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 61 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the start of the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 58 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the end of the kernel's module region.
Implements VirtualAddressSpace.
Definition at line 76 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets address of the start of the kernel's module region.
Implements VirtualAddressSpace.
Definition at line 73 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets start address of the kernel in the address space.
Implements VirtualAddressSpace.
Definition at line 46 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
overridevirtual |
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 181 of file armv7/VirtualAddressSpace.cc.
References VirtualAddressSpace::Execute, VirtualAddressSpace::KernelMode, and VirtualAddressSpace::Write.
Referenced by handleCopyOnWriteFault().
Here is the caller graph for this function:
|
inlineoverridevirtual |
Gets start address of reserved areas of the userpace address space.
Implements VirtualAddressSpace.
Definition at line 52 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
inlineoverridevirtual |
Gets start address of the region usable and cloneable for userspace.
Implements VirtualAddressSpace.
Definition at line 49 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
overridevirtual |
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 262 of file armv7/VirtualAddressSpace.cc.
References VirtualAddressSpace::Borrowed, VirtualAddressSpace::CopyOnWrite, detachMapping(), Armv7PhysicalMemoryManager::freePage(), getMapping(), VirtualAddressSpace::KernelMode, map(), VirtualAddressSpace::NoAccess, VirtualAddressSpace::Shared, VirtualAddressSpace::Swapped, VirtualAddressSpace::Write, and VirtualAddressSpace::WriteProtected.
|
overridevirtual |
Is a particular virtual address valid?
| [in] | virtualAddress | the virtual address to check |
Implements VirtualAddressSpace.
Definition at line 63 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
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 121 of file armv7/VirtualAddressSpace.cc.
References VirtualAddressSpace::Swapped.
|
overridevirtual |
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 137 of file armv7/VirtualAddressSpace.cc.
References ProcessorBase::invalidate(), and VirtualAddressSpace::KernelMode.
Referenced by allocateStack(), and handleCopyOnWriteFault().
Here is the caller graph for this function:
|
overridevirtual |
Determines if a given point is within the virtual address space region dedicated to the kernel heap.
Implements VirtualAddressSpace.
Definition at line 444 of file armv7/VirtualAddressSpace.cc.
References VirtualAddressSpace::m_Heap, and VirtualAddressSpace::m_HeapEnd.
|
overridevirtual |
Determines whether a given address is within the kernel's heap region.
Implements VirtualAddressSpace.
Definition at line 439 of file armv7/VirtualAddressSpace.cc.
|
staticprivate |
Definition at line 99 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
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 427 of file armv7/VirtualAddressSpace.cc.
References ProcessorBase::invalidate(), VirtualAddressSpace::m_Heap, and VirtualAddressSpace::m_HeapEnd.
|
inline |
Definition at line 89 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
overridevirtual |
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 217 of file armv7/VirtualAddressSpace.cc.
References panic(), and trySetFlags().
|
overridevirtual |
Reimplemented from VirtualAddressSpace.
Definition at line 245 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
Reimplemented from VirtualAddressSpace.
Definition at line 155 of file armv7/VirtualAddressSpace.cc.
|
overridevirtual |
Changes an existing mapping, returning false without publishing failed protection.
Reimplemented from VirtualAddressSpace.
Definition at line 202 of file armv7/VirtualAddressSpace.cc.
References ProcessorBase::invalidate().
Referenced by setFlags().
Here is the caller graph for this function:
|
overridevirtual |
Remove the page at the specific virtual address from the virtual address space.
| [in] | virtualAddress | the virtual address |
Implements VirtualAddressSpace.
Definition at line 254 of file armv7/VirtualAddressSpace.cc.
References detachMapping(), and panic().
|
friend |
Definition at line 19 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
staticprivate |
Definition at line 102 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
private |
Definition at line 105 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
private |
Definition at line 103 of file kernel/core/processor/armv7/VirtualAddressSpace.h.
|
private |
Definition at line 104 of file kernel/core/processor/armv7/VirtualAddressSpace.h.