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 7A5312DA75F; Wed, 15 Oct 2025 08:27:59 +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=1760516883; cv=none; b=E/VXrO2fFF2lLRqKqxWlKcjwpn+69VeygFx463q8/v5rRNM/JpdqVaFNHOixOBDtVFmxr9YKJ2QgUTCGyMfEavI2SGFR7dzzO5zGHQpvkFJVbFZ3JpUhvL+1TxkPpu0iF8xKcgV8YJcB0UEeMchG5aNugug0gSHJ/Lt477gvx8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760516883; c=relaxed/simple; bh=ukQDpndK1HbbaRLsNfCJOQT6An1AxcD+WbkWTveGdHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqkWCwF4TmyRFciHk2Miqn5xWmuVm9vEKflEQEYJE46bi3AI/LsPTkIxY+mflEA9A/Y6nTIHfYhq+T6a7rxYRPr4+YkVHMRikrCDYPJyc4BdLsIfsfs1XVI9YNi0ZV0XNvkKcifr9zs73j1XE9qb9WZ2sudaxpZkUUD7yUIDXSo= 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 E422222EE; Wed, 15 Oct 2025 01:27:50 -0700 (PDT) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF8BD3F66E; Wed, 15 Oct 2025 01:27:53 -0700 (PDT) From: Kevin Brodsky To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Alexander Gordeev , Andreas Larsson , Andrew Morton , Boris Ostrovsky , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dave Hansen , David Hildenbrand , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Juergen Gross , "Liam R. Howlett" , Lorenzo Stoakes , Madhavan Srinivasan , Michael Ellerman , Michal Hocko , Mike Rapoport , Nicholas Piggin , Peter Zijlstra , Ryan Roberts , Suren Baghdasaryan , Thomas Gleixner , Vlastimil Babka , Will Deacon , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Subject: [PATCH v3 03/13] powerpc/mm: implement arch_flush_lazy_mmu_mode() Date: Wed, 15 Oct 2025 09:27:17 +0100 Message-ID: <20251015082727.2395128-4-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20251015082727.2395128-1-kevin.brodsky@arm.com> References: <20251015082727.2395128-1-kevin.brodsky@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: 8bit Upcoming changes to the lazy_mmu API will cause arch_flush_lazy_mmu_mode() to be called when leaving a nested lazy_mmu section. Move the relevant logic from arch_leave_lazy_mmu_mode() to arch_flush_lazy_mmu_mode() and have the former call the latter. Signed-off-by: Kevin Brodsky --- .../powerpc/include/asm/book3s/64/tlbflush-hash.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h index 146287d9580f..7704dbe8e88d 100644 --- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h +++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h @@ -41,6 +41,16 @@ static inline void arch_enter_lazy_mmu_mode(void) batch->active = 1; } +static inline void arch_flush_lazy_mmu_mode(void) +{ + struct ppc64_tlb_batch *batch; + + batch = this_cpu_ptr(&ppc64_tlb_batch); + + if (batch->index) + __flush_tlb_pending(batch); +} + static inline void arch_leave_lazy_mmu_mode(void) { struct ppc64_tlb_batch *batch; @@ -49,14 +59,11 @@ static inline void arch_leave_lazy_mmu_mode(void) return; batch = this_cpu_ptr(&ppc64_tlb_batch); - if (batch->index) - __flush_tlb_pending(batch); + arch_flush_lazy_mmu_mode(); batch->active = 0; preempt_enable(); } -#define arch_flush_lazy_mmu_mode() do {} while (0) - extern void hash__tlbiel_all(unsigned int action); extern void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, -- 2.47.0