/kernel/linux/linux-5.10/include/asm-generic/ |
D | pgtable-nop4d.h | 9 typedef struct { pgd_t pgd; } p4d_t; member 22 static inline int pgd_none(pgd_t pgd) { return 0; } in pgd_none() argument 23 static inline int pgd_bad(pgd_t pgd) { return 0; } in pgd_bad() argument 24 static inline int pgd_present(pgd_t pgd) { return 1; } in pgd_present() argument 25 static inline void pgd_clear(pgd_t *pgd) { } in pgd_clear() argument 26 #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) 28 #define pgd_populate(mm, pgd, p4d) do { } while (0) argument 29 #define pgd_populate_safe(mm, pgd, p4d) do { } while (0) argument 36 static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) in p4d_offset() argument 38 return (p4d_t *)pgd; in p4d_offset() [all …]
|
/kernel/linux/linux-5.10/arch/x86/mm/ |
D | kasan_init_64.c | 125 static void __init kasan_populate_pgd(pgd_t *pgd, unsigned long addr, in kasan_populate_pgd() argument 132 if (pgd_none(*pgd)) { in kasan_populate_pgd() 134 pgd_populate(&init_mm, pgd, p); in kasan_populate_pgd() 137 p4d = p4d_offset(pgd, addr); in kasan_populate_pgd() 147 pgd_t *pgd; in kasan_populate_shadow() local 152 pgd = pgd_offset_k(addr); in kasan_populate_shadow() 155 kasan_populate_pgd(pgd, addr, next, nid); in kasan_populate_shadow() 156 } while (pgd++, addr = next, addr != end); in kasan_populate_shadow() 173 pgd_t *pgd; in clear_pgds() local 178 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 page *page = virt_to_page(pgd); in pgd_list_add() 100 static inline void pgd_list_del(pgd_t *pgd) in pgd_list_del() argument 102 struct page *page = virt_to_page(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_page(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 | 73 DEFINE_POPULATE(pgd_populate, pgd, p4d, init) 144 pgd_t *pgd; in sync_global_pgds_l5() local 147 pgd = (pgd_t *)page_address(page) + pgd_index(addr); in sync_global_pgds_l5() 152 if (!pgd_none(*pgd_ref) && !pgd_none(*pgd)) in sync_global_pgds_l5() 153 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref)); in sync_global_pgds_l5() 155 if (pgd_none(*pgd)) in sync_global_pgds_l5() 156 set_pgd(pgd, *pgd_ref); in sync_global_pgds_l5() 185 pgd_t *pgd; in sync_global_pgds_l4() local 189 pgd = (pgd_t *)page_address(page) + pgd_index(addr); in sync_global_pgds_l4() 190 p4d = p4d_offset(pgd, addr); in sync_global_pgds_l4() [all …]
|
/kernel/linux/linux-5.10/arch/nds32/mm/ |
D | mm-nds32.c | 43 void pgd_free(struct mm_struct *mm, pgd_t * pgd) in pgd_free() argument 48 if (!pgd) in pgd_free() 51 pmd = (pmd_t *) pgd; in pgd_free() 62 dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE); in pgd_free() 67 free_pages((unsigned long)pgd, 0); in pgd_free() 78 pgd_t *pgd; in setup_mm_for_reboot() local 84 if (current->mm && current->mm->pgd) in setup_mm_for_reboot() 85 pgd = current->mm->pgd; in setup_mm_for_reboot() 87 pgd = init_mm.pgd; in setup_mm_for_reboot() 91 p4d = p4d_offset(pgd, i << PGDIR_SHIFT); in setup_mm_for_reboot()
|
D | fault.c | 24 pgd_t *pgd; in show_pte() local 28 pr_alert("pgd = %p\n", mm->pgd); in show_pte() 29 pgd = pgd_offset(mm, addr); in show_pte() 30 pr_alert("[%08lx] *pgd=%08lx", addr, pgd_val(*pgd)); in show_pte() 37 if (pgd_none(*pgd)) in show_pte() 40 if (pgd_bad(*pgd)) { in show_pte() 45 p4d = p4d_offset(pgd, addr); in show_pte() 350 pgd_t *pgd, *pgd_k; in do_page_fault() local 356 pgd = (pgd_t *) __va(__nds32__mfsr(NDS32_SR_L1_PPTB)) + index; in do_page_fault() 357 pgd_k = init_mm.pgd + index; in do_page_fault() [all …]
|
/kernel/linux/linux-5.10/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 …]
|
/kernel/linux/linux-5.10/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 …]
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/mm/kasan/ |
D | init.c | 38 static inline bool kasan_p4d_table(pgd_t pgd) in kasan_p4d_table() argument 40 return pgd_page(pgd) == virt_to_page(lm_alias(kasan_early_shadow_p4d)); in kasan_p4d_table() 43 static inline bool kasan_p4d_table(pgd_t pgd) in kasan_p4d_table() argument 183 static int __ref zero_p4d_populate(pgd_t *pgd, unsigned long addr, in zero_p4d_populate() argument 186 p4d_t *p4d = p4d_offset(pgd, addr); in zero_p4d_populate() 235 pgd_t *pgd = pgd_offset_k(addr); in kasan_populate_early_shadow() local 254 pgd_populate(&init_mm, pgd, in kasan_populate_early_shadow() 256 p4d = p4d_offset(pgd, addr); in kasan_populate_early_shadow() 268 if (pgd_none(*pgd)) { in kasan_populate_early_shadow() 272 p = p4d_alloc(&init_mm, pgd, addr); in kasan_populate_early_shadow() [all …]
|
/kernel/linux/linux-5.10/arch/x86/kernel/ |
D | machine_kexec_32.c | 56 free_pages((unsigned long)image->arch.pgd, PGD_ALLOCATION_ORDER); in machine_kexec_free_page_tables() 57 image->arch.pgd = NULL; in machine_kexec_free_page_tables() 72 image->arch.pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, in machine_kexec_alloc_page_tables() 80 if (!image->arch.pgd || in machine_kexec_alloc_page_tables() 91 pgd_t *pgd, pmd_t *pmd, pte_t *pte, in machine_kexec_page_table_set_one() argument 97 pgd += pgd_index(vaddr); in machine_kexec_page_table_set_one() 99 if (!(pgd_val(*pgd) & _PAGE_PRESENT)) in machine_kexec_page_table_set_one() 100 set_pgd(pgd, __pgd(__pa(pmd) | _PAGE_PRESENT)); in machine_kexec_page_table_set_one() 102 p4d = p4d_offset(pgd, vaddr); in machine_kexec_page_table_set_one() 121 image->arch.pgd, pmd, image->arch.pte0, in machine_kexec_prepare_page_tables() [all …]
|
/kernel/linux/linux-5.10/arch/riscv/include/asm/ |
D | pgalloc.h | 45 pgd_t *pgd; in pgd_alloc() local 47 pgd = (pgd_t *)__get_free_page(GFP_KERNEL); in pgd_alloc() 48 if (likely(pgd != NULL)) { in pgd_alloc() 49 memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); in pgd_alloc() 51 memcpy(pgd + USER_PTRS_PER_PGD, in pgd_alloc() 52 init_mm.pgd + USER_PTRS_PER_PGD, in pgd_alloc() 55 return pgd; in pgd_alloc()
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/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_ORDER); in pgd_alloc() 24 if (unlikely(pgd == NULL)) in pgd_alloc() 27 memset(pgd, 0, PAGE_SIZE << PGD_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_ORDER); in pgd_free()
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/arch/um/kernel/ |
D | mem.c | 98 pgd_t *pgd; in fixrange_init() local 108 pgd = pgd_base + i; in fixrange_init() 110 for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) { in fixrange_init() 111 p4d = p4d_offset(pgd, vaddr); in fixrange_init() 188 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL); in pgd_alloc() local 190 if (pgd) { in pgd_alloc() 191 memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); in pgd_alloc() 192 memcpy(pgd + USER_PTRS_PER_PGD, in pgd_alloc() 196 return pgd; in pgd_alloc()
|
/kernel/linux/linux-5.10/arch/riscv/mm/ |
D | kasan_init.c | 17 pgd_t *pgd = early_pg_dir + pgd_index(KASAN_SHADOW_START); in kasan_early_init() local 33 i += PGDIR_SIZE, ++pgd) in kasan_early_init() 34 set_pgd(pgd, in kasan_early_init() 40 pgd = pgd_offset_k(KASAN_SHADOW_START); in kasan_early_init() 43 i += PGDIR_SIZE, ++pgd) in kasan_early_init() 44 set_pgd(pgd, in kasan_early_init() 67 pgd_t *pgd = pgd_offset_k(vaddr); in populate() local 80 set_pgd(&pgd[i], in populate()
|
/kernel/linux/linux-5.10/arch/csky/include/asm/ |
D | mmu_context.h | 17 #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ argument 18 setup_pgd(__pa(pgd), false) 20 #define TLBMISS_HANDLER_SETUP_PGD_KERNEL(pgd) \ argument 21 setup_pgd(__pa(pgd), true) 44 TLBMISS_HANDLER_SETUP_PGD(next->pgd); in switch_mm()
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/mm/ |
D | sparse-vmemmap.c | 195 p4d_t * __meminit vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node) in vmemmap_p4d_populate() argument 197 p4d_t *p4d = p4d_offset(pgd, addr); in vmemmap_p4d_populate() 209 pgd_t *pgd = pgd_offset_k(addr); in vmemmap_pgd_populate() local 210 if (pgd_none(*pgd)) { in vmemmap_pgd_populate() 214 pgd_populate(&init_mm, pgd, p); in vmemmap_pgd_populate() 216 return pgd; in vmemmap_pgd_populate() 223 pgd_t *pgd; in vmemmap_populate_basepages() local 230 pgd = vmemmap_pgd_populate(addr, node); in vmemmap_populate_basepages() 231 if (!pgd) in vmemmap_populate_basepages() 233 p4d = vmemmap_p4d_populate(pgd, addr, node); in vmemmap_populate_basepages()
|