Re: [PATCH v1] arm64: tlb: fix the TTL value of tlb_get_level

From
Will Deacon <will@kernel.org>
Date
2021-06-24 08:29:40
Also in
linux-arch, linux-mm, lkml
Reply to
Zhenyu Ye, 2021-06-24
On Thu, Jun 24, 2021 at 09:55:53AM +0800, Zhenyu Ye wrote:
On 2021/6/23 19:04, Will Deacon wrote:
quoted
On Wed, Jun 23, 2021 at 03:05:22PM +0800, Zhenyu Ye wrote:
quoted
diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
index 61c97d3b58c7..c995d1f4594f 100644
--- a/arch/arm64/include/asm/tlb.h
+++ b/arch/arm64/include/asm/tlb.h
@@ -28,6 +28,10 @@ static void tlb_flush(struct mmu_gather *tlb);
  */
 static inline int tlb_get_level(struct mmu_gather *tlb)
 {
+	/* The TTL field is only valid for the leaf entry. */
+	if (tlb->freed_tables)
+		return 0;
+
 	if (tlb->cleared_ptes && !(tlb->cleared_pmds ||
 				   tlb->cleared_puds ||
 				   tlb->cleared_p4ds))
Thanks. I can't see a better way around this, so I'll queue the patch.
The stage-2 page-table code looks ok afaict, but please can you check it
too?
The stage-2 page-table codes seem to be correct to me.
Thanks for having a look.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (6 messages) 6 messages, 3 authors, last reply 2021-06-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help