From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC8C91E9B3F for ; Tue, 6 Jan 2026 03:25:49 +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=1767669952; cv=none; b=aXWStK5jsmdMqvej1t9atAcbDX0FbSFOdwl/4xcv0QIspfKOE3USRYDoLdK+G/D/8s238fKJ88O9Ya/dz8linAeGyVXGP/4RzZ4rSUwNTCcc4LrorExAFmuv+EGWQs4buMjHjRWaIO+9oriAThX73y74mrJz3s42mEoyyGrS22g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767669952; c=relaxed/simple; bh=xijbDt1ml/R6pqhF8NT9hBnnQWFCyFRc3eKa4+ALXE0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gXP+Fg5D/8iso9VcaFUoAAQmtjCorwkjf3bhrraNTLyGyXBbIu0pXAJcfn9KR7uhb7kH+Etw50hU0VI7YzSsp39mD23idMzzvXov/jnGtCoDyhIBY7ao7kaTIBhHvSryLiZlY0WJh9Vh0WzvzDMNpUnTxf6ODN5NWY0eO3KM3PQ= 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 033A5497; Mon, 5 Jan 2026 19:25:42 -0800 (PST) Received: from localhost (a079125.arm.com [10.164.21.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 034CE3F694; Mon, 5 Jan 2026 19:25:47 -0800 (PST) Date: Tue, 6 Jan 2026 08:55:44 +0530 From: Linu Cherian To: Ryan Roberts Cc: Will Deacon , Ard Biesheuvel , Catalin Marinas , Mark Rutland , Linus Torvalds , Oliver Upton , Marc Zyngier , Dev Jain , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 09/13] arm64: mm: Refactor flush_tlb_page() to use __tlbi_level_asid() Message-ID: References: <20251216144601.2106412-1-ryan.roberts@arm.com> <20251216144601.2106412-10-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251216144601.2106412-10-ryan.roberts@arm.com> On Tue, Dec 16, 2025 at 02:45:54PM +0000, Ryan Roberts wrote > 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/tlbflush.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 = __TLBI_VADDR(uaddr, ASID(mm)); > - __tlbi(vale1, addr); > - __tlbi_user(vale1, addr); > + __tlbi_level_asid(vale1, uaddr, TLBI_TTL_UNKNOWN, ASID(mm)); > } > > static inline void local_flush_tlb_page_nonotify(struct vm_area_struct *vma, > @@ -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 = __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); > } Reviewed-by: Linu Cherian