Skip to content

Commit 0cfc8a8

Browse files
rppttorvalds
authored andcommitted
sparc32: fix page table traversal in srmmu_nocache_init()
The srmmu_nocache_init() uses __nocache_fix() macro to add an offset to page table entry to access srmmu_nocache_pool. But since sparc32 has only three actual page table levels, pgd, p4d and pud are essentially the same thing and pgd_offset() and p4d_offset() are no-ops, the __nocache_fix() should be done only at PUD level. Remove __nocache_fix() for p4d_offset() and pud_offset() and keep it only for PUD and lower levels. Fixes: c2bc26f ("sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()") Signed-off-by: Mike Rapoport <[email protected]> Cc: David S. Miller <[email protected]> Cc: Anatoly Pugachev <[email protected]> Cc: <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 423b8ba commit 0cfc8a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/sparc/mm/srmmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ static void __init srmmu_nocache_init(void)
331331

332332
while (vaddr < srmmu_nocache_end) {
333333
pgd = pgd_offset_k(vaddr);
334-
p4d = p4d_offset(__nocache_fix(pgd), vaddr);
335-
pud = pud_offset(__nocache_fix(p4d), vaddr);
334+
p4d = p4d_offset(pgd, vaddr);
335+
pud = pud_offset(p4d, vaddr);
336336
pmd = pmd_offset(__nocache_fix(pud), vaddr);
337337
pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
338338

0 commit comments

Comments
 (0)