From: Anshuman Khandual Date: Fri, 31 Oct 2025 07:12:55 +0000 (+0000) Subject: arm64/mm: Ensure PGD_SIZE is aligned to 64 bytes when PA_BITS = 52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2e21a9757b9035d9f649e464c0b254cbbe8a148;p=thirdparty%2Flinux.git arm64/mm: Ensure PGD_SIZE is aligned to 64 bytes when PA_BITS = 52 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 Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c index 8160cff35089d..bf5110b91e2fa 100644 --- a/arch/arm64/mm/pgd.c +++ b/arch/arm64/mm/pgd.c @@ -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 /*