Skip to content

Commit eae40a6

Browse files
riteshharjanimaddy-kerneldev
authored andcommitted
powerpc/64s/ptdump: Fix kernel_hash_pagetable dump for ISA v3.00 HPTE format
HPTE format was changed since Power9 (ISA 3.0) onwards. While dumping kernel hash page tables, nothing gets printed on powernv P9+. This patch utilizes the helpers added in the patch tagged as fixes, to convert new format to old format and dump the hptes. This fix is only needed for native_find() (powernv), since pseries continues to work fine with the old format. Fixes: 6b243fc ("powerpc/64: Simplify adaptation to new ISA v3.00 HPTE format") Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/4c2bb9e5b3cfbc0dd80b61b67cdd3ccfc632684c.1761834163.git.ritesh.list@gmail.com
1 parent 17b45cc commit eae40a6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

arch/powerpc/mm/ptdump/hashpagetable.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ static int native_find(unsigned long ea, int psize, bool primary, u64 *v, u64
216216
vpn = hpt_vpn(ea, vsid, ssize);
217217
hash = hpt_hash(vpn, shift, ssize);
218218
want_v = hpte_encode_avpn(vpn, psize, ssize);
219+
if (cpu_has_feature(CPU_FTR_ARCH_300))
220+
want_v = hpte_old_to_new_v(want_v);
219221

220222
/* to check in the secondary hash table, we invert the hash */
221223
if (!primary)
@@ -229,6 +231,10 @@ static int native_find(unsigned long ea, int psize, bool primary, u64 *v, u64
229231
/* HPTE matches */
230232
*v = be64_to_cpu(hptep->v);
231233
*r = be64_to_cpu(hptep->r);
234+
if (cpu_has_feature(CPU_FTR_ARCH_300)) {
235+
*v = hpte_new_to_old_v(*v, *r);
236+
*r = hpte_new_to_old_r(*r);
237+
}
232238
return 0;
233239
}
234240
++hpte_group;

0 commit comments

Comments
 (0)