Commit 73301e46 authored by Gavin Shan's avatar Gavin Shan Committed by Will Deacon

arm64: tlb: Allow range operation for MAX_TLBI_RANGE_PAGES

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: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarGavin Shan <gshan@redhat.com>
Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: default avatarRyan Roberts <ryan.roberts@arm.com>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarShaoqin Huang <shahuang@redhat.com>
Link: https://lore.kernel.org/r/20240405035852.1532010-4-gshan@redhat.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent e07255d6
...@@ -446,11 +446,11 @@ static inline void __flush_tlb_range_nosync(struct vm_area_struct *vma, ...@@ -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 * When not uses TLB range ops, we can handle up to
* (MAX_DVM_OPS - 1) pages; * (MAX_DVM_OPS - 1) pages;
* When uses TLB range ops, we can handle up to * 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() && if ((!system_supports_tlb_range() &&
(end - start) >= (MAX_DVM_OPS * stride)) || (end - start) >= (MAX_DVM_OPS * stride)) ||
pages >= MAX_TLBI_RANGE_PAGES) { pages > MAX_TLBI_RANGE_PAGES) {
flush_tlb_mm(vma->vm_mm); flush_tlb_mm(vma->vm_mm);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment