]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64/mm: Ensure PGD_SIZE is aligned to 64 bytes when PA_BITS = 52
authorAnshuman Khandual <anshuman.khandual@arm.com>
Fri, 31 Oct 2025 07:12:55 +0000 (07:12 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 11 Nov 2025 19:13:03 +0000 (19:13 +0000)
Although the comment clearly states about PGD table's alignment requirement
(when PA_BITS = 52) but the subsequent BUILD_BUG_ON() tests size comparison
to 64 bytes instead. So change it as an actual alignment test.

Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/pgd.c

index 8160cff35089d2d3c3d68b7a6b9637c2bd1f2609..bf5110b91e2faab35d567a6264dd2bb5c9d2fe8d 100644 (file)
@@ -56,7 +56,7 @@ void __init pgtable_cache_init(void)
         * With 52-bit physical addresses, the architecture requires the
         * top-level table to be aligned to at least 64 bytes.
         */
-       BUILD_BUG_ON(PGD_SIZE < 64);
+       BUILD_BUG_ON(!IS_ALIGNED(PGD_SIZE, 64));
 #endif
 
        /*