/linux-6.6.21/include/asm-generic/ |
D | pgtable-nop4d.h | 9 typedef struct { pgd_t pgd; } p4d_t; member 21 static inline int pgd_none(pgd_t pgd) { return 0; } in pgd_none() argument 22 static inline int pgd_bad(pgd_t pgd) { return 0; } in pgd_bad() argument 23 static inline int pgd_present(pgd_t pgd) { return 1; } in pgd_present() argument 24 static inline void pgd_clear(pgd_t *pgd) { } in pgd_clear() argument 25 #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) 27 #define pgd_populate(mm, pgd, p4d) do { } while (0) argument 28 #define pgd_populate_safe(mm, pgd, p4d) do { } while (0) argument 35 static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) in p4d_offset() argument 37 return (p4d_t *)pgd; in p4d_offset() [all …]
|
/linux-6.6.21/arch/x86/mm/ |
D | kasan_init_64.c | 123 static void __init kasan_populate_pgd(pgd_t *pgd, unsigned long addr, in kasan_populate_pgd() argument 130 if (pgd_none(*pgd)) { in kasan_populate_pgd() 132 pgd_populate(&init_mm, pgd, p); in kasan_populate_pgd() 135 p4d = p4d_offset(pgd, addr); in kasan_populate_pgd() 145 pgd_t *pgd; in kasan_populate_shadow() local 150 pgd = pgd_offset_k(addr); in kasan_populate_shadow() 153 kasan_populate_pgd(pgd, addr, next, nid); in kasan_populate_shadow() 154 } while (pgd++, addr = next, addr != end); in kasan_populate_shadow() 171 pgd_t *pgd; in clear_pgds() local 176 pgd = pgd_offset_k(start); in clear_pgds() [all …]
|
D | pgtable.c | 93 static inline void pgd_list_add(pgd_t *pgd) in pgd_list_add() argument 95 struct ptdesc *ptdesc = virt_to_ptdesc(pgd); in pgd_list_add() 100 static inline void pgd_list_del(pgd_t *pgd) in pgd_list_del() argument 102 struct ptdesc *ptdesc = virt_to_ptdesc(pgd); in pgd_list_del() 113 static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) in pgd_set_mm() argument 115 virt_to_ptdesc(pgd)->pt_mm = mm; in pgd_set_mm() 123 static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd) in pgd_ctor() argument 131 clone_pgd_range(pgd + KERNEL_PGD_BOUNDARY, in pgd_ctor() 138 pgd_set_mm(pgd, mm); in pgd_ctor() 139 pgd_list_add(pgd); in pgd_ctor() [all …]
|
D | pti.c | 124 pgd_t __pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd) in __pti_set_user_pgtbl() argument 136 return pgd; in __pti_set_user_pgtbl() 142 kernel_to_user_pgdp(pgdp)->pgd = pgd.pgd; in __pti_set_user_pgtbl() 157 if ((pgd.pgd & (_PAGE_USER|_PAGE_PRESENT)) == (_PAGE_USER|_PAGE_PRESENT) && in __pti_set_user_pgtbl() 159 pgd.pgd |= _PAGE_NX; in __pti_set_user_pgtbl() 162 return pgd; in __pti_set_user_pgtbl() 173 pgd_t *pgd = kernel_to_user_pgdp(pgd_offset_k(address)); in pti_user_pagetable_walk_p4d() local 181 if (pgd_none(*pgd)) { in pti_user_pagetable_walk_p4d() 186 set_pgd(pgd, __pgd(_KERNPG_TABLE | __pa(new_p4d_page))); in pti_user_pagetable_walk_p4d() 188 BUILD_BUG_ON(pgd_large(*pgd) != 0); in pti_user_pagetable_walk_p4d() [all …]
|
D | init_64.c | 74 DEFINE_POPULATE(pgd_populate, pgd, p4d, init) in DEFINE_POPULATE() 150 pgd_t *pgd; in sync_global_pgds_l5() local 153 pgd = (pgd_t *)page_address(page) + pgd_index(addr); in sync_global_pgds_l5() 158 if (!pgd_none(*pgd_ref) && !pgd_none(*pgd)) in sync_global_pgds_l5() 159 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref)); in sync_global_pgds_l5() 161 if (pgd_none(*pgd)) in sync_global_pgds_l5() 162 set_pgd(pgd, *pgd_ref); in sync_global_pgds_l5() 191 pgd_t *pgd; in sync_global_pgds_l4() local 195 pgd = (pgd_t *)page_address(page) + pgd_index(addr); in sync_global_pgds_l4() 196 p4d = p4d_offset(pgd, addr); in sync_global_pgds_l4() [all …]
|
/linux-6.6.21/arch/powerpc/include/asm/book3s/64/ |
D | pgalloc.h | 39 static inline void radix__pgd_free(struct mm_struct *mm, pgd_t *pgd) in radix__pgd_free() argument 42 free_page((unsigned long)pgd); in radix__pgd_free() 44 free_pages((unsigned long)pgd, 4); in radix__pgd_free() 50 pgd_t *pgd; in pgd_alloc() local 55 pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), in pgd_alloc() 57 if (unlikely(!pgd)) in pgd_alloc() 58 return pgd; in pgd_alloc() 65 kmemleak_no_scan(pgd); in pgd_alloc() 76 memset(pgd, 0, PGD_TABLE_SIZE); in pgd_alloc() 78 return pgd; in pgd_alloc() [all …]
|
/linux-6.6.21/arch/arm/mm/ |
D | pgd.c | 21 #define __pgd_free(pgd) kfree(pgd) argument 24 #define __pgd_free(pgd) free_pages((unsigned long)pgd, 2) argument 144 pgd_t *pgd; in pgd_free() local 153 pgd = pgd_base + pgd_index(0); in pgd_free() 154 if (pgd_none_or_clear_bad(pgd)) in pgd_free() 157 p4d = p4d_offset(pgd, 0); in pgd_free() 181 pgd_clear(pgd); in pgd_free() 188 for (pgd = pgd_base; pgd < pgd_base + PTRS_PER_PGD; pgd++) { in pgd_free() 189 if (pgd_none_or_clear_bad(pgd)) in pgd_free() 191 if (pgd_val(*pgd) & L_PGD_SWAPPER) in pgd_free() [all …]
|
/linux-6.6.21/arch/riscv/include/asm/ |
D | pgtable-64.h | 347 static inline void set_pgd(pgd_t *pgdp, pgd_t pgd) in set_pgd() argument 350 *pgdp = pgd; in set_pgd() 352 set_p4d((p4d_t *)pgdp, (p4d_t){ pgd_val(pgd) }); in set_pgd() 355 static inline int pgd_none(pgd_t pgd) in pgd_none() argument 358 return (pgd_val(pgd) == 0); in pgd_none() 363 static inline int pgd_present(pgd_t pgd) in pgd_present() argument 366 return (pgd_val(pgd) & _PAGE_PRESENT); in pgd_present() 371 static inline int pgd_bad(pgd_t pgd) in pgd_bad() argument 374 return !pgd_present(pgd); in pgd_bad() 379 static inline void pgd_clear(pgd_t *pgd) in pgd_clear() argument [all …]
|
D | pgalloc.h | 62 static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, p4d_t *p4d) in pgd_populate() argument 67 set_pgd(pgd, __pgd((pfn << _PAGE_PFN_SHIFT) | _PAGE_TABLE)); in pgd_populate() 71 static inline void pgd_populate_safe(struct mm_struct *mm, pgd_t *pgd, in pgd_populate_safe() argument 77 set_pgd_safe(pgd, in pgd_populate_safe() 130 static inline void sync_kernel_mappings(pgd_t *pgd) in sync_kernel_mappings() argument 132 memcpy(pgd + USER_PTRS_PER_PGD, in sync_kernel_mappings() 133 init_mm.pgd + USER_PTRS_PER_PGD, in sync_kernel_mappings() 139 pgd_t *pgd; in pgd_alloc() local 141 pgd = (pgd_t *)__get_free_page(GFP_KERNEL); in pgd_alloc() 142 if (likely(pgd != NULL)) { in pgd_alloc() [all …]
|
/linux-6.6.21/mm/kasan/ |
D | init.c | 33 static inline bool kasan_p4d_table(pgd_t pgd) in kasan_p4d_table() argument 35 return pgd_page(pgd) == virt_to_page(lm_alias(kasan_early_shadow_p4d)); in kasan_p4d_table() 38 static inline bool kasan_p4d_table(pgd_t pgd) in kasan_p4d_table() argument 188 static int __ref zero_p4d_populate(pgd_t *pgd, unsigned long addr, in zero_p4d_populate() argument 191 p4d_t *p4d = p4d_offset(pgd, addr); in zero_p4d_populate() 241 pgd_t *pgd = pgd_offset_k(addr); in kasan_populate_early_shadow() local 260 pgd_populate(&init_mm, pgd, in kasan_populate_early_shadow() 262 p4d = p4d_offset(pgd, addr); in kasan_populate_early_shadow() 274 if (pgd_none(*pgd)) { in kasan_populate_early_shadow() 278 p = p4d_alloc(&init_mm, pgd, addr); in kasan_populate_early_shadow() [all …]
|
/linux-6.6.21/arch/x86/power/ |
D | hibernate_32.c | 30 static pmd_t *resume_one_md_table_init(pgd_t *pgd) in resume_one_md_table_init() argument 41 set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT)); in resume_one_md_table_init() 42 p4d = p4d_offset(pgd, 0); in resume_one_md_table_init() 47 p4d = p4d_offset(pgd, 0); in resume_one_md_table_init() 84 pgd_t *pgd; in resume_physical_mapping_init() local 90 pgd = pgd_base + pgd_idx; in resume_physical_mapping_init() 93 for (; pgd_idx < PTRS_PER_PGD; pgd++, pgd_idx++) { in resume_physical_mapping_init() 94 pmd = resume_one_md_table_init(pgd); in resume_physical_mapping_init() 147 pgd_t *pgd; in set_up_temporary_text_mapping() local 151 pgd = pgd_base + pgd_index(restore_jump_address); in set_up_temporary_text_mapping() [all …]
|
D | hibernate_64.c | 28 static int set_up_temporary_text_mapping(pgd_t *pgd) in set_up_temporary_text_mapping() argument 77 set_pgd(pgd + pgd_index(restore_jump_address), new_pgd); in set_up_temporary_text_mapping() 81 set_pgd(pgd + pgd_index(restore_jump_address), new_pgd); in set_up_temporary_text_mapping() 100 pgd_t *pgd; in set_up_temporary_mappings() local 104 pgd = (pgd_t *)get_safe_page(GFP_ATOMIC); in set_up_temporary_mappings() 105 if (!pgd) in set_up_temporary_mappings() 109 result = set_up_temporary_text_mapping(pgd); in set_up_temporary_mappings() 118 result = kernel_ident_mapping_init(&info, pgd, mstart, mend); in set_up_temporary_mappings() 123 temp_pgt = __pa(pgd); in set_up_temporary_mappings()
|
/linux-6.6.21/arch/sh/mm/ |
D | hugetlbpage.c | 27 pgd_t *pgd; in huge_pte_alloc() local 33 pgd = pgd_offset(mm, addr); in huge_pte_alloc() 34 if (pgd) { in huge_pte_alloc() 35 p4d = p4d_alloc(mm, pgd, addr); in huge_pte_alloc() 52 pgd_t *pgd; in huge_pte_offset() local 58 pgd = pgd_offset(mm, addr); in huge_pte_offset() 59 if (pgd) { in huge_pte_offset() 60 p4d = p4d_offset(pgd, addr); in huge_pte_offset()
|
D | fault.c | 39 pgd_t *pgd; in show_pte() local 42 pgd = mm->pgd; in show_pte() 44 pgd = get_TTB(); in show_pte() 46 if (unlikely(!pgd)) in show_pte() 47 pgd = swapper_pg_dir; in show_pte() 50 pr_alert("pgd = %p\n", pgd); in show_pte() 51 pgd += pgd_index(addr); in show_pte() 52 pr_alert("[%08lx] *pgd=%0*llx", addr, (u32)(sizeof(*pgd) * 2), in show_pte() 53 (u64)pgd_val(*pgd)); in show_pte() 61 if (pgd_none(*pgd)) in show_pte() [all …]
|
D | pgtable.c | 12 pgd_t *pgd = x; in pgd_ctor() local 14 memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); in pgd_ctor() 15 memcpy(pgd + USER_PTRS_PER_PGD, in pgd_ctor() 37 void pgd_free(struct mm_struct *mm, pgd_t *pgd) in pgd_free() argument 39 kmem_cache_free(pgd_cachep, pgd); in pgd_free()
|
/linux-6.6.21/arch/mips/mm/ |
D | hugetlbpage.c | 27 pgd_t *pgd; in huge_pte_alloc() local 32 pgd = pgd_offset(mm, addr); in huge_pte_alloc() 33 p4d = p4d_alloc(mm, pgd, addr); in huge_pte_alloc() 44 pgd_t *pgd; in huge_pte_offset() local 49 pgd = pgd_offset(mm, addr); in huge_pte_offset() 50 if (pgd_present(*pgd)) { in huge_pte_offset() 51 p4d = p4d_offset(pgd, addr); in huge_pte_offset()
|
/linux-6.6.21/arch/x86/kernel/ |
D | machine_kexec_32.c | 45 free_pages((unsigned long)image->arch.pgd, PGD_ALLOCATION_ORDER); in machine_kexec_free_page_tables() 46 image->arch.pgd = NULL; in machine_kexec_free_page_tables() 61 image->arch.pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, in machine_kexec_alloc_page_tables() 69 if (!image->arch.pgd || in machine_kexec_alloc_page_tables() 80 pgd_t *pgd, pmd_t *pmd, pte_t *pte, in machine_kexec_page_table_set_one() argument 86 pgd += pgd_index(vaddr); in machine_kexec_page_table_set_one() 88 if (!(pgd_val(*pgd) & _PAGE_PRESENT)) in machine_kexec_page_table_set_one() 89 set_pgd(pgd, __pgd(__pa(pmd) | _PAGE_PRESENT)); in machine_kexec_page_table_set_one() 91 p4d = p4d_offset(pgd, vaddr); in machine_kexec_page_table_set_one() 110 image->arch.pgd, pmd, image->arch.pte0, in machine_kexec_prepare_page_tables() [all …]
|
/linux-6.6.21/arch/parisc/include/asm/ |
D | pgalloc.h | 21 pgd_t *pgd; in pgd_alloc() local 23 pgd = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_TABLE_ORDER); in pgd_alloc() 24 if (unlikely(pgd == NULL)) in pgd_alloc() 27 memset(pgd, 0, PAGE_SIZE << PGD_TABLE_ORDER); in pgd_alloc() 29 return pgd; in pgd_alloc() 32 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) in pgd_free() argument 34 free_pages((unsigned long)pgd, PGD_TABLE_ORDER); in pgd_free()
|
/linux-6.6.21/arch/hexagon/include/asm/ |
D | pgalloc.h | 23 pgd_t *pgd; in pgd_alloc() local 25 pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); in pgd_alloc() 35 memcpy(pgd, swapper_pg_dir, PTRS_PER_PGD*sizeof(pgd_t)); in pgd_alloc() 39 mm->context.ptbase = __pa(pgd); in pgd_alloc() 41 return pgd; in pgd_alloc() 83 pmdindex = (pgd_t *)pmd - mm->pgd; in pmd_populate_kernel() 84 ppmd = (pmd_t *)current->active_mm->pgd + pmdindex; in pmd_populate_kernel()
|
/linux-6.6.21/arch/loongarch/mm/ |
D | hugetlbpage.c | 19 pgd_t *pgd; in huge_pte_alloc() local 24 pgd = pgd_offset(mm, addr); in huge_pte_alloc() 25 p4d = p4d_alloc(mm, pgd, addr); in huge_pte_alloc() 36 pgd_t *pgd; in huge_pte_offset() local 41 pgd = pgd_offset(mm, addr); in huge_pte_offset() 42 if (pgd_present(*pgd)) { in huge_pte_offset() 43 p4d = p4d_offset(pgd, addr); in huge_pte_offset()
|
/linux-6.6.21/arch/um/kernel/ |
D | mem.c | 114 pgd_t *pgd; in fixrange_init() local 124 pgd = pgd_base + i; in fixrange_init() 126 for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) { in fixrange_init() 127 p4d = p4d_offset(pgd, vaddr); in fixrange_init() 204 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL); in pgd_alloc() local 206 if (pgd) { in pgd_alloc() 207 memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); in pgd_alloc() 208 memcpy(pgd + USER_PTRS_PER_PGD, in pgd_alloc() 212 return pgd; in pgd_alloc()
|
/linux-6.6.21/arch/s390/mm/ |
D | page-states.c | 131 static void mark_kernel_p4d(pgd_t *pgd, unsigned long addr, unsigned long end) in mark_kernel_p4d() argument 138 p4d = p4d_offset(pgd, addr); in mark_kernel_p4d() 156 pgd_t *pgd; in mark_kernel_pgd() local 160 pgd = pgd_offset_k(addr); in mark_kernel_pgd() 163 if (pgd_none(*pgd)) in mark_kernel_pgd() 165 if (!pgd_folded(*pgd)) { in mark_kernel_pgd() 166 page = phys_to_page(pgd_val(*pgd)); in mark_kernel_pgd() 170 mark_kernel_p4d(pgd, addr, next); in mark_kernel_pgd() 171 } while (pgd++, addr = next, addr != MODULES_END); in mark_kernel_pgd()
|
/linux-6.6.21/arch/x86/include/asm/ |
D | pgtable_64.h | 144 pgd_t pgd; in native_set_p4d() local 151 pgd = native_make_pgd(native_p4d_val(p4d)); in native_set_p4d() 152 pgd = pti_set_user_pgtbl((pgd_t *)p4dp, pgd); in native_set_p4d() 153 WRITE_ONCE(*p4dp, native_make_p4d(native_pgd_val(pgd))); in native_set_p4d() 161 static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd) in native_set_pgd() argument 163 WRITE_ONCE(*pgdp, pti_set_user_pgtbl(pgdp, pgd)); in native_set_pgd() 166 static inline void native_pgd_clear(pgd_t *pgd) in native_pgd_clear() argument 168 native_set_pgd(pgd, native_make_pgd(0)); in native_pgd_clear()
|
/linux-6.6.21/arch/x86/platform/efi/ |
D | efi_64.c | 70 pgd_t *pgd, *efi_pgd; in efi_alloc_page_tables() local 80 pgd = efi_pgd + pgd_index(EFI_VA_END); in efi_alloc_page_tables() 81 p4d = p4d_alloc(&init_mm, pgd, EFI_VA_END); in efi_alloc_page_tables() 89 efi_mm.pgd = efi_pgd; in efi_alloc_page_tables() 97 free_page((unsigned long)pgd_page_vaddr(*pgd)); in efi_alloc_page_tables() 113 pgd_t *efi_pgd = efi_mm.pgd; in efi_sync_low_kernel_mappings() 183 pgd_t *pgd = efi_mm.pgd; in efi_setup_page_tables() local 193 if (kernel_map_pages_in_pgd(pgd, pfn, pa_memmap, num_pages, pf)) { in efi_setup_page_tables() 209 if (kernel_map_pages_in_pgd(pgd, 0x0, 0x0, 1, pf)) { in efi_setup_page_tables() 218 if (sev_es_efi_map_ghcbs(pgd)) { in efi_setup_page_tables() [all …]
|
/linux-6.6.21/arch/x86/xen/ |
D | mmu_pv.c | 94 pgdval_t xen_pgd_val(pgd_t pgd); 99 pgd_t xen_make_pgd(pgdval_t pgd); 382 __visible pgdval_t xen_pgd_val(pgd_t pgd) in xen_pgd_val() argument 384 return pte_mfn_to_pfn(pgd.pgd); in xen_pgd_val() 396 __visible pgd_t xen_make_pgd(pgdval_t pgd) in xen_make_pgd() argument 398 pgd = pte_pfn_to_mfn(pgd); in xen_make_pgd() 399 return native_make_pgd(pgd); in xen_make_pgd() 462 static pgd_t *xen_get_user_pgd(pgd_t *pgd) in xen_get_user_pgd() argument 464 pgd_t *pgd_page = (pgd_t *)(((unsigned long)pgd) & PAGE_MASK); in xen_get_user_pgd() 465 unsigned offset = pgd - pgd_page; in xen_get_user_pgd() [all …]
|