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 319C0362138 for ; Wed, 1 Jul 2026 15:15:52 +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=1782918954; cv=none; b=Ch+VJNwJAlt5Pl94z6aMPStcgAA/WOkavfSuI0OFyDVH6wBjYjg/2duXVpnIdh57XPrPcvgGs/SOrB9OsFbGJyxol/TngCM3J7CNmENhJiLb+xEYc4BrSflA3zkcUgnMt0gQ94aWusVu7JBqfjg/EYa+o4nSVG9fkN3n8BieniA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782918954; c=relaxed/simple; bh=sdYVQT/Fy8L2RMbLfcyp03aIrgHOs3fYiVErh1zzfNQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LwDjNjfJ0g2z0EkWM+cZ4m3ARTeeWbYawMAeApXYgdyMrYrx4dyYXcyK5hHZ4nIw1ks8flm90B28RDYfvuNKvCCFyiJlKEh3P23lfIBWcKCy874NC23Xu+VPU6LdwuaBE90lFzaT+LG9tTS6M5r8zb11P6aig3Upi72piQM7Vc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kzLh9YmF; 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="kzLh9YmF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5A811F000E9; Wed, 1 Jul 2026 15:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782918952; bh=28GFcGlf5S/Wg6fceTzSn/krnl8/+QQ2NhLnruhBKdI=; h=From:To:Cc:Subject:Date; b=kzLh9YmFozSJwGrqR/2vdrlr2T7VPtgQDYQuCeMR/FRumugqwJhZk+iqtfugz9kWs F8hb4fjEh8oomodtJg0xSpLHMRmQPU3423QNkHplmjRnlzlhGmTsNUPsT3SvtnQ+ah 4rztqX46tU1lO6ptR6DVRfVKOGWv7Vr0hfOEB4OmPSqRfYtwZ80474Pe+iY3d++8n5 qP8MmfN5sAP2WhWqxVy/6o1Fzu1dPJWgRJBqh2OQefCLCsh3YOnlkIu/s0s7ajwKI4 nKrIAp58cXHX9lq6iKinEfpQX+iqPbPyYOcs5jCoU3fPFlja2fz45ujT2m0wTsB/vD +5iHJ5VPqsvBA== From: Pratyush Yadav To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Pasha Tatashin , Mike Rapoport , Pratyush Yadav Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org Subject: [PATCH] x86/setup: do not include kexec_handover.h from asm/setup.h Date: Wed, 1 Jul 2026 17:15:33 +0200 Message-ID: <20260701151536.3068791-1-pratyush@kernel.org> X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pratyush Yadav (Google)" x86 asm/setup.h includes linux/kexec_handover.h. This is because it is used by setup.c and kaslr.c. But this inclusion is problematic. The header is included in many places, so it results in the KHO header being propagated there. Also, the setup header is used by realmode code. If KHO header includes things like mm.h, it causes a big dump of compliation failures. Nothing in setup.h anything from KHO. Remove the header from setup.h, and directly include it in setup.c and kaslr.c, which do use things from KHO. It should also help reduce files recompiled when kexec_handover.h changes. Signed-off-by: Pratyush Yadav (Google) --- Notes: Thomas/Ingo/Borislav/Dave, is it okay if we take this patch through the live update tree? I have a patch series for KHO that depends on this, but it is 20 odd patches and I don't want to spam the x86 list with them. So I am sending this change out separately. It is an improvement on its own anyway since it reduces recompilation on kexec_handover.h changes. All the changed files see relatively low patch traffic so chances of conflicts should minimal I think. And if there are any, I imagine they will be relatively simple to resolve. arch/x86/boot/compressed/kaslr.c | 2 ++ arch/x86/include/asm/setup.h | 2 -- arch/x86/kernel/setup.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index 8e4bf5365ac6..db4afe1df738 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -32,6 +32,8 @@ #include /* For COMMAND_LINE_SIZE */ #undef _SETUP +#include + extern unsigned long get_cmd_line_ptr(void); /* Simplified build-specific string for starting entropy. */ diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 914eb32581c7..895d09faaf83 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -69,8 +69,6 @@ extern void x86_ce4100_early_setup(void); static inline void x86_ce4100_early_setup(void) { } #endif -#include - #ifndef _SETUP #include diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 46882ce79c3a..5ebb521e136d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include -- 2.55.0.rc0.799.gd6f94ed593-goog