* [PATCH] sparc32: fix page table traversal in srmmu_nocache_init()
@ 2020-05-23 19:57 Mike Rapoport
2020-05-23 21:00 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: Mike Rapoport @ 2020-05-23 19:57 UTC (permalink / raw)
To: Linus Torvalds
Cc: Andrew Morton, David Miller, Linux-MM, kernel test robot,
Anatoly Pugachev, mm-commits, stable, Mike Rapoport
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: c2bc26f7ca1f ("sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()")
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Anatoly Pugachev <matorola@gmail.com>
Cc: <stable@vger.kernel.org>
---
arch/sparc/mm/srmmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index e9f7af32da07..a8c2f2615fc6 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -331,8 +331,8 @@ static void __init srmmu_nocache_init(void)
while (vaddr < srmmu_nocache_end) {
pgd = pgd_offset_k(vaddr);
- p4d = p4d_offset(__nocache_fix(pgd), vaddr);
- pud = pud_offset(__nocache_fix(p4d), vaddr);
+ p4d = p4d_offset(pgd, vaddr);
+ pud = pud_offset(p4d, vaddr);
pmd = pmd_offset(__nocache_fix(pud), vaddr);
pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sparc32: fix page table traversal in srmmu_nocache_init()
2020-05-23 19:57 [PATCH] sparc32: fix page table traversal in srmmu_nocache_init() Mike Rapoport
@ 2020-05-23 21:00 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2020-05-23 21:00 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, David Miller, Linux-MM, kernel test robot,
Anatoly Pugachev, mm-commits, stable
On Sat, May 23, 2020 at 12:57 PM Mike Rapoport <rppt@linux.ibm.com> wrote:
>
> Remove __nocache_fix() for p4d_offset() and pud_offset() and keep it only
> for PUD and lower levels.
Davem - I took this directly, since it's a fix for the patch Andrew
sent and I merged that way. Just so you know.
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-23 21:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 19:57 [PATCH] sparc32: fix page table traversal in srmmu_nocache_init() Mike Rapoport
2020-05-23 21:00 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).