linux-stable/arch/x86/boot
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
..
compressed x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
tools x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
.gitignore x86: remove offsets.h from .gitignore and dontdiff 2012-11-19 14:10:53 +01:00
a20.c
apm.c
bioscall.S x86, boot: Move intcall() to the .inittext section 2014-01-04 14:29:08 -08:00
bitops.h
boot.h x86, boot: Move CPU flags out of cpucheck 2013-10-13 03:12:02 -07:00
cmdline.c x86, boot: Pass cmd_line_ptr with unsigned long instead 2013-01-29 15:26:09 -08:00
code16gcc.h
copy.S x86, boot: Use .code16 instead of .code16gcc 2014-01-04 13:59:06 -08:00
cpu.c
cpucheck.c x86, boot: Rename get_flags() and check_flags() to *_cpuflags() 2013-10-13 04:08:56 -07:00
cpuflags.c x86, boot: Fix word-size assumptions in has_eflag() inline asm 2014-01-30 08:04:32 -08:00
cpuflags.h x86, boot: Rename get_flags() and check_flags() to *_cpuflags() 2013-10-13 04:08:56 -07:00
ctype.h
early_serial_console.c x86, setup: Fix earlyprintk=serial,0x3f8,115200 2010-09-21 10:18:33 -07:00
edd.c
header.S x86/boot: Cleanup header.S by removing some #ifdefs 2014-03-04 21:23:34 +00:00
install.sh
main.c keyboard: Use BIOS Keyboard variable to set Numlock 2012-05-08 14:19:41 -07:00
Makefile x86/efi: Firmware agnostic handover entry points 2014-03-04 21:25:06 +00:00
mca.c
memory.c x86, setup: When probing memory with e801, use ax/bx as a pair 2011-04-25 14:52:37 -07:00
mkcpustr.c UAPI: Partition the header include path sets and add uapi/ header directories 2012-10-02 18:01:26 +01:00
mtools.conf.in
pm.c
pmjump.S
printf.c x86/boot: Fix a sanity check in printf.c 2013-08-14 11:48:41 +02:00
regs.c
setup.ld x86, boot: Define the 2.12 bzImage boot protocol 2013-01-27 15:56:37 -08:00
string.c x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
tty.c
version.c
vesa.h
video-bios.c
video-mode.c
video-vesa.c
video-vga.c
video.c
video.h x86, boot: Use __attribute__((used)) to ensure videocard structs are emitted 2014-01-22 04:21:45 -08:00