Skip to content

Commit d6f4121

Browse files
chleroygregkh
authored andcommitted
powerpc/8xx: fix size given to set_huge_pte_at()
[ Upstream commit 7ea9810 ] set_huge_pte_at() expects the size of the hugepage as an int, not the psize which is the index of the page definition in table mmu_psize_defs[] Link: https://lkml.kernel.org/r/97f2090011e25d99b6b0aae73e22e1b921c5d1fb.1719928057.git.christophe.leroy@csgroup.eu Fixes: 935d4f0 ("mm: hugetlb: add huge page size param to set_huge_pte_at()") Signed-off-by: Christophe Leroy <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Peter Xu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 99623b0 commit d6f4121

File tree

1 file changed

+2
-1
lines changed
  • arch/powerpc/mm/nohash

1 file changed

+2
-1
lines changed

arch/powerpc/mm/nohash/8xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ static int __ref __early_map_kernel_hugepage(unsigned long va, phys_addr_t pa,
9292
return -EINVAL;
9393

9494
set_huge_pte_at(&init_mm, va, ptep,
95-
pte_mkhuge(pfn_pte(pa >> PAGE_SHIFT, prot)), psize);
95+
pte_mkhuge(pfn_pte(pa >> PAGE_SHIFT, prot)),
96+
1UL << mmu_psize_to_shift(psize));
9697

9798
return 0;
9899
}

0 commit comments

Comments
 (0)