diff options
author | 2025-04-22 09:18:10 +0100 | |
---|---|---|
committer | 2025-05-09 13:43:06 +0100 | |
commit | 5b3f8917644e595a710849e602b61617d55c4c41 (patch) | |
tree | 2581d365ac01c22bfd5dda9fda70e76d1c888c58 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | arm64: hugetlb: Cleanup huge_pte size discovery mechanisms (diff) | |
download | wireguard-linux-5b3f8917644e595a710849e602b61617d55c4c41.tar.xz wireguard-linux-5b3f8917644e595a710849e602b61617d55c4c41.zip |
arm64: hugetlb: Refine tlb maintenance scope
When operating on contiguous blocks of ptes (or pmds) for some hugetlb
sizes, we must honour break-before-make requirements and clear down the
block to invalid state in the pgtable then invalidate the relevant tlb
entries before making the pgtable entries valid again.
However, the tlb maintenance is currently always done assuming the worst
case stride (PAGE_SIZE), last_level (false) and tlb_level
(TLBI_TTL_UNKNOWN). We can do much better with the hinting; In reality,
we know the stride from the huge_pte pgsize, we are always operating
only on the last level, and we always know the tlb_level, again based on
pgsize. So let's start providing these hints.
Additionally, avoid tlb maintenace in set_huge_pte_at().
Break-before-make is only required if we are transitioning the
contiguous pte block from valid -> valid. So let's elide the
clear-and-flush ("break") if the pte range was previously invalid.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Tested-by: Luiz Capitulino <luizcap@redhat.com>
Link: https://lore.kernel.org/r/20250422081822.1836315-3-ryan.roberts@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions