Lines Matching refs:st

192 static void note_page(struct seq_file *m, struct pg_state *st,  in note_page()  argument
204 cur = pgprot_val(st->current_prot); in note_page()
206 if (!st->level) { in note_page()
208 st->current_prot = new_prot; in note_page()
209 st->level = level; in note_page()
210 st->marker = address_markers; in note_page()
211 st->lines = 0; in note_page()
212 pt_dump_seq_printf(m, st->to_dmesg, "---[ %s ]---\n", in note_page()
213 st->marker->name); in note_page()
214 } else if (prot != cur || level != st->level || in note_page()
215 st->current_address >= st->marker[1].start_address) { in note_page()
219 pgprotval_t pr = pgprot_val(st->current_prot); in note_page()
221 if (st->check_wx && (pr & _PAGE_RW) && !(pr & _PAGE_NX)) { in note_page()
224 (void *)st->start_address, in note_page()
225 (void *)st->start_address); in note_page()
226 st->wx_pages += (st->current_address - in note_page()
227 st->start_address) / PAGE_SIZE; in note_page()
233 if (!st->marker->max_lines || in note_page()
234 st->lines < st->marker->max_lines) { in note_page()
235 pt_dump_seq_printf(m, st->to_dmesg, in note_page()
237 width, st->start_address, in note_page()
238 width, st->current_address); in note_page()
240 delta = st->current_address - st->start_address; in note_page()
245 pt_dump_cont_printf(m, st->to_dmesg, "%9lu%c ", in note_page()
247 printk_prot(m, st->current_prot, st->level, in note_page()
248 st->to_dmesg); in note_page()
250 st->lines++; in note_page()
257 if (st->current_address >= st->marker[1].start_address) { in note_page()
258 if (st->marker->max_lines && in note_page()
259 st->lines > st->marker->max_lines) { in note_page()
261 st->lines - st->marker->max_lines; in note_page()
262 pt_dump_seq_printf(m, st->to_dmesg, in note_page()
267 st->marker++; in note_page()
268 st->lines = 0; in note_page()
269 pt_dump_seq_printf(m, st->to_dmesg, "---[ %s ]---\n", in note_page()
270 st->marker->name); in note_page()
273 st->start_address = st->current_address; in note_page()
274 st->current_prot = new_prot; in note_page()
275 st->level = level; in note_page()
279 static void walk_pte_level(struct seq_file *m, struct pg_state *st, pmd_t addr, in walk_pte_level() argument
289 st->current_address = normalize_addr(P + i * PTE_LEVEL_MULT); in walk_pte_level()
290 note_page(m, st, __pgprot(prot), 4); in walk_pte_level()
297 static void walk_pmd_level(struct seq_file *m, struct pg_state *st, pud_t addr, in walk_pmd_level() argument
306 st->current_address = normalize_addr(P + i * PMD_LEVEL_MULT); in walk_pmd_level()
310 note_page(m, st, __pgprot(prot), 3); in walk_pmd_level()
312 walk_pte_level(m, st, *start, in walk_pmd_level()
316 note_page(m, st, __pgprot(0), 3); in walk_pmd_level()
329 static void walk_pud_level(struct seq_file *m, struct pg_state *st, pgd_t addr, in walk_pud_level() argument
339 st->current_address = normalize_addr(P + i * PUD_LEVEL_MULT); in walk_pud_level()
343 note_page(m, st, __pgprot(prot), 2); in walk_pud_level()
345 walk_pmd_level(m, st, *start, in walk_pud_level()
349 note_page(m, st, __pgprot(0), 2); in walk_pud_level()
386 struct pg_state st = {}; in ptdump_walk_pgd_level_core() local
390 st.to_dmesg = true; in ptdump_walk_pgd_level_core()
393 st.check_wx = checkwx; in ptdump_walk_pgd_level_core()
395 st.wx_pages = 0; in ptdump_walk_pgd_level_core()
398 st.current_address = normalize_addr(i * PGD_LEVEL_MULT); in ptdump_walk_pgd_level_core()
402 note_page(m, &st, __pgprot(prot), 1); in ptdump_walk_pgd_level_core()
404 walk_pud_level(m, &st, *start, in ptdump_walk_pgd_level_core()
408 note_page(m, &st, __pgprot(0), 1); in ptdump_walk_pgd_level_core()
414 st.current_address = normalize_addr(PTRS_PER_PGD*PGD_LEVEL_MULT); in ptdump_walk_pgd_level_core()
415 note_page(m, &st, __pgprot(0), 0); in ptdump_walk_pgd_level_core()
418 if (st.wx_pages) in ptdump_walk_pgd_level_core()
420 st.wx_pages); in ptdump_walk_pgd_level_core()