Files | |
file | as_pt.h |
file | asid_fifo.h |
file | page_pt.h |
file | as_pt.c |
Address space functions for 4-level hierarchical pagetables. | |
file | asid.c |
ASID management. | |
file | asid_fifo.c |
FIFO queue ASID management. | |
file | page_pt.c |
Virtual Address Translation for hierarchical 4-level page tables. | |
Defines | |
#define | FIFO_STATIC_LIMIT 1024 |
#define | FIFO_STATIC (ASIDS_ALLOCABLE<FIFO_STATIC_LIMIT) |
Functions | |
void | asid_fifo_init (void) |
static pte_t * | ptl0_create (int flags) |
static void | ptl0_destroy (pte_t *page_table) |
static void | pt_lock (as_t *as, bool lock) |
static void | pt_unlock (as_t *as, bool unlock) |
SPINLOCK_INITIALIZE (asidlock) | |
asid_t | asid_get (void) |
void | asid_put (asid_t asid) |
FIFO_INITIALIZE_STATIC (free_asids, asid_t, ASIDS_ALLOCABLE) | |
asid_t | asid_find_free (void) |
void | asid_put_arch (asid_t asid) |
static void | pt_mapping_insert (as_t *as, __address page, __address frame, int flags) |
static void | pt_mapping_remove (as_t *as, __address page) |
static pte_t * | pt_mapping_find (as_t *as, __address page) |
Variables | |
as_operations_t | as_pt_operations |
as_operations_t | as_pt_operations |
static count_t | asids_allocated = 0 |
page_mapping_operations_t | pt_mapping_operations |
|
Definition at line 49 of file asid_fifo.c. |
|
Definition at line 48 of file asid_fifo.c. |
|
Initialize data structures for O(1) ASID allocation and deallocation. Definition at line 62 of file asid_fifo.c. References ASID_START, ASIDS_ALLOCABLE, fifo_create, and fifo_push. Referenced by as_arch_init(). |
|
Allocate free ASID. Allocation runs in O(1).
Definition at line 81 of file asid_fifo.c. References fifo_pop. Referenced by asid_get(). |
|
Allocate free address space identifier. Interrupts must be disabled and inactive_as_with_asid_lock must be held prior to this call
Definition at line 83 of file asid.c. References asid_find_free(), ASID_INVALID, asidlock, ASIDS_ALLOCABLE, asids_allocated, ASSERT, list_empty(), list_get_instance, list_remove(), mutex_lock_active, mutex_unlock(), link::next, spinlock_lock, spinlock_unlock(), tlb_invalidate_asid(), TLB_INVL_ASID, tlb_shootdown_finalize(), and tlb_shootdown_start(). Referenced by as_switch(). Here is the call graph for this function: |
|
Release address space identifier. This code relies on architecture dependent functionality.
Definition at line 163 of file asid.c. References asid_put_arch(), asidlock, asids_allocated, interrupts_disable(), interrupts_restore(), spinlock_lock, and spinlock_unlock(). Referenced by as_destroy(). Here is the call graph for this function: |
|
Return ASID among free ASIDs. This operation runs in O(1).
Definition at line 92 of file asid_fifo.c. References fifo_push. Referenced by asid_put(). |
|
FIFO queue containing unassigned ASIDs. Can be only accessed when asidlock is held. |
|
Lock page tables. Lock only the address space. Interrupts must be disabled.
Definition at line 122 of file as_pt.c. References mutex_lock. |
|
Find mapping for virtual page in hierarchical page tables. Find mapping for virtual page. The page table must be locked and interrupts must be disabled.
Definition at line 244 of file page_pt.c. References NULL, and PAGE_NOT_PRESENT. |
|
Map page to frame using hierarchical page tables. Map virtual address page to physical address frame using flags. The page table must be locked and interrupts must be disabled.
Definition at line 71 of file page_pt.c. References frame_alloc, FRAME_KA, memsetb(), ONE_FRAME, PAGE_CACHEABLE, PAGE_EXEC, PAGE_NOT_PRESENT, PAGE_PRESENT, PAGE_SIZE, PAGE_USER, PAGE_WRITE, and PFN2ADDR(). Here is the call graph for this function: |
|
Remove mapping of page from hierarchical page tables. Remove any mapping of page within address space as. TLB shootdown should follow in order to make effects of this call visible. Empty page tables except PTL0 are freed. The page table must be locked and interrupts must be disabled.
Definition at line 122 of file page_pt.c. References memsetb(), and PAGE_NOT_PRESENT. Here is the call graph for this function: |
|
Unlock page tables. Unlock the address space. Interrupts must be disabled.
Definition at line 136 of file as_pt.c. References mutex_unlock(). Here is the call graph for this function: |
|
Create PTL0. PTL0 of 4-level page table will be created for each address space.
Definition at line 71 of file as_pt.c. References AS_KERNEL, frame_alloc, FRAME_KA, FRAME_PANIC, interrupts_disable(), interrupts_restore(), memcpy, memsetb(), mutex_lock, mutex_unlock(), ONE_FRAME, PAGE_SIZE, and PFN2ADDR(). Here is the call graph for this function: |
|
Destroy page table. Destroy PTL0, other levels are expected to be already deallocated.
Definition at line 109 of file as_pt.c. References ADDR2PFN(), and frame_free(). Here is the call graph for this function: |
|
asidlock protects the asids_allocated counter. |
|
Initial value: { .page_table_create = ptl0_create, .page_table_destroy = ptl0_destroy, .page_table_lock = pt_lock, .page_table_unlock = pt_unlock } Definition at line 56 of file as_pt.c. Referenced by as_arch_init(). |
|
Definition at line 56 of file as_pt.c. Referenced by as_arch_init(). |
|
Definition at line 74 of file asid.c. Referenced by asid_get(), and asid_put(). |
|
Initial value: { .mapping_insert = pt_mapping_insert, .mapping_remove = pt_mapping_remove, .mapping_find = pt_mapping_find } Definition at line 53 of file page_pt.c. Referenced by page_arch_init(). |