Lines Matching refs:addr
25 unsigned long i, j, addr; in subpage_prot_free() local
37 addr = 0; in subpage_prot_free()
43 for (j = 0; j < SBP_L2_COUNT && addr < spt->maxaddr; in subpage_prot_free()
44 ++j, addr += PAGE_SIZE) in subpage_prot_free()
53 static void hpte_flush_range(struct mm_struct *mm, unsigned long addr, in hpte_flush_range() argument
63 pgd = pgd_offset(mm, addr); in hpte_flush_range()
64 p4d = p4d_offset(pgd, addr); in hpte_flush_range()
67 pud = pud_offset(p4d, addr); in hpte_flush_range()
70 pmd = pmd_offset(pud, addr); in hpte_flush_range()
73 pte = pte_offset_map_lock(mm, pmd, addr, &ptl); in hpte_flush_range()
78 pte_update(mm, addr, pte, 0, 0, 0); in hpte_flush_range()
79 addr += PAGE_SIZE; in hpte_flush_range()
90 static void subpage_prot_clear(unsigned long addr, unsigned long len) in subpage_prot_clear() argument
105 limit = addr + len; in subpage_prot_clear()
108 for (; addr < limit; addr = next) { in subpage_prot_clear()
109 next = pmd_addr_end(addr, limit); in subpage_prot_clear()
110 if (addr < 0x100000000UL) { in subpage_prot_clear()
113 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; in subpage_prot_clear()
117 spp = spm[(addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1)]; in subpage_prot_clear()
120 spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1); in subpage_prot_clear()
122 i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); in subpage_prot_clear()
124 if (addr + (nw << PAGE_SHIFT) > next) in subpage_prot_clear()
125 nw = (next - addr) >> PAGE_SHIFT; in subpage_prot_clear()
130 hpte_flush_range(mm, addr, nw); in subpage_prot_clear()
138 static int subpage_walk_pmd_entry(pmd_t *pmd, unsigned long addr, in subpage_walk_pmd_entry() argument
142 split_huge_pmd(vma, pmd, addr); in subpage_walk_pmd_entry()
151 static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, in subpage_mark_vma_nohuge() argument
155 VMA_ITERATOR(vmi, mm, addr); in subpage_mark_vma_nohuge()
161 for_each_vma_range(vmi, vma, addr + len) { in subpage_mark_vma_nohuge()
167 static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, in subpage_mark_vma_nohuge() argument
184 SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, in SYSCALL_DEFINE3() argument
199 if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) || in SYSCALL_DEFINE3()
200 addr >= mm->task_size || len >= mm->task_size || in SYSCALL_DEFINE3()
201 addr + len > mm->task_size) in SYSCALL_DEFINE3()
204 if (is_hugepage_only_range(mm, addr, len)) in SYSCALL_DEFINE3()
209 subpage_prot_clear(addr, len); in SYSCALL_DEFINE3()
232 subpage_mark_vma_nohuge(mm, addr, len); in SYSCALL_DEFINE3()
233 for (limit = addr + len; addr < limit; addr = next) { in SYSCALL_DEFINE3()
234 next = pmd_addr_end(addr, limit); in SYSCALL_DEFINE3()
236 if (addr < 0x100000000UL) { in SYSCALL_DEFINE3()
239 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; in SYSCALL_DEFINE3()
244 spt->protptrs[addr >> SBP_L3_SHIFT] = spm; in SYSCALL_DEFINE3()
247 spm += (addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1); in SYSCALL_DEFINE3()
255 spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1); in SYSCALL_DEFINE3()
258 demote_segment_4k(mm, addr); in SYSCALL_DEFINE3()
261 i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); in SYSCALL_DEFINE3()
263 if (addr + (nw << PAGE_SHIFT) > next) in SYSCALL_DEFINE3()
264 nw = (next - addr) >> PAGE_SHIFT; in SYSCALL_DEFINE3()
273 hpte_flush_range(mm, addr, nw); in SYSCALL_DEFINE3()