Skip to content

Commit 171c400

Browse files
gerald-schaeferMartin Schwidefsky
authored andcommitted
s390/mm: fix pmd_pfn() for thp
The pfn calculation in pmd_pfn() is broken for thp, because it uses HPAGE_SHIFT instead of the normal PAGE_SHIFT. This is fixed by removing the distinction between thp and normal pmds in that function, and always using PAGE_SHIFT. Reported-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent b719f43 commit 171c400

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/s390/include/asm/pgtable.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,10 +1387,7 @@ static inline int has_transparent_hugepage(void)
13871387

13881388
static inline unsigned long pmd_pfn(pmd_t pmd)
13891389
{
1390-
if (pmd_trans_huge(pmd))
1391-
return pmd_val(pmd) >> HPAGE_SHIFT;
1392-
else
1393-
return pmd_val(pmd) >> PAGE_SHIFT;
1390+
return pmd_val(pmd) >> PAGE_SHIFT;
13941391
}
13951392
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
13961393

0 commit comments

Comments
 (0)