Lines Matching full: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()
76 pte_update(mm, addr, pte, 0, 0, 0); in hpte_flush_range()
77 addr += PAGE_SIZE; in hpte_flush_range()
88 static void subpage_prot_clear(unsigned long addr, unsigned long len) in subpage_prot_clear() argument
103 limit = addr + len; in subpage_prot_clear()
106 for (; addr < limit; addr = next) { in subpage_prot_clear()
107 next = pmd_addr_end(addr, limit); in subpage_prot_clear()
108 if (addr < 0x100000000UL) { in subpage_prot_clear()
111 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; in subpage_prot_clear()
115 spp = spm[(addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1)]; in subpage_prot_clear()
118 spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1); in subpage_prot_clear()
120 i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); in subpage_prot_clear()
122 if (addr + (nw << PAGE_SHIFT) > next) in subpage_prot_clear()
123 nw = (next - addr) >> PAGE_SHIFT; in subpage_prot_clear()
128 hpte_flush_range(mm, addr, nw); in subpage_prot_clear()
136 static int subpage_walk_pmd_entry(pmd_t *pmd, unsigned long addr, in subpage_walk_pmd_entry() argument
140 split_huge_pmd(vma, pmd, addr); in subpage_walk_pmd_entry()
148 static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, in subpage_mark_vma_nohuge() argument
157 vma = find_vma(mm, addr); in subpage_mark_vma_nohuge()
161 if (vma && ((addr + len) <= vma->vm_start)) in subpage_mark_vma_nohuge()
165 if (vma->vm_start >= (addr + len)) in subpage_mark_vma_nohuge()
173 static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, in subpage_mark_vma_nohuge() argument
190 SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, in SYSCALL_DEFINE3() argument
205 if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) || in SYSCALL_DEFINE3()
206 addr >= mm->task_size || len >= mm->task_size || in SYSCALL_DEFINE3()
207 addr + len > mm->task_size) in SYSCALL_DEFINE3()
210 if (is_hugepage_only_range(mm, addr, len)) in SYSCALL_DEFINE3()
215 subpage_prot_clear(addr, len); in SYSCALL_DEFINE3()
238 subpage_mark_vma_nohuge(mm, addr, len); in SYSCALL_DEFINE3()
239 for (limit = addr + len; addr < limit; addr = next) { in SYSCALL_DEFINE3()
240 next = pmd_addr_end(addr, limit); in SYSCALL_DEFINE3()
242 if (addr < 0x100000000UL) { in SYSCALL_DEFINE3()
245 spm = spt->protptrs[addr >> SBP_L3_SHIFT]; in SYSCALL_DEFINE3()
250 spt->protptrs[addr >> SBP_L3_SHIFT] = spm; in SYSCALL_DEFINE3()
253 spm += (addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1); in SYSCALL_DEFINE3()
261 spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1); in SYSCALL_DEFINE3()
264 demote_segment_4k(mm, addr); in SYSCALL_DEFINE3()
267 i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); in SYSCALL_DEFINE3()
269 if (addr + (nw << PAGE_SHIFT) > next) in SYSCALL_DEFINE3()
270 nw = (next - addr) >> PAGE_SHIFT; in SYSCALL_DEFINE3()
279 hpte_flush_range(mm, addr, nw); in SYSCALL_DEFINE3()