Lines Matching refs:ptables
294 static inline pentry_t *get_entry_ptr(pentry_t *ptables, void *virt, int level) in get_entry_ptr() argument
296 return &ptables[get_index(virt, level)]; in get_entry_ptr()
300 static inline pentry_t get_entry(pentry_t *ptables, void *virt, int level) in get_entry() argument
302 return ptables[get_index(virt, level)]; in get_entry()
368 pentry_t *ptables, void *virt) in pentry_get() argument
370 pentry_t *table = ptables; in pentry_get()
697 void z_x86_dump_page_tables(pentry_t *ptables) in z_x86_dump_page_tables() argument
699 dump_ptables(ptables, NULL, 0); in z_x86_dump_page_tables()
765 void z_x86_pentry_get(int *paging_level, pentry_t *val, pentry_t *ptables, in z_x86_pentry_get() argument
768 pentry_get(paging_level, val, ptables, virt); in z_x86_pentry_get()
776 void z_x86_dump_mmu_flags(pentry_t *ptables, void *virt) in z_x86_dump_mmu_flags() argument
781 pentry_get(&level, &entry, ptables, virt); in z_x86_dump_mmu_flags()
1004 static int page_map_set(pentry_t *ptables, void *virt, pentry_t entry_val, in page_map_set() argument
1007 pentry_t *table = ptables; in page_map_set()
1095 static int range_map_ptables(pentry_t *ptables, void *virt, uintptr_t phys, in range_map_ptables() argument
1128 ret2 = page_map_set(ptables, dest_virt, entry_val, NULL, mask, in range_map_ptables()
1206 ret2 = range_map_ptables(domain->ptables, virt, phys, size, in range_map()
1394 static bool page_validate(pentry_t *ptables, uint8_t *addr, bool write) in page_validate() argument
1396 pentry_t *table = ptables; in page_validate()
1443 pentry_t *ptables = z_x86_thread_page_tables_get(arch_current_thread()); in arch_buffer_validate() local
1454 if (!page_validate(ptables, virt + offset, write)) { in arch_buffer_validate()
1745 static int region_map_update(pentry_t *ptables, void *start, in region_map_update() argument
1755 if (ptables == z_x86_page_tables_get()) { in region_map_update()
1760 ret = range_map_ptables(ptables, start, 0, size, flags, MASK_PERM, in region_map_update()
1772 static inline int reset_region(pentry_t *ptables, void *start, size_t size) in reset_region() argument
1774 LOG_DBG("%s(%p, %p, %zu)", __func__, ptables, start, size); in reset_region()
1775 return region_map_update(ptables, start, size, 0, true); in reset_region()
1779 static inline int apply_region(pentry_t *ptables, void *start, in apply_region() argument
1782 LOG_DBG("%s(%p, %p, %zu, " PRI_ENTRY ")", __func__, ptables, start, in apply_region()
1784 return region_map_update(ptables, start, size, attr, false); in apply_region()
1788 static void set_stack_perms(struct k_thread *thread, pentry_t *ptables) in set_stack_perms() argument
1791 thread, ptables, thread->stack_info.start, in set_stack_perms()
1793 apply_region(ptables, (void *)thread->stack_info.start, in set_stack_perms()
1830 domain->arch.ptables = z_x86_kernel_ptables; in arch_mem_domain_init()
1840 domain->arch.ptables = domain->arch.pdpt; in arch_mem_domain_init()
1843 domain->arch.ptables = page_pool_get(); in arch_mem_domain_init()
1844 if (domain->arch.ptables == NULL) { in arch_mem_domain_init()
1850 LOG_DBG("copy_page_table(%p, %p, 0)", domain->arch.ptables, in arch_mem_domain_init()
1854 ret = copy_page_table(domain->arch.ptables, z_x86_kernel_ptables, 0); in arch_mem_domain_init()
1869 return reset_region(domain->arch.ptables, (void *)partition->start, in arch_mem_domain_partition_remove()
1894 return reset_region(domain->arch.ptables, in arch_mem_domain_thread_remove()
1906 return apply_region(domain->arch.ptables, (void *)partition->start, in arch_mem_domain_partition_add()
1924 pentry_t *old_ptables = UINT_TO_POINTER(thread->arch.ptables); in arch_mem_domain_thread_add()
1933 old_ptables = k_mem_virt_addr(thread->arch.ptables); in arch_mem_domain_thread_add()
1934 set_stack_perms(thread, domain->arch.ptables); in arch_mem_domain_thread_add()
1937 thread->arch.ptables = k_mem_phys_addr(domain->arch.ptables); in arch_mem_domain_thread_add()
1939 thread->arch.ptables); in arch_mem_domain_thread_add()
1961 if (thread == arch_current_thread() && thread->arch.ptables != z_x86_cr3_get()) { in arch_mem_domain_thread_add()
1962 z_x86_cr3_set(thread->arch.ptables); in arch_mem_domain_thread_add()
2170 page_map_set(domain->ptables, addr, 0, &cur_pte, in arch_page_info_get()
2232 bool z_x86_kpti_is_access_ok(void *addr, pentry_t *ptables) in z_x86_kpti_is_access_ok() argument
2237 pentry_get(&level, &pte, ptables, addr); in z_x86_kpti_is_access_ok()