powerpc/32s: Implement local_flush_tlb_page_psize()
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Oct 2023 09:23:19 +0000 (20:23 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Oct 2023 09:33:19 +0000 (20:33 +1100)
There's a single call to local_flush_tlb_page_psize() in the code
patching code. That call is never executed on 32-bit Book3S,
because it's guarded by mm_patch_enabled() which is essentially a
radix_enabled() check, which is always false on 32s.

However depending on how the optimiser sees things it may still trip
over the BUILD_BUG() in the 32s stub of local_flush_tlb_page_psize().

To avoid that, implement it in terms of flush_range() so that if it ever
becomes called it should function, even if not optimally.

Note that flush_range() deals with page aligning the address and so on,
and that 32s doesn't support huge pages so there should be no issue with
non-standard page sizes needing to be flushed.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231023092319.1507325-1-mpe@ellerman.id.au
arch/powerpc/include/asm/book3s/32/tlbflush.h

index 4be572908124383b6292c88d9c3e0c5e58cb38d8..e43534da5207aa3b0cb3c07b78e29b833c141f3f 100644 (file)
@@ -80,7 +80,7 @@ static inline void local_flush_tlb_page(struct vm_area_struct *vma,
 static inline void local_flush_tlb_page_psize(struct mm_struct *mm,
                                              unsigned long vmaddr, int psize)
 {
-       BUILD_BUG();
+       flush_range(mm, vmaddr, vmaddr);
 }
 
 static inline void local_flush_tlb_mm(struct mm_struct *mm)