• Home
  • Raw
  • Download

Lines Matching refs:st

114 static void dump_flag_info(struct pg_state *st, const struct flag_info  in dump_flag_info()  argument
131 pt_dump_seq_printf(st->seq, " %s:%llx", flag->set, val); in dump_flag_info()
138 pt_dump_seq_printf(st->seq, " %s", s); in dump_flag_info()
140 st->current_flags &= ~flag->mask; in dump_flag_info()
142 if (st->current_flags != 0) in dump_flag_info()
143 pt_dump_seq_printf(st->seq, " unknown flags:%llx", st->current_flags); in dump_flag_info()
146 static void dump_addr(struct pg_state *st, unsigned long addr) in dump_addr() argument
158 pt_dump_seq_printf(st->seq, REG "-" REG " ", st->start_address, addr - 1); in dump_addr()
159 if (st->start_pa == st->last_pa && st->start_address + st->page_size != addr) { in dump_addr()
160 pt_dump_seq_printf(st->seq, "[" REG "]", st->start_pa); in dump_addr()
161 delta = st->page_size >> 10; in dump_addr()
163 pt_dump_seq_printf(st->seq, " " REG " ", st->start_pa); in dump_addr()
164 delta = (addr - st->start_address) >> 10; in dump_addr()
171 pt_dump_seq_printf(st->seq, "%9lu%c", delta, *unit); in dump_addr()
175 static void note_prot_wx(struct pg_state *st, unsigned long addr) in note_prot_wx() argument
177 pte_t pte = __pte(st->current_flags); in note_prot_wx()
179 if (!IS_ENABLED(CONFIG_PPC_DEBUG_WX) || !st->check_wx) 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()
191 static void note_page(struct pg_state *st, unsigned long addr, in note_page() argument
198 if (!st->level) { in note_page()
199 st->level = level; in note_page()
200 st->current_flags = flag; in note_page()
201 st->start_address = addr; in note_page()
202 st->start_pa = pa; in note_page()
203 st->last_pa = pa; in note_page()
204 st->page_size = page_size; in note_page()
205 pt_dump_seq_printf(st->seq, "---[ %s ]---\n", st->marker->name); in note_page()
214 } else if (flag != st->current_flags || level != st->level || in note_page()
215 addr >= st->marker[1].start_address || in note_page()
216 (pa != st->last_pa + st->page_size && in note_page()
217 (pa != st->start_pa || st->start_pa != st->last_pa))) { in note_page()
220 if (st->current_flags) { in note_page()
221 note_prot_wx(st, addr); in note_page()
222 dump_addr(st, addr); in note_page()
225 if (pg_level[st->level].flag) in note_page()
226 dump_flag_info(st, pg_level[st->level].flag, in note_page()
227 st->current_flags, in note_page()
228 pg_level[st->level].num); in note_page()
230 pt_dump_seq_putc(st->seq, '\n'); in note_page()
237 while (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()
241 st->start_address = addr; in note_page()
242 st->start_pa = pa; in note_page()
243 st->last_pa = pa; in note_page()
244 st->page_size = page_size; in note_page()
245 st->current_flags = flag; in note_page()
246 st->level = level; in note_page()
248 st->last_pa = pa; in note_page()
252 static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start) in walk_pte() argument
260 note_page(st, addr, 4, pte_val(*pte), PAGE_SIZE); in walk_pte()
265 static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) in walk_pmd() argument
275 walk_pte(st, pmd, addr); in walk_pmd()
277 note_page(st, addr, 3, pmd_val(*pmd), PMD_SIZE); in walk_pmd()
281 static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start) in walk_pud() argument
291 walk_pmd(st, pud, addr); in walk_pud()
293 note_page(st, addr, 2, pud_val(*pud), PUD_SIZE); in walk_pud()
297 static void walk_pagetables(struct pg_state *st) in walk_pagetables() argument
300 unsigned long addr = st->start_address & PGDIR_MASK; in walk_pagetables()
310 walk_pud(st, pgd, addr); in walk_pagetables()
312 note_page(st, addr, 1, pgd_val(*pgd), PGDIR_SIZE); in walk_pagetables()
354 struct pg_state st = { in ptdump_show() local
362 st.start_address = KERN_VIRT_START; in ptdump_show()
366 walk_pagetables(&st); in ptdump_show()
367 note_page(&st, 0, 0, 0, 0); in ptdump_show()
397 struct pg_state st = { in ptdump_check_wx() local
406 st.start_address = KERN_VIRT_START; in ptdump_check_wx()
409 walk_pagetables(&st); in ptdump_check_wx()
411 if (st.wx_pages) in ptdump_check_wx()
413 st.wx_pages); in ptdump_check_wx()