Re: [GIT PULL] Squashfs updates for 2.6.34

From: H. Peter Anvin
Date: Wed Mar 03 2010 - 23:53:17 EST


On 03/03/2010 07:49 PM, Linus Torvalds wrote:
>
> So rather than have those crazy header file tricks, can we just add a
> kmalloc() _library_ file for the crazy bootloader crud, so that the
> bootloader could just share header files with the regular kernel, and not
> do that crazy thing?
>
> It's insane having that malloc() implementation, and those STATIC games,
> in a header file, and the games we play with "error()" sometimes being a
> function pointer and sometimes being a function. Crazy, crazy.
>

If with library you mean a linking library, that won't work everywhere,
because on some platforms the early-kernel decompressor needs to be
compiled with differently than the kernel as a whole. However, it would
be easy enough to have a source-level library (I don't mean an include
file, obviously) and a common include file to wrap this all up in.

> So Phillip split up these things:
>
> #ifdef STATIC
> /* Code active when included from pre-boot environment: */
> #define INIT
> #else
> /* Compile for initramfs/initrd code only */
> #define INIT __init
> static void(*error)(char *m);
> #endif
>
> and I refuse to see three new copies of that disgusting thing (bunzip,
> inflate, lzma). So I'd really _really_ want for the pre-boot environment
> to have that same __init declaration, and the _same_ indirect error()
> handler model, so that we don't have this kind of thing spreading.

Such a common header file for the preboot environment could simply do:

#undef __init

... and be done with it. That way we don't have to worry about mucking
with $DEITY knows how many linker scripts... it seems the easiest, and
would certainly eliminate any uglies outside the common file.

> It was ugly enough in <compress/mm.h> (which really should be nuked from
> orbit - it's the only way to be sure), but when I see it spreading, I go
> into full zombie-attack mode, and want to start up the chainsaw and run
> around naked.

OK, we really really don't want that... simply because there just aren't
enough zombies to go around already. Last I heard, the EPA was
considering classifying them as an endangered species, only to get stuck
in a bureaucratic mess if they can be classified as a "species" at all,
or if they should be classified together with bread mold, toxic waste
and Microsoft salesmen.

The only problem with this is that it'll touch nearly every
architecture, so it probably is going to have to be .35 material.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/