Re: [RFC PATCH] x86/boot: Get rid of linux/init.h include
From: Brian Gerst
Date: Mon Nov 25 2024 - 11:57:56 EST
On Mon, Nov 25, 2024 at 6:08 AM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Mon, Nov 25, 2024 at 09:24:28AM +0100, Ingo Molnar wrote:
> > And if someone doesn't add the ugly KERNEL_PROPER_HEADER defines to a
> > new header that somehow gets included into the decompressor build
> > virally, it won't fire either. I think it's better to concentrate the
> > uglies in the 'weird' code, ie. the decompressor.
>
> Yes, I'd need to think of something slicker...
>
> > Also, what's the root problem being solved? The changelog says:
> >
> > > no collisions and ugly ifdeffery when those kernel proper headers
> > > get shared.
> >
> > But that's pretty vague - is there some recent build regression this is
> > responding to? Which kernel headers collided with which headers used by
> > the decompressor build?
>
> The sharing of headers has always been a PITA. Because the decompressor is
> different from kernel proper, the moment you start including kernel proper
> headers for functionality, you need to exempt or add ifdeffery or do some
> other weird dance to be able to share those headers.
>
> Things like below are only some examples.
>
> So I'd like to separate the two namespaces and only share common functionality
> through asm/shared/ and avoid all that ugly ifdeffery and workarounds we're
> doing. Because each time we have to touch the decompressor - and we get to
> touch it a lot with the confidential computing stuff recently - it is like
> a house of cards.
>
> I hope that makes sense.
How about removing the kernel headers that you don't want from the
include path? This is a part of a broader issue where different parts
of the kernel need different compiler flags (main kernel, VDSO, boot,
etc.) and the current makefile structure doesn't handle that very
well.
Brian Gerst