Re: [PATCH 2/2] x86, boot: Optimize the elf header handling.

From: Eric W. Biederman
Date: Mon Jul 09 2012 - 02:50:56 EST


"H. Peter Anvin" <hpa@xxxxxxxxx> writes:

> On 07/01/2012 01:40 PM, Eric W. Biederman wrote:
>>
>> So I have tracked down part of the crazyness.
>> CONFIG_RODATA actually uses 2MB alignment, making
>> -z max_page_size=4096 a bit questionable.
>>
>
> Questionable how? It's not really like it matters since we're not going
> to mmap the ELF.

Questionable as in the current elf loader in misc.c relies on the fact
that there is an almost a fixed offset between physical addresses and
file offsets for all of the PT_LOAD segments in the Elf header.

In fact CONFIG_RODATA && CONFIG_X86_64 && CONFIG_SMP in combination with
-z max_page_size=4096 fails to boot. The Elf loader in misc.c starts
coping from lower addresses to higher addresses, instead of higher
addresses to lower and that fails miserably.

But -z max_page_size=4096 is not the problem the ELF loader is.

Eric
--
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/