s390/mm: add missing phys_to_virt translation to page table dumper

The page table dumper walks page table tables without using standard
page table primitives in order to also dump broken entries. However it
currently does not translate physical to virtual addresses before
dereferencing them. Therefore add this missing translation.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2021-12-06 18:55:21 +01:00
parent f139862b92
commit d2f2949ab6
1 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ static void dump_pagetable(unsigned long asce, unsigned long address)
pr_cont("R1:%016lx ", *table); pr_cont("R1:%016lx ", *table);
if (*table & _REGION_ENTRY_INVALID) if (*table & _REGION_ENTRY_INVALID)
goto out; goto out;
table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); table = __va(*table & _REGION_ENTRY_ORIGIN);
fallthrough; fallthrough;
case _ASCE_TYPE_REGION2: case _ASCE_TYPE_REGION2:
table += (address & _REGION2_INDEX) >> _REGION2_SHIFT; table += (address & _REGION2_INDEX) >> _REGION2_SHIFT;
@ -124,7 +124,7 @@ static void dump_pagetable(unsigned long asce, unsigned long address)
pr_cont("R2:%016lx ", *table); pr_cont("R2:%016lx ", *table);
if (*table & _REGION_ENTRY_INVALID) if (*table & _REGION_ENTRY_INVALID)
goto out; goto out;
table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); table = __va(*table & _REGION_ENTRY_ORIGIN);
fallthrough; fallthrough;
case _ASCE_TYPE_REGION3: case _ASCE_TYPE_REGION3:
table += (address & _REGION3_INDEX) >> _REGION3_SHIFT; table += (address & _REGION3_INDEX) >> _REGION3_SHIFT;
@ -133,7 +133,7 @@ static void dump_pagetable(unsigned long asce, unsigned long address)
pr_cont("R3:%016lx ", *table); pr_cont("R3:%016lx ", *table);
if (*table & (_REGION_ENTRY_INVALID | _REGION3_ENTRY_LARGE)) if (*table & (_REGION_ENTRY_INVALID | _REGION3_ENTRY_LARGE))
goto out; goto out;
table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); table = __va(*table & _REGION_ENTRY_ORIGIN);
fallthrough; fallthrough;
case _ASCE_TYPE_SEGMENT: case _ASCE_TYPE_SEGMENT:
table += (address & _SEGMENT_INDEX) >> _SEGMENT_SHIFT; table += (address & _SEGMENT_INDEX) >> _SEGMENT_SHIFT;
@ -142,7 +142,7 @@ static void dump_pagetable(unsigned long asce, unsigned long address)
pr_cont("S:%016lx ", *table); pr_cont("S:%016lx ", *table);
if (*table & (_SEGMENT_ENTRY_INVALID | _SEGMENT_ENTRY_LARGE)) if (*table & (_SEGMENT_ENTRY_INVALID | _SEGMENT_ENTRY_LARGE))
goto out; goto out;
table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN); table = __va(*table & _SEGMENT_ENTRY_ORIGIN);
} }
table += (address & _PAGE_INDEX) >> _PAGE_SHIFT; table += (address & _PAGE_INDEX) >> _PAGE_SHIFT;
if (bad_address(table)) if (bad_address(table))