linux/arch/x86/boot/compressed
Matt Fleming b8ff87a615 x86/efi: Firmware agnostic handover entry points
The EFI handover code only works if the "bitness" of the firmware and
the kernel match, i.e. 64-bit firmware and 64-bit kernel - it is not
possible to mix the two. This goes against the tradition that a 32-bit
kernel can be loaded on a 64-bit BIOS platform without having to do
anything special in the boot loader. Linux distributions, for one thing,
regularly run only 32-bit kernels on their live media.

Despite having only one 'handover_offset' field in the kernel header,
EFI boot loaders use two separate entry points to enter the kernel based
on the architecture the boot loader was compiled for,

    (1) 32-bit loader: handover_offset
    (2) 64-bit loader: handover_offset + 512

Since we already have two entry points, we can leverage them to infer
the bitness of the firmware we're running on, without requiring any boot
loader modifications, by making (1) and (2) valid entry points for both
CONFIG_X86_32 and CONFIG_X86_64 kernels.

To be clear, a 32-bit boot loader will always use (1) and a 64-bit boot
loader will always use (2). It's just that, if a single kernel image
supports (1) and (2) that image can be used with both 32-bit and 64-bit
boot loaders, and hence both 32-bit and 64-bit EFI.

(1) and (2) must be 512 bytes apart at all times, but that is already
part of the boot ABI and we could never change that delta without
breaking existing boot loaders anyhow.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2014-03-04 21:25:06 +00:00
..
.gitignore x86, boot: add new generated files to the appropriate .gitignore files 2009-06-02 21:13:30 -07:00
aslr.c x86, kaslr: Remove unused including <linux/version.h> 2014-01-14 10:45:56 -08:00
cmdline.c x86, kaslr: Return location from decompress_kernel 2013-10-13 03:12:07 -07:00
cpuflags.c x86, boot: Rename get_flags() and check_flags() to *_cpuflags() 2013-10-13 04:08:56 -07:00
early_serial_console.c x86, boot: Exclude early_serial_console.c if can't use it. 2012-07-21 11:07:34 -07:00
eboot.c x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
eboot.h x86/efi: Build our own EFI services pointer table 2014-03-04 21:25:03 +00:00
efi_stub_32.S x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
efi_stub_64.S x86/efi: Add early thunk code to go from 64-bit to 32-bit 2014-03-04 21:25:04 +00:00
head_32.S x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
head_64.S x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
Makefile Merge branch 'x86-kaslr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-01-20 14:45:50 -08:00
misc.c x86, kaslr: Select random position from e820 maps 2013-10-13 03:12:19 -07:00
misc.h x86, kaslr: Select random position from e820 maps 2013-10-13 03:12:19 -07:00
mkpiggy.c x86: mkpiggy.c: Explicitly close the output file 2013-10-08 11:36:09 -07:00
string.c x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
vmlinux.lds.S x86, setup: Allow global variables and functions in the decompressor 2010-08-02 15:34:44 -07:00