xmon.c (16ba7e312045cd5d32fba0156312b4303f200787) xmon.c (2fb4706057bcf8261b3b0521ec7a62b54b82ce48)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Routines providing a simple monitor for use on the PowerMac.
4 *
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 * Copyright (C) 2001 PPC64 Team, IBM Corp
7 * Copyrignt (C) 2006 Michael Ellerman, IBM Corp
8 */

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

3130 pte_exec(entry) ? "Exec " : "");
3131}
3132
3133static void show_pte(unsigned long addr)
3134{
3135 unsigned long tskv = 0;
3136 struct task_struct *tsk = NULL;
3137 struct mm_struct *mm;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Routines providing a simple monitor for use on the PowerMac.
4 *
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 * Copyright (C) 2001 PPC64 Team, IBM Corp
7 * Copyrignt (C) 2006 Michael Ellerman, IBM Corp
8 */

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

3130 pte_exec(entry) ? "Exec " : "");
3131}
3132
3133static void show_pte(unsigned long addr)
3134{
3135 unsigned long tskv = 0;
3136 struct task_struct *tsk = NULL;
3137 struct mm_struct *mm;
3138 pgd_t *pgdp, *pgdir;
3138 pgd_t *pgdp;
3139 p4d_t *p4dp;
3139 pud_t *pudp;
3140 pmd_t *pmdp;
3141 pte_t *ptep;
3142
3143 if (!scanhex(&tskv))
3144 mm = &init_mm;
3145 else
3146 tsk = (struct task_struct *)tskv;

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

3154 catch_memory_errors = 0;
3155 printf("*** Error dumping pte for task %px\n", tsk);
3156 return;
3157 }
3158
3159 catch_memory_errors = 1;
3160 sync();
3161
3140 pud_t *pudp;
3141 pmd_t *pmdp;
3142 pte_t *ptep;
3143
3144 if (!scanhex(&tskv))
3145 mm = &init_mm;
3146 else
3147 tsk = (struct task_struct *)tskv;

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

3155 catch_memory_errors = 0;
3156 printf("*** Error dumping pte for task %px\n", tsk);
3157 return;
3158 }
3159
3160 catch_memory_errors = 1;
3161 sync();
3162
3162 if (mm == &init_mm) {
3163 if (mm == &init_mm)
3163 pgdp = pgd_offset_k(addr);
3164 pgdp = pgd_offset_k(addr);
3164 pgdir = pgd_offset_k(0);
3165 } else {
3165 else
3166 pgdp = pgd_offset(mm, addr);
3166 pgdp = pgd_offset(mm, addr);
3167 pgdir = pgd_offset(mm, 0);
3168 }
3169
3167
3170 if (pgd_none(*pgdp)) {
3171 printf("no linux page table for address\n");
3168 p4dp = p4d_offset(pgdp, addr);
3169
3170 if (p4d_none(*p4dp)) {
3171 printf("No valid P4D\n");
3172 return;
3173 }
3174
3172 return;
3173 }
3174
3175 printf("pgd @ 0x%px\n", pgdir);
3176
3177 if (pgd_is_leaf(*pgdp)) {
3178 format_pte(pgdp, pgd_val(*pgdp));
3175 if (p4d_is_leaf(*p4dp)) {
3176 format_pte(p4dp, p4d_val(*p4dp));
3179 return;
3180 }
3177 return;
3178 }
3181 printf("pgdp @ 0x%px = 0x%016lx\n", pgdp, pgd_val(*pgdp));
3182
3179
3183 pudp = pud_offset(pgdp, addr);
3180 printf("p4dp @ 0x%px = 0x%016lx\n", p4dp, p4d_val(*p4dp));
3184
3181
3182 pudp = pud_offset(p4dp, addr);
3183
3185 if (pud_none(*pudp)) {
3186 printf("No valid PUD\n");
3187 return;
3188 }
3189
3190 if (pud_is_leaf(*pudp)) {
3191 format_pte(pudp, pud_val(*pudp));
3192 return;

--- 1021 unchanged lines hidden ---
3184 if (pud_none(*pudp)) {
3185 printf("No valid PUD\n");
3186 return;
3187 }
3188
3189 if (pud_is_leaf(*pudp)) {
3190 format_pte(pudp, pud_val(*pudp));
3191 return;

--- 1021 unchanged lines hidden ---