linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/32s: Implement local_flush_tlb_page_psize()
@ 2023-10-23  9:23 Michael Ellerman
  2023-10-27  9:59 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2023-10-23  9:23 UTC (permalink / raw)
  To: linuxppc-dev

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>
---
 arch/powerpc/include/asm/book3s/32/tlbflush.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/book3s/32/tlbflush.h b/arch/powerpc/include/asm/book3s/32/tlbflush.h
index 4be572908124..e43534da5207 100644
--- a/arch/powerpc/include/asm/book3s/32/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/32/tlbflush.h
@@ -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)
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/32s: Implement local_flush_tlb_page_psize()
  2023-10-23  9:23 [PATCH] powerpc/32s: Implement local_flush_tlb_page_psize() Michael Ellerman
@ 2023-10-27  9:59 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2023-10-27  9:59 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman

On Mon, 23 Oct 2023 20:23:19 +1100, Michael Ellerman wrote:
> 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().
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/32s: Implement local_flush_tlb_page_psize()
      https://git.kernel.org/powerpc/c/aad26d3b6af13c055b1d05dd253d2484551bde55

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-27 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23  9:23 [PATCH] powerpc/32s: Implement local_flush_tlb_page_psize() Michael Ellerman
2023-10-27  9:59 ` Michael Ellerman

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).