Skip to content

RFC Update tlb invalidation routines for FEAT_LPA2

Ryan Roberts kvmarm linux-arm-kernel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3arm64/mm: Modify range-based tlbi to decrement scalearch/arm64/include/asm/tlbflush.h+10 -100 replies
2/3arm64/mm: Add lpa2_is_enabled() kvm_lpa2_is_enabled() stubsarch/arm64/include/asm/kvm_mmu.h arch/arm64/include/asm/pgtable-prot.h+5 -00 replies
3/3arm64/mm: Update tlb invalidation routines for FEAT_LPA2arch/arm64/include/asm/tlb.h arch/arm64/include/asm/tlbflush.h+68 -370 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchCatalin Marinas
1/3
2/3
3/3R-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 [RFC PATCH v1 0/3] Update tlb invalidation routines for FEAT_LPA2

Hi All,

As raised yesterday against Ard's LPA2 series [1], we need to address the TLBI changes to properly support LPA2 before Ard's changes get merged. So far those changes have been part of my KVM LPA2 series [2]. So this is an attempt to split the TLBI changes to make them independent. The idea is that this series would go in first, then Ard's and the rest of my series can race eachother and it doesn't really matter who wins.

I've attempted to address all of Marc's feedback against the versions of these patches posted at [2], including adding benchmark data (see patch 1). Although if people are still nervous that this could regress non-lpa2 performance in some cases, I could rework so that there are lpa2 and non-lpa2 variants of __flush_tlb_range_op(), and the correct version is chosen at the higher level (based on lpa2_is_enabled() / kvm_lpa2_is_enabled()).

It turns out that we won't be able to key LPA2 usage off the same static key for both the kernel and kvm usage because the kernel usage additionally depends on CONFIG_ARM64_LPA2 being enabled. So I've introduced 2 stub functions (lpa2_is_enabled() and kvm_lpa2_is_enabled()) to advertise it. Ard already defines and implements lpa2_is_enabled() in his series, so there will be a minor conflict to resolve there. I plan to define kvm_lpa2_is_enabled() to be the static key for kvm in my series. Marc, would you be happy with this approach?

Anyway, I wanted to put this out there as an RFC. If we are happy with it, then I'll re-post on 6.7-rc1.

[1] https://lore.kernel.org/linux-arm-kernel/[email protected]/
[2] https://lore.kernel.org/kvmarm/[email protected]/

Thanks,
Ryan

Ryan Roberts (3):
arm64/mm: Modify range-based tlbi to decrement scale arm64/mm: Add lpa2_is_enabled() kvm_lpa2_is_enabled() stubs arm64/mm: Update tlb invalidation routines for FEAT_LPA2

 arch/arm64/include/asm/kvm_mmu.h      |   3 +
 arch/arm64/include/asm/pgtable-prot.h |   2 +
 arch/arm64/include/asm/tlb.h          |  15 ++--
 arch/arm64/include/asm/tlbflush.h     | 100 ++++++++++++++++----------
 4 files changed, 78 insertions(+), 42 deletions(-)

--
2.25.1