From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 12/20] powerpc/32s: Inline flush_tlb_range() and flush_tlb_kernel_range()
Date: Thu, 22 Oct 2020 06:29:37 +0000 (UTC) [thread overview]
Message-ID: <c7029a78e78709ad9272d7a44260e06b649169b2.1603348103.git.christophe.leroy@csgroup.eu> (raw)
In-Reply-To: <648e2448e938d52d0b5887445e018ca584edc06d.1603348103.git.christophe.leroy@csgroup.eu>
flush_tlb_range() and flush_tlb_kernel_range() are trivial calls to
flush_range().
Make flush_range() global and inline flush_tlb_range()
and flush_tlb_kernel_range().
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/book3s/32/tlbflush.h | 15 ++++++++--
arch/powerpc/mm/book3s32/tlb.c | 30 +++++--------------
2 files changed, 19 insertions(+), 26 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/32/tlbflush.h b/arch/powerpc/include/asm/book3s/32/tlbflush.h
index 542765944531..2f480d184526 100644
--- a/arch/powerpc/include/asm/book3s/32/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/32/tlbflush.h
@@ -8,9 +8,7 @@
*/
void hash__flush_tlb_mm(struct mm_struct *mm);
void hash__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
-extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
- unsigned long end);
-extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
+void flush_range(struct mm_struct *mm, unsigned long start, unsigned long end);
#ifdef CONFIG_SMP
void _tlbie(unsigned long address);
@@ -38,6 +36,17 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmad
_tlbie(vmaddr);
}
+static inline void
+flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
+{
+ flush_range(vma->vm_mm, start, end);
+}
+
+static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
+{
+ flush_range(&init_mm, start, end);
+}
+
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
diff --git a/arch/powerpc/mm/book3s32/tlb.c b/arch/powerpc/mm/book3s32/tlb.c
index 65389bfe2eb8..f9b8e1ce4371 100644
--- a/arch/powerpc/mm/book3s32/tlb.c
+++ b/arch/powerpc/mm/book3s32/tlb.c
@@ -71,8 +71,12 @@ void tlb_flush(struct mmu_gather *tlb)
* -- Cort
*/
-static void flush_range(struct mm_struct *mm, unsigned long start,
- unsigned long end)
+/*
+ * For each address in the range, find the pte for the address
+ * and check _PAGE_HASHPTE bit; if it is set, find and destroy
+ * the corresponding HPTE.
+ */
+void flush_range(struct mm_struct *mm, unsigned long start, unsigned long end)
{
pmd_t *pmd;
unsigned long pmd_end;
@@ -105,15 +109,7 @@ static void flush_range(struct mm_struct *mm, unsigned long start,
++pmd;
}
}
-
-/*
- * Flush kernel TLB entries in the given range
- */
-void flush_tlb_kernel_range(unsigned long start, unsigned long end)
-{
- flush_range(&init_mm, start, end);
-}
-EXPORT_SYMBOL(flush_tlb_kernel_range);
+EXPORT_SYMBOL(flush_range);
/*
* Flush all the (user) entries for the address space described by mm.
@@ -145,18 +141,6 @@ void hash__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
}
EXPORT_SYMBOL(hash__flush_tlb_page);
-/*
- * For each address in the range, find the pte for the address
- * and check _PAGE_HASHPTE bit; if it is set, find and destroy
- * the corresponding HPTE.
- */
-void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
- unsigned long end)
-{
- flush_range(vma->vm_mm, start, end);
-}
-EXPORT_SYMBOL(flush_tlb_range);
-
void __init early_init_mmu(void)
{
}
--
2.25.0
next prev parent reply other threads:[~2020-10-22 6:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 6:29 [PATCH v1 01/20] powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32 Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 02/20] powerpc/mm: Add mask of always present MMU features Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 03/20] powerpc/mm: Remove flush_tlb_page_nohash() prototype Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 04/20] powerpc/32s: Make bat_addrs[] static Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 05/20] powerpc/32s: Use mmu_has_feature(MMU_FTR_HPTE_TABLE) instead of checking Hash var Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 06/20] powerpc/32s: Make Hash var static Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 07/20] powerpc/32s: Declare Hash related vars as __initdata Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 08/20] powerpc/32s: Move _tlbie() and _tlbia() prototypes to tlbflush.h Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 09/20] powerpc/32s: Inline _tlbie() on non SMP Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 10/20] powerpc/32s: Move _tlbie() and _tlbia() in a new file Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 11/20] powerpc/32s: Split and inline flush_tlb_mm() and flush_tlb_page() Christophe Leroy
2020-10-22 6:29 ` Christophe Leroy [this message]
2020-10-22 6:29 ` [PATCH v1 13/20] powerpc/32s: Split and inline flush_range() Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 14/20] powerpc/32s: Inline tlb_flush() Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 15/20] powerpc/32s: Inline flush_hash_entry() Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 16/20] powerpc/32s: Move early_mmu_init() into mmu.c Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 17/20] powerpc/32s: Remove CONFIG_PPC_BOOK3S_6xx Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 18/20] powerpc/32s: Regroup 603 based CPUs in cputable Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 19/20] powerpc/32s: Make support for 603 and 604+ selectable Christophe Leroy
2020-10-22 6:29 ` [PATCH v1 20/20] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected Christophe Leroy
2020-12-15 10:53 ` [PATCH v1 01/20] powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32 Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7029a78e78709ad9272d7a44260e06b649169b2.1603348103.git.christophe.leroy@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).