]> git.baikalelectronics.ru Git - kernel.git/commit
x86/efi: Fixup GOT in all boot code paths
authorMatt Fleming <matt.fleming@intel.com>
Fri, 5 Sep 2014 13:52:26 +0000 (14:52 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Mon, 8 Sep 2014 19:52:02 +0000 (20:52 +0100)
commit5ca9645fab2bbf41df9832466f3113e4eb5ef297
tree4828f610aab906bd7f4190ac32da0f777271480c
parent6710a52e8186b7030a3bdf0cccd2da27bb5d2a46
x86/efi: Fixup GOT in all boot code paths

Maarten reported that his Macbook pro 8.2 stopped booting after commit
88c9a090a848d6 ("efi/x86: efistub: Move shared dependencies to
<asm/efi.h>"), the main feature of which is changing the visibility of
symbol 'efi_early' from local to global.

By making 'efi_early' global we end up requiring an entry in the Global
Offset Table. Unfortunately, while we do include code to fixup GOT
entries in the early boot code, it's only called after we've executed
the EFI boot stub.

What this amounts to is that references to 'efi_early' in the EFI boot
stub don't point to the correct place.

Since we've got multiple boot entry points we need to be prepared to
fixup the GOT in multiple places, while ensuring that we never do it
more than once, otherwise the GOT entries will still point to the wrong
place.

Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S