Lines Matching +full:m +full:- +full:num

1 // SPDX-License-Identifier: GPL-2.0-only
25 #include <asm/pgtable-hwdef.h>
29 #define pt_dump_seq_printf(m, fmt, args...) \ argument
31 if (m) \
32 seq_printf(m, fmt, ##args); \
35 #define pt_dump_seq_puts(m, fmt) \ argument
37 if (m) \
38 seq_printf(m, fmt); \
108 .set = "MEM/NORMAL-NC",
116 .set = "MEM/NORMAL-TAGGED",
124 .num = ARRAY_SIZE(pte_bits),
128 .num = ARRAY_SIZE(pte_bits),
132 .num = ARRAY_SIZE(pte_bits),
136 .num = ARRAY_SIZE(pte_bits),
140 .num = ARRAY_SIZE(pte_bits),
145 size_t num) in dump_prot() argument
149 for (i = 0; i < num; i++, bits++) { in dump_prot()
152 if ((st->current_prot & bits->mask) == bits->val) in dump_prot()
153 s = bits->set; in dump_prot()
155 s = bits->clear; in dump_prot()
158 pt_dump_seq_printf(st->seq, " %s", s); in dump_prot()
164 if (!st->check_wx) in note_prot_uxn()
167 if ((st->current_prot & PTE_UXN) == PTE_UXN) in note_prot_uxn()
170 WARN_ONCE(1, "arm64/mm: Found non-UXN mapping at address %p/%pS\n", in note_prot_uxn()
171 (void *)st->start_address, (void *)st->start_address); in note_prot_uxn()
173 st->uxn_pages += (addr - st->start_address) / PAGE_SIZE; in note_prot_uxn()
178 if (!st->check_wx) in note_prot_wx()
180 if ((st->current_prot & PTE_RDONLY) == PTE_RDONLY) in note_prot_wx()
182 if ((st->current_prot & PTE_PXN) == PTE_PXN) in note_prot_wx()
186 (void *)st->start_address, (void *)st->start_address); in note_prot_wx()
188 st->wx_pages += (addr - st->start_address) / PAGE_SIZE; in note_prot_wx()
195 struct ptdump_pg_level *pg_level = st->pg_level; in note_page()
200 if (st->mm && ((level == 1 && mm_p4d_folded(st->mm)) || in note_page()
201 (level == 2 && mm_pud_folded(st->mm)))) in note_page()
207 if (st->level == -1) { in note_page()
208 st->level = level; in note_page()
209 st->current_prot = prot; in note_page()
210 st->start_address = addr; in note_page()
211 pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name); in note_page()
212 } else if (prot != st->current_prot || level != st->level || in note_page()
213 addr >= st->marker[1].start_address) { in note_page()
217 if (st->current_prot) { in note_page()
222 pt_dump_seq_printf(st->seq, "0x%016lx-0x%016lx ", in note_page()
223 st->start_address, addr); in note_page()
225 delta = (addr - st->start_address) >> 10; in note_page()
230 pt_dump_seq_printf(st->seq, "%9lu%c %s", delta, *unit, in note_page()
231 pg_level[st->level].name); in note_page()
232 if (st->current_prot && pg_level[st->level].bits) in note_page()
233 dump_prot(st, pg_level[st->level].bits, in note_page()
234 pg_level[st->level].num); in note_page()
235 pt_dump_seq_puts(st->seq, "\n"); in note_page()
237 if (addr >= st->marker[1].start_address) { in note_page()
238 st->marker++; in note_page()
239 pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name); in note_page()
242 st->start_address = addr; in note_page()
243 st->current_prot = prot; in note_page()
244 st->level = level; in note_page()
247 if (addr >= st->marker[1].start_address) { in note_page()
248 st->marker++; in note_page()
249 pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name); in note_page()
283 note_page(pt_st, 0, -1, pte_val(pte_zero)); in note_page_flush()
298 if (info->base_addr < TASK_SIZE_64) in ptdump_walk()
303 .marker = info->markers, in ptdump_walk()
304 .mm = info->mm, in ptdump_walk()
306 .level = -1, in ptdump_walk()
315 {info->base_addr, end}, in ptdump_walk()
321 arm64_ptdump_walk_pgd(&st.ptdump, info->mm); in ptdump_walk()
330 for (j = 0; j < kernel_pg_levels[i].num; j++) in ptdump_initialize()
344 { -1, NULL}, in ptdump_check_wx()
347 .level = -1, in ptdump_check_wx()
366 pr_warn("Checked W+X mappings: FAILED, %lu W+X pages found, %lu non-UXN pages found\n", in ptdump_check_wx()
381 struct addr_marker m[] = { in ptdump_init() local
398 { -1, NULL }, in ptdump_init()
400 static struct addr_marker address_markers[ARRAY_SIZE(m)] __ro_after_init; in ptdump_init()
402 kernel_ptdump_info.markers = memcpy(address_markers, m, sizeof(m)); in ptdump_init()