[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fd2faee37876dc6ea93d0b8dcd001e13d77c3272.1734164094.git.zhengqi.arch@bytedance.com>
Date: Sat, 14 Dec 2024 17:02:49 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: peterz@...radead.org,
tglx@...utronix.de,
david@...hat.com,
jannh@...gle.com,
hughd@...gle.com,
yuzhao@...gle.com,
willy@...radead.org,
muchun.song@...ux.dev,
vbabka@...nel.org,
lorenzo.stoakes@...cle.com,
akpm@...ux-foundation.org,
rientjes@...gle.com
Cc: linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Qi Zheng <zhengqi.arch@...edance.com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 03/12] arm64: pgtable: use mmu gather to free p4d level page table
Like other levels of page tables, also use mmu gather mechanism to free
p4d level page table.
Signed-off-by: Qi Zheng <zhengqi.arch@...edance.com>
Cc: linux-arm-kernel@...ts.infradead.org
---
arch/arm64/include/asm/pgalloc.h | 2 --
arch/arm64/include/asm/tlb.h | 14 ++++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h
index 679c530549327..58cc260b6bee8 100644
--- a/arch/arm64/include/asm/pgalloc.h
+++ b/arch/arm64/include/asm/pgalloc.h
@@ -100,8 +100,6 @@ static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
if (pgtable_l5_enabled())
__p4d_free(mm, p4d);
}
-
-#define __p4d_free_tlb(tlb, p4d, addr) p4d_free((tlb)->mm, p4d)
#else
static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t p4dp, pgdval_t prot)
{
diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
index a947c6e784ed2..445282cde9afb 100644
--- a/arch/arm64/include/asm/tlb.h
+++ b/arch/arm64/include/asm/tlb.h
@@ -111,4 +111,18 @@ static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pudp,
}
#endif
+#if CONFIG_PGTABLE_LEVELS > 4
+static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4dp,
+ unsigned long addr)
+{
+ struct ptdesc *ptdesc = virt_to_ptdesc(p4dp);
+
+ if (!pgtable_l5_enabled())
+ return;
+
+ pagetable_p4d_dtor(ptdesc);
+ tlb_remove_ptdesc(tlb, ptdesc);
+}
+#endif
+
#endif
--
2.20.1
Powered by blists - more mailing lists