[SRU][B][PATCH 1/1] UBUNTU: SAUCE: Revert "x86/mm: Don't free P4D table when it is folded at runtime"

Krzysztof Kozlowski krzysztof.kozlowski at canonical.com
Fri Oct 8 10:00:33 UTC 2021

BugLink: https://bugs.launchpad.net/bugs/1946464

This reverts commit 5047ef5725ed1b31e405e1f1a90881e44d1f0816 (commit
0e311d237d7f3022b7dafb639b42541bfb42fe94 upstream) which
should not be backported to v4.15:

1. It adds pgtable_l5_enabled which does not exist in v4.15,
2. It is marked as v4.17+,
3. It is marked as fixing commit which does not exist in v4.15 and was
   not backported there.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
 arch/x86/include/asm/pgalloc.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index 8df72517aafc..aff42e1da6ee 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -182,9 +182,6 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr)
 static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
-	if (!pgtable_l5_enabled)
-		return;
 	BUG_ON((unsigned long)p4d & (PAGE_SIZE-1));
 	free_page((unsigned long)p4d);

More information about the kernel-team mailing list