Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 6b243fcfb5f1e ("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

authored by

Ritesh Harjani (IBM) and committed by
Madhavan Srinivasan
eae40a6d 17b45ccf

+6
+6
arch/powerpc/mm/ptdump/hashpagetable.c
··· 216 216 vpn = hpt_vpn(ea, vsid, ssize); 217 217 hash = hpt_hash(vpn, shift, ssize); 218 218 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); 219 221 220 222 /* to check in the secondary hash table, we invert the hash */ 221 223 if (!primary) ··· 231 229 /* HPTE matches */ 232 230 *v = be64_to_cpu(hptep->v); 233 231 *r = be64_to_cpu(hptep->r); 232 + if (cpu_has_feature(CPU_FTR_ARCH_300)) { 233 + *v = hpte_new_to_old_v(*v, *r); 234 + *r = hpte_new_to_old_r(*r); 235 + } 234 236 return 0; 235 237 } 236 238 ++hpte_group;