From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 692263BF66B for ; Fri, 21 Aug 2026 11:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787312094; cv=none; b=h8mePlSCLeG/AAddV5Z6oT9kGRGvOAx44/tdqrjsrLPhyNCG9ej7ZZ/KUtm9AqTyvW5/4kesy4bn3MmedNdeXP8Pk21uSxYdb0kdhW96HraY1YmFkMf6p/8LsPQDjqO2j1A2/OoCpeR6E337AaMtexzMEYDId/gM0uDnxQ+EefE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787312094; c=relaxed/simple; bh=ji79cA6IFVQVHnmikaVynVv+SKDQlTU44eKywhqziT8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=laQ9MWOPD183D9cnIJGxNTQDjsCd/Q0Zu+4T/oUQdPonCPpxsx3abeZw3Tb2oY4j9ryJo0stL0uLykK+HqrUsbeCrEG/sWy36vF1d+UpFLyguRviXBzgQHE6UrSnP6L6yg4BFyXVOg9AOzpub+yBkVef9jDdxHldTTiyYU2pZcU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GfHCO7b7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GfHCO7b7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C7001F000E9; Fri, 21 Aug 2026 11:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787312093; bh=kJK8zYVP422FvpgoMi2IYMM8fvVyRmiBglfOTp8DIAA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GfHCO7b71pDpL2ixqylgh76wjhe8mKsSfm32uTm22AvSEp6o5YPls8px3oH8ooGM4 ngTloyRJaLnVJQ/9nGdGqz2UghBZGeOPjDazczTK5CUA+H+PNdsarsqtjo/cUwU7ap s4VUY7LndqGeDBDFhAe/kqp9OixfyCzBB4W99W8xxGlWKvqiA5Byhf4QTjyHrpKxH2 EnmuMl5QbcFa3ltN0JdprQGnI2dw/QzsGufcidXUYZMypFNqg+U4J2HE2fQHirvUBf DfnOwK++CLRQxIelsxzJ6uE3IIZWBmpBIA5HeEjVq2St1M06sYslODdSGiVs3N+h+q o6qVoQAl+knHQ== From: Pratyush Yadav To: Sourabh Jain Cc: linuxppc-dev@lists.ozlabs.org, Aditya Gupta , Alexander Graf , Andrew Morton , Baoquan He , "Christophe Leroy (CS GROUP)" , Hari Bathini , Madhavan Srinivasan , Mahesh Salgaonkar , Michael Ellerman , Mike Rapoport , Nicholas Piggin , Pasha Tatashin , Pratyush Yadav , "Ritesh Harjani (IBM)" , Shivang Upadhyay , Shrikanth Hegde , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Clapinski Subject: Re: [RFC PATCH 3/3] powerpc/kho: exclude THP and HUGETLB_PAGE In-Reply-To: <20260821105609.983622-4-sourabhjain@linux.ibm.com> (Sourabh Jain's message of "Fri, 21 Aug 2026 16:26:09 +0530") References: <20260821105609.983622-1-sourabhjain@linux.ibm.com> <20260821105609.983622-4-sourabhjain@linux.ibm.com> Date: Fri, 21 Aug 2026 13:34:48 +0200 Message-ID: <2vxzecfrzoyv.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Aug 21 2026, Sourabh Jain wrote: > Enabling CONFIG_KEXEC_HANDOVER together with CONFIG_TRANSPARENT_HUGEPAGE > or CONFIG_HUGETLB_PAGE on powerpc fails to build: > > kernel/liveupdate/kexec_handover.c:49:39: error: expression in static assertion is not constant > 49 | static_assert(SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES); > ./include/linux/build_bug.h:80:56: note: in definition of macro '__static_assert' > 80 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) > | ^~~~ > kernel/liveupdate/kexec_handover.c:49:1: note: in expansion of macro 'static_assert' > 49 | static_assert(SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES); > > CMA_MIN_ALIGNMENT_BYTES is derived from pageblock_order, which on > powerpc is not a compile-time constant when THP or HUGETLB_PAGE is > enabled -- powerpc can determine huge page size at runtime in that > configuration, so pageblock_order becomes a variable rather than a > constant expression. KHO's static_assert() on > SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES then fails to > compile, since it requires both sides to be constant expressions. > > Until CMA_MIN_ALIGNMENT_BYTES (or KHO's use of it) is made to handle > the non-constant pageblock_order case on powerpc, exclude > TRANSPARENT_HUGEPAGE and HUGETLB_PAGE from ARCH_SUPPORTS_KEXEC_HANDOVER > so the two can't be enabled together and hit this build failure. This should be a part of patch 2 I think. It is not a good idea to break the build in one patch and fix it in the next. That said, this is a debug check of sorts since SCRATCH_ALIGNMENT_BYTES is of MAX_ORDER_NR_PAGES, and pageblocks _should_ always be smaller of equal to this. Anyway, I don't think this is something you should gate by a config. I think you should either remove the static_assert(), or turn it into a runtime check. +Cc Michal. > > Cc: Aditya Gupta > Cc: Alexander Graf > Cc: Andrew Morton > Cc: Baoquan He > Cc: Christophe Leroy (CS GROUP) > Cc: Hari Bathini > Cc: Madhavan Srinivasan > Cc: Mahesh Salgaonkar > Cc: Michael Ellerman > Cc: Mike Rapoport > Cc: Nicholas Piggin > Cc: Pasha Tatashin > Cc: Pratyush Yadav > Cc: Ritesh Harjani (IBM) > Cc: Shivang Upadhyay > Cc: Shrikanth Hegde > Cc: kexec@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Sourabh Jain > --- > arch/powerpc/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 61350d3e7a19..f68b9fc883ba 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -720,6 +720,7 @@ config ARCH_SUPPORTS_KEXEC_HANDOVER > def_bool y > depends on PPC64 > depends on !CRASH_DUMP > + depends on !TRANSPARENT_HUGEPAGE && !HUGETLB_PAGE > > config ARCH_SUPPORTS_CRASH_HOTPLUG > def_bool y -- Regards, Pratyush Yadav