Bug 191121 - 4.9.0 fails to boot on Thinkpad T540p in UEFI mode
Summary: 4.9.0 fails to boot on Thinkpad T540p in UEFI mode
Status: RESOLVED CODE_FIX
Alias: None
Product: EFI
Classification: Unclassified
Component: Boot (show other bugs)
Hardware: x86-64 Linux
: P1 high
Assignee: EFI Virtual User
URL: https://bugs.gentoo.org/show_bug.cgi?...
Keywords:
: 190251 191801 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-25 18:35 UTC by Anton Gubarkov
Modified: 2017-05-03 14:36 UTC (History)
10 users (show)

See Also:
Kernel Version: 4.9.0
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
screen photo (1.59 MB, image/jpeg)
2017-01-10 10:52 UTC, Anton Gubarkov
Details
Upstream fix (5.84 KB, patch)
2017-01-10 12:59 UTC, Matt Fleming
Details | Diff

Description Anton Gubarkov 2016-12-25 18:35:13 UTC
Kernel prints nothing after last grub output. 
init is not started.

I bisected between 4.8.0 and 4.9.0 and arrived at the following commit:

8e80632fb23f021ce5a6957f2edcdae4645a7030 is the first bad commit
commit 8e80632fb23f021ce5a6957f2edcdae4645a7030
Author: Matt Fleming <matt@codeblueprint.co.uk>
Date:   Tue Mar 1 23:08:03 2016 +0000

    efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()
    
    We can use the new efi_mem_reserve() API to mark the ESRT table as
    reserved forever and save ourselves the trouble of copying the data
    out into a kmalloc buffer.
    
    The added advantage is that now the ESRT driver will work across
    kexec reboot.
    
    Tested-by: Dave Young <dyoung@redhat.com> [kexec/kdump]
    Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> [arm]
    Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Leif Lindholm <leif.lindholm@linaro.org>
    Cc: Peter Jones <pjones@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>

:040000 040000 83ec82e63717a5b37c5826001a053690e69b32fa efdb5cd4de6cb52062c4c719a2ed1bb1032845b5 M	drivers
Comment 1 Xavier Coulon 2016-12-30 15:50:32 UTC
Same issue with Kernel 4.9.0 on openSUSE Tumbleweed and Lenovo W540 in UEFI mode.
Comment 2 neurolabs.de 2017-01-06 15:04:29 UTC
Same on Lenovo T440p, BIOS version 2.34, most recent available 2.39.
Comment 3 Mike Cloaked 2017-01-06 19:52:27 UTC
Do users who have this issue have LUKS encrypted drives?
Comment 4 Anton Gubarkov 2017-01-06 20:04:43 UTC
I don't.
Comment 5 Evgeny Laktanov 2017-01-07 19:12:03 UTC
Same issue on Thinkpad Edge E545 with 4.9.0 on gentoo, no encrypted devices, no significant kernel config changes compared to 4.8.15. Might actually be a Lenovo thing.
Comment 6 Linus Lotz 2017-01-09 14:48:20 UTC
*** Bug 190251 has been marked as a duplicate of this bug. ***
Comment 7 Linus Lotz 2017-01-09 14:56:37 UTC
I have the same problem. I got a backtrace using earlyprintk=efi.
Crash is in efi_memmap_insert. I included a screenshot in https://bugzilla.kernel.org/show_bug.cgi?id=190251
Comment 8 Anton Gubarkov 2017-01-10 08:12:36 UTC
I have raised an incident 170110-000180 with Lenovo support as the problem seems to affect Lenovo products only.
Comment 9 Anton Gubarkov 2017-01-10 10:36:53 UTC
I got a negative reply from lenovo support. They don't support linux and will not take any action.
Comment 10 Anton Gubarkov 2017-01-10 10:52:04 UTC
Created attachment 251111 [details]
screen photo

crash in efi_memmap_insert
Comment 11 Matt Fleming 2017-01-10 12:59:27 UTC
Created attachment 251121 [details]
Upstream fix
Comment 12 Matt Fleming 2017-01-10 13:00:31 UTC
Could someone try out the attached patch? If you're suffering from this bug and you don't want to compile your own kernel, the attached patch should be part of v4.10-rc4.
Comment 13 Linus Lotz 2017-01-10 13:23:03 UTC
(In reply to Matt Fleming from comment #12)
> Could someone try out the attached patch? If you're suffering from this bug
> and you don't want to compile your own kernel, the attached patch should be
> part of v4.10-rc4.

I tried it (I patched 4.9.1), but it still crashes in efi_memmap_insert
Comment 14 Peter Jones 2017-01-10 14:27:14 UTC
Can you give http://git.kernel.org/cgit/linux/kernel/git/efi/efi.git/commit/?h=next&id=b2a91a35445229d596de6697a0b8b6596b858021 a shot?  This looks like exactly the same bug that solves.
Comment 15 Linus Lotz 2017-01-10 16:40:05 UTC
(In reply to Peter Jones from comment #14)
> Can you give
> http://git.kernel.org/cgit/linux/kernel/git/efi/efi.git/commit/
> ?h=next&id=b2a91a35445229d596de6697a0b8b6596b858021 a shot?  This looks like
> exactly the same bug that solves.

This fixes it for me on 4.9.2 (I applied both suggested patches)
Comment 17 Gene 2017-01-11 04:43:50 UTC
Hopefully this patch makes it into 4.9.3 and 4.10-rc4.
Comment 18 Gene 2017-01-11 04:43:54 UTC
*** Bug 191801 has been marked as a duplicate of this bug. ***
Comment 19 Anton Gubarkov 2017-01-11 09:15:55 UTC
(In reply to Peter Jones from comment #14)
> Can you give
> http://git.kernel.org/cgit/linux/kernel/git/efi/efi.git/commit/
> ?h=next&id=b2a91a35445229d596de6697a0b8b6596b858021 a shot?  This looks like
> exactly the same bug that solves.

Applying both patches to 4.9.0 doesn't solve the problem for me, but applying them to 4.9.2 does.
Comment 20 Matt Fleming 2017-01-16 11:57:01 UTC
The two patches mentioned in this thread are now part of v4.10-rc4 and should be part of v4.9.5 whenever that is released.

I'm marking this as resolved. Thanks everyone.
Comment 21 Evgeny Laktanov 2017-03-21 10:07:00 UTC
Doesn't boot since 4.8.15 on my Thinkpad E545 using UEFI. Considering it happened at the same time with the same line of hardware I don't believe it to be something else. Tried to compile both my distribution kernel and vanilla one up to latest version, no dice. Anyway I can provide meaningful data to solve this?

P.S. There are also reports on gentoo kernel tracker of Thinkpad X220 not booting.
Comment 22 Matt Fleming 2017-05-03 14:36:53 UTC
(In reply to Evgeny Laktanov from comment #21)
> Doesn't boot since 4.8.15 on my Thinkpad E545 using UEFI. Considering it
> happened at the same time with the same line of hardware I don't believe it
> to be something else. Tried to compile both my distribution kernel and
> vanilla one up to latest version, no dice. Anyway I can provide meaningful
> data to solve this?
> 
> P.S. There are also reports on gentoo kernel tracker of Thinkpad X220 not
> booting.

Can you try performing a git bisect to track down exactly which commit causes your thinkpad to stop booting?

Note You need to log in before you can comment on or make changes to this bug.