hashpagetable.c (16ba7e312045cd5d32fba0156312b4303f200787) hashpagetable.c (2fb4706057bcf8261b3b0521ec7a62b54b82ce48)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright 2016, Rashmica Gupta, IBM Corp.
4 *
5 * This traverses the kernel virtual memory and dumps the pages that are in
6 * the hash pagetable, along with their flags to
7 * /sys/kernel/debug/kernel_hash_pagetable.
8 *

--- 403 unchanged lines hidden (view full) ---

412 for (i = 0; i < PTRS_PER_PMD; i++, pmd++) {
413 addr = start + i * PMD_SIZE;
414 if (!pmd_none(*pmd))
415 /* pmd exists */
416 walk_pte(st, pmd, addr);
417 }
418}
419
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright 2016, Rashmica Gupta, IBM Corp.
4 *
5 * This traverses the kernel virtual memory and dumps the pages that are in
6 * the hash pagetable, along with their flags to
7 * /sys/kernel/debug/kernel_hash_pagetable.
8 *

--- 403 unchanged lines hidden (view full) ---

412 for (i = 0; i < PTRS_PER_PMD; i++, pmd++) {
413 addr = start + i * PMD_SIZE;
414 if (!pmd_none(*pmd))
415 /* pmd exists */
416 walk_pte(st, pmd, addr);
417 }
418}
419
420static void walk_pud(struct pg_state *st, pgd_t *pgd, unsigned long start)
420static void walk_pud(struct pg_state *st, p4d_t *p4d, unsigned long start)
421{
421{
422 pud_t *pud = pud_offset(pgd, 0);
422 pud_t *pud = pud_offset(p4d, 0);
423 unsigned long addr;
424 unsigned int i;
425
426 for (i = 0; i < PTRS_PER_PUD; i++, pud++) {
427 addr = start + i * PUD_SIZE;
428 if (!pud_none(*pud))
429 /* pud exists */
430 walk_pmd(st, pud, addr);
431 }
432}
433
423 unsigned long addr;
424 unsigned int i;
425
426 for (i = 0; i < PTRS_PER_PUD; i++, pud++) {
427 addr = start + i * PUD_SIZE;
428 if (!pud_none(*pud))
429 /* pud exists */
430 walk_pmd(st, pud, addr);
431 }
432}
433
434static void walk_p4d(struct pg_state *st, pgd_t *pgd, unsigned long start)
435{
436 p4d_t *p4d = p4d_offset(pgd, 0);
437 unsigned long addr;
438 unsigned int i;
439
440 for (i = 0; i < PTRS_PER_P4D; i++, p4d++) {
441 addr = start + i * P4D_SIZE;
442 if (!p4d_none(*p4d))
443 /* p4d exists */
444 walk_pud(st, p4d, addr);
445 }
446}
447
434static void walk_pagetables(struct pg_state *st)
435{
436 pgd_t *pgd = pgd_offset_k(0UL);
437 unsigned int i;
438 unsigned long addr;
439
440 /*
441 * Traverse the linux pagetable structure and dump pages that are in
442 * the hash pagetable.
443 */
444 for (i = 0; i < PTRS_PER_PGD; i++, pgd++) {
445 addr = KERN_VIRT_START + i * PGDIR_SIZE;
446 if (!pgd_none(*pgd))
447 /* pgd exists */
448static void walk_pagetables(struct pg_state *st)
449{
450 pgd_t *pgd = pgd_offset_k(0UL);
451 unsigned int i;
452 unsigned long addr;
453
454 /*
455 * Traverse the linux pagetable structure and dump pages that are in
456 * the hash pagetable.
457 */
458 for (i = 0; i < PTRS_PER_PGD; i++, pgd++) {
459 addr = KERN_VIRT_START + i * PGDIR_SIZE;
460 if (!pgd_none(*pgd))
461 /* pgd exists */
448 walk_pud(st, pgd, addr);
462 walk_p4d(st, pgd, addr);
449 }
450}
451
452
453static void walk_linearmapping(struct pg_state *st)
454{
455 unsigned long addr;
456

--- 81 unchanged lines hidden ---
463 }
464}
465
466
467static void walk_linearmapping(struct pg_state *st)
468{
469 unsigned long addr;
470

--- 81 unchanged lines hidden ---