arm64: tlb: Allow range operation for MAX_TLBI_RANGE_PAGES
authorGavin Shan <gshan@redhat.com>
Fri, 5 Apr 2024 03:58:52 +0000 (13:58 +1000)
committerWill Deacon <will@kernel.org>
Thu, 11 Apr 2024 10:42:57 +0000 (11:42 +0100)
MAX_TLBI_RANGE_PAGES pages is covered by SCALE#3 and NUM#31 and it's
supported now. Allow TLBI RANGE operation when the number of pages is
equal to MAX_TLBI_RANGE_PAGES in __flush_tlb_range_nosync().

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Link: https://lore.kernel.org/r/20240405035852.1532010-4-gshan@redhat.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/tlbflush.h

index 243d71f7bc1f66f368c3e342d006c549e2d8cca4..95fbc8c0560798da03a2c8ad0f9a9fa02bc55be0 100644 (file)
@@ -446,11 +446,11 @@ static inline void __flush_tlb_range_nosync(struct vm_area_struct *vma,
         * When not uses TLB range ops, we can handle up to
         * (MAX_DVM_OPS - 1) pages;
         * When uses TLB range ops, we can handle up to
-        * (MAX_TLBI_RANGE_PAGES - 1) pages.
+        * MAX_TLBI_RANGE_PAGES pages.
         */
        if ((!system_supports_tlb_range() &&
             (end - start) >= (MAX_DVM_OPS * stride)) ||
-           pages >= MAX_TLBI_RANGE_PAGES) {
+           pages > MAX_TLBI_RANGE_PAGES) {
                flush_tlb_mm(vma->vm_mm);
                return;
        }