Re: [PATCH] x86: relocs is only used with 32bit

From: Eric W. Biederman
Date: Fri Mar 13 2009 - 18:29:59 EST


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

> Hi Yinghai,
>
> In general I prefer minimizing the conditional sections rather than
> maximizing them. If nothing else, it catches errors earlier that way,
> and makes it easier to eventually eliminate them entirely.

Makes sense. Although in this case that rule appears like it
can't even execute on x86_64.

The architectural differences result in different tradeoffs so the
relocation design is completely different on x86_64 and x86_32.

On x86_64 we just change the underlying page tables to point
at different physical addresses and have a fixed virtual address.
Since x86_64 is best with short (< 2GB) offsets that is a fairly
optimal.

On x86_32 where address space is precious and it doesn't really
matter where the kernel lives we take a 5% or so size penalty
to hold relocations in the binary and update the kernel at boot
time so everything assumes we run at the loaded address.

With the result that we need a link time helper on x86_32 and
not on x86_64.

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/