From nobody Fri Dec 19 07:24:13 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A82934D91D for ; Tue, 16 Dec 2025 14:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765896389; cv=none; b=ClhCKSF7m7WrE5gHATHViGPCv9ij7CVHSMQHvBUF5AaLd/6Oy4k5PFKBJvAT8FmYyVz7R71xjNNzTV5BOkivQ0h/Mn5xCMpG0wjMO1K5RcE3maExfxH9fpzKfGylQgNhWcosQqyoXXKdE5k27MNSu0Y75EZXzCkXC4EC5c3i2F0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765896389; c=relaxed/simple; bh=C9wgH+fvywkbgyqcmHut+F7YFtPR8WBM2s9b+vkDiy0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uIA2YXzio5prCOt6jxfmLSOo+TEM+2QQHbVnPCnakLa6QofeE8kUKL1kKNcXXLgVXorQ82Zuo93YWNl1mhR2yHL2SdVAkZfYfiqgenjQo3Js8dNX66y+MLh+d8xzQZBFc8yYPUy7ZUvCoGeacBGu0U/Y8lcnr/X1BxQr5ghiwBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 73F281516; Tue, 16 Dec 2025 06:46:19 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 23F2B3F73F; Tue, 16 Dec 2025 06:46:25 -0800 (PST) From: Ryan Roberts To: Will Deacon , Ard Biesheuvel , Catalin Marinas , Mark Rutland , Linus Torvalds , Oliver Upton , Marc Zyngier , Dev Jain , Linu Cherian Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 09/13] arm64: mm: Refactor flush_tlb_page() to use __tlbi_level_asid() Date: Tue, 16 Dec 2025 14:45:54 +0000 Message-ID: <20251216144601.2106412-10-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251216144601.2106412-1-ryan.roberts@arm.com> References: <20251216144601.2106412-1-ryan.roberts@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that we have __tlbi_level_asid(), let's refactor the *flush_tlb_page*() variants to use it rather than open coding. The emitted tlbi(s) is/are intended to be exactly the same as before; no TTL hint is provided. Although the spec for flush_tlb_page() allows for setting the TTL hint to 3, it turns out that flush_tlb_fix_spurious_fault_pmd() depends on local_flush_tlb_page_nonotify() to invalidate the level 2 entry. This will be fixed separately. Signed-off-by: Ryan Roberts --- arch/arm64/include/asm/tlbflush.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlb= flush.h index 3b72a71feac0..37c782ddc149 100644 --- a/arch/arm64/include/asm/tlbflush.h +++ b/arch/arm64/include/asm/tlbflush.h @@ -327,12 +327,8 @@ static inline void flush_tlb_mm(struct mm_struct *mm) static inline void __local_flush_tlb_page_nonotify_nosync(struct mm_struct= *mm, unsigned long uaddr) { - unsigned long addr; - dsb(nshst); - addr =3D __TLBI_VADDR(uaddr, ASID(mm)); - __tlbi(vale1, addr); - __tlbi_user(vale1, addr); + __tlbi_level_asid(vale1, uaddr, TLBI_TTL_UNKNOWN, ASID(mm)); } =20 static inline void local_flush_tlb_page_nonotify(struct vm_area_struct *vm= a, @@ -354,12 +350,8 @@ static inline void local_flush_tlb_page(struct vm_area= _struct *vma, static inline void __flush_tlb_page_nosync(struct mm_struct *mm, unsigned long uaddr) { - unsigned long addr; - dsb(ishst); - addr =3D __TLBI_VADDR(uaddr, ASID(mm)); - __tlbi(vale1is, addr); - __tlbi_user(vale1is, addr); + __tlbi_level_asid(vale1is, uaddr, TLBI_TTL_UNKNOWN, ASID(mm)); mmu_notifier_arch_invalidate_secondary_tlbs(mm, uaddr & PAGE_MASK, (uaddr & PAGE_MASK) + PAGE_SIZE); } --=20 2.43.0