Skip to content

arm64: Replace TLB invalidation preprocessor macros with C functions

Will Deacon linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10arm64: mm: Introduce a C wrapper for by-level TLB invalidation helpersarch/arm64/include/asm/tlbflush.h+32 -11 reply
2/10arm64: mm: Introduce a C wrapper for by-range TLB invalidation helpersarch/arm64/include/asm/tlbflush.h+19 -11 reply
3/10arm64: mm: Implicitly invalidate user ASID based on TLBI operationarch/arm64/include/asm/tlbflush.h+26 -192 replies
4/10arm64: mm: Remove unused 'tlbi_user' argument from __flush_tlb_range_op()arch/arm64/include/asm/tlbflush.h+5 -70 replies
5/10arm64: mm: Re-implement the __tlbi_level macro in Carch/arm64/include/asm/tlbflush.h+10 -151 reply
6/10arm64: mm: Simplify __TLBI_RANGE_NUM() macroarch/arm64/include/asm/tlbflush.h+1 -52 replies
7/10arm64: mm: Push __TLBI_VADDR() into __tlbi_level()arch/arm64/include/asm/tlbflush.h arch/arm64/kernel/sys_compat.c arch/arm64/kvm/hyp/nvhe/mm.c +1 more+14 -80 replies
8/10arm64: mm: Inline __TLBI_VADDR_RANGE() into __tlbi_range()arch/arm64/include/asm/tlbflush.h+13 -191 reply
9/10arm64: mm: Simplify __flush_tlb_range_limit_excess()arch/arm64/include/asm/tlbflush.h+6 -142 replies
10/10arm64: mm: Re-implement the __flush_tlb_range_op macro in Carch/arm64/include/asm/tlbflush.h+34 -293 replies

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchRyan RobertsDev Jain
1/10
2/10
3/10
4/10
5/10
6/10R-b R-b
7/10
8/10
9/10
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] arm64: Replace TLB invalidation preprocessor macros with C functions

Hi all,

I cooked this series following a complaint from Linus back in March about our range-based TLB invalidation macro after we fixed an over-invalidation bug thanks to incorrect handling of its arguments:

https://lore.kernel.org/all/CAHk-=wgiX0q0WCL+SFwVCYtG7JR3=2Rshse-5J3AO2Y4AgT7Jw@mail.gmail.com/

Once I started trying to rework the range macro into a C function, I spotted a few other opportunities for cleanup and so I've ended up with this series.

Testing and feedback welcome.

Cheers,

Will

Cc Ard Biesheuvel <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Marc Zyngier <[email protected]>

--->8

Will Deacon (10):
arm64: mm: Introduce a C wrapper for by-level TLB invalidation helpers
arm64: mm: Introduce a C wrapper for by-range TLB invalidation helpers
arm64: mm: Implicitly invalidate user ASID based on TLBI operation
arm64: mm: Remove unused 'tlbi_user' argument from

    __flush_tlb_range_op()

arm64: mm: Re-implement the __tlbi_level macro in C
arm64: mm: Simplify __TLBI_RANGE_NUM() macro
arm64: mm: Push __TLBI_VADDR() into __tlbi_level()
arm64: mm: Inline __TLBI_VADDR_RANGE() into __tlbi_range()
arm64: mm: Simplify __flush_tlb_range_limit_excess()
arm64: mm: Re-implement the __flush_tlb_range_op macro in C

 arch/arm64/include/asm/tlbflush.h | 230 ++++++++++++++++++------------
 arch/arm64/kernel/sys_compat.c    |   2 +-
 arch/arm64/kvm/hyp/nvhe/mm.c      |   2 +-
 arch/arm64/kvm/hyp/pgtable.c      |   4 +-
 4 files changed, 140 insertions(+), 98 deletions(-)
Signature · 1 line
2.50.0.727.gbf7dc18ff4-goog