Re: [REGRESSION] "efi: efistub: Convert into static library" and preparation patches

From: Josh Boyer
Date: Mon Sep 22 2014 - 14:44:30 EST

On Fri, Sep 5, 2014 at 4:27 PM, Matt Fleming <matt@xxxxxxxxxxxxxxxxx> wrote:
> On Thu, 04 Sep, at 10:37:53PM, Matt Fleming wrote:
>> Thanks Ard, I'll take a look in the morning.
> Maarten, could you try out this patch?
> ---
> From a058d81d9687671813560af72f34d63da3cc16bc Mon Sep 17 00:00:00 2001
> From: Matt Fleming <matt.fleming@xxxxxxxxx>
> Date: Fri, 5 Sep 2014 14:52:26 +0100
> Subject: [PATCH] x86/efi: Fixup GOT in all boot code paths
> Maarten reported that his Macbook pro 8.2 stopped booting after commit
> f23cf8bd5c1f49 ("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@xxxxxxxxxxxxx>
> Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
> Signed-off-by: Matt Fleming <matt.fleming@xxxxxxxxx>

This wound up in rc6 as commit
9cb0e394234d244fe5a97e743ec9dd7ddff7e64b. That caused all the EFI
machines I have to no longer boot. They hang after the 'setup_efi_pci
failed' message and I get nothing from the kernel at all, even with
earlyprintk, etc.

I did a git bisect between rc5 and rc6 and it points to this commit.
This is a typical Fedora setup, which is EFI->shim->grub2->kernel. It
broke the boot on multiple machines I have, and I've confirmed that a
revert on top of rc6 makes things boot again on both my macbook and my
tunnel mountain machine. I'll be testing it on my celeron and i7
based NUC machines as well, but I expect similar results.

Is there something I can do to help debug why this is failing on this
kind of setup? Config and bisect log are attached below for the
macbook I used for the bisect.


Attachment: BISECT_LOG
Description: Binary data

Attachment: efi.config
Description: Binary data