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 07C342F8EAC for ; Fri, 3 Jul 2026 16:23:38 +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=1783095820; cv=none; b=O7yv7ZhCZSRGq+xhzPxnU1KGFLJ91LQZv5fwdTOw3nR0zroqMvbHprN4HQ8BW6QZaMwx0ST3tPkDrR284+5AoSBjxghs0nKFct8GcOz+z26J5YKXI2U7WRYD1nr3BrYzt3YDUKlUu4YvAVAkqZkZ1HgDsDJgp6U9oWeWc5mxkxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783095820; c=relaxed/simple; bh=OJkNLDupetkf9888Yl8Q0denPqPZ7BJjE7CADWnnMj0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Ef1HWYxwbEUhgJM1u6evJTj3NW+z9MItEKNDvVAFP6xGvIRa4R8iH7u3HnvovS9a/N8iw9NcqUhtW37xIYBAXTML5MDvY7uPv0EbD7pyE+zcSHB/5y7cUYa69kkRS2eAdmF/9zra/5fgiXRDRQOqIepZyLuGo5IdO8HEmsVof9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W6mJ2lPS; 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="W6mJ2lPS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 202831F000E9; Fri, 3 Jul 2026 16:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783095817; bh=3K0E0NM72auILi8yROfk9NB1x+Dtfoc70vwQZ/qZzGo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=W6mJ2lPSSr7fQVHiCBRxmOm2J3VgKdsiAVnoh7UqlmUbmNBmpn5kG/gX7c3IpNRwq OahDuPuCMT4d5UBEGKkxvYhPwNKDH6vEapW/f8SI1XAlz1GFBJpaiwG2EFfSxfIrPg Ubou/UTUmIoZO4tF95ssEJq5VNddLoXdd//4oH5SslL54bxbJRr/CKQj5vMMdUmXy4 MkCnhYeh6xoNKWeezIgkX7pU0qKN49na3sl8jeog3qgpmewy9Kp1k0exXYDCb11k0Z be+/EH8cdmq3KzDsHP1NdAZSIUn/dnXMrpTfSA9C9VKcTn7XmfsZw3xnePWNIzX5Yc 4JWCaUqo2Sncg== From: Pratyush Yadav To: Borislav Petkov Cc: Pratyush Yadav , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Pasha Tatashin , Mike Rapoport , linux-kernel@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org Subject: Re: [PATCH v2] x86/setup: do not include kexec_handover.h from asm/setup.h In-Reply-To: <20260703153044.GCakfVpO_egX4B9y_1@fat_crate.local> (Borislav Petkov's message of "Fri, 3 Jul 2026 08:30:44 -0700") References: <20260703143705.2525168-1-pratyush@kernel.org> <20260703153044.GCakfVpO_egX4B9y_1@fat_crate.local> Date: Fri, 03 Jul 2026 18:23:33 +0200 Message-ID: <2vxzjyrcf3ei.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, Jul 03 2026, Borislav Petkov wrote: > On Fri, Jul 03, 2026 at 04:37:03PM +0200, Pratyush Yadav wrote: >> 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 uses anything from KHO. Remove the header from >> setup.h, and directly include it in setup.c. which does use things from >> KHO. Since kaslr.c is a part of the decompressor, avoid including linux >> headers there directly. Instead, split out struct kho_scratch, which is >> the only thing the kaslr.c uses, and move it to >> include/asm-generic/kexec_handover.h. >> >> This change 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 > > See my reply to Mike about using the generic-y infrastructure. To double check I got your point correctly, is this what you mean? diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index ac02aed8757b..22267a83e064 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -32,7 +32,7 @@ #include /* For COMMAND_LINE_SIZE */ #undef _SETUP -#include +#include extern unsigned long get_cmd_line_ptr(void); diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 078fd2c0d69d..47ef8cb482e3 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild @@ -15,3 +15,4 @@ generic-y += fprobe.h generic-y += mcs_spinlock.h generic-y += mmzone.h generic-y += ring_buffer.h +generic-y += kexec_handover.h -- Regards, Pratyush Yadav