Created attachment 256163 [details]
since Linux 11-rc1 to final my PC doesn't boot anymore. I made git bisect and it seems the bellow commit is causing the problem:
efi/x86: Move the EFI BGRT init code to early init code
Before invoking the arch specific handler, efi_mem_reserve() reserves
the given memory region through memblock.
efi_bgrt_init() will call efi_mem_reserve() after mm_init(), at which
time memblock is dead and should not be used anymore.
The EFI BGRT code depends on ACPI initialization to get the BGRT ACPI
table, so move parsing of the BGRT table to ACPI early boot code to
ensure that efi_mem_reserve() in EFI BGRT code still use memblock safely.
any help will be appreciated. Thanks!
Same freeze here.
Here's an earlyprintk=efi output:
Can you print the bgrt table like below and save the kmesg? I would better to have a full kernel log, for the working kernel and failed kernel.
pr_info("%s acpi_table_bgrt.version %hu\n", __func__, bgrt->version);
pr_info("%s acpi_table_bgrt.status %hhu\n", __func__, bgrt->status);
pr_info("%s acpi_table_bgrt.image_type %hhu\n", __func__, bgrt->image_type);
pr_info("%s acpi_table_bgrt.image_address %llx\n", __func__, bgrt->image_address);
print_hex_dump(KERN_INFO, "efi_bgrt_init acpi_table_bgrt", DUMP_PREFIX_OFFSET, 16, 1, bgrt, sizeof(*bgrt), false);
I'm also facing boot issue since 4.11 with bios booting. The computer freezes at `Loading initial ramdisk`. With earlyprintk a panic excerpt can be seen.
By setting the kernel option acpi=off, the kernel boots fine.
Within https://bbs.archlinux.org/viewtopic.php?pid=1714915, we identified the changes commit `7b0a911478c74ca02581d496f732c10e811e894f` as possible cause.
Furthermore by applying the patch from https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=7425826f4f7ac60f2538b06a7f0a5d1006405159, booting 4.11.3 is possible again.
(In reply to Keith Baker from comment #3)
> Furthermore by applying the patch from
> ?id=7425826f4f7ac60f2538b06a7f0a5d1006405159, booting 4.11.3 is possible
Thanks for this investigative work. A pull request containing this fix was sent to Linus today, so hopefully, it'll be merged soon and then applied to the stable trees.
Created attachment 256839 [details]
Created attachment 256841 [details]
Created attachment 256843 [details]
There might be different problems for EFI and BIOS boot.
With Linux 4.11.3 and EFI the boot hangs with the error shown in Screenshot https://bugzilla.kernel.org/attachment.cgi?id=256839. With acpi=off it will boot without any problems.
I have added the pr_info statements to print the bgrt table as advised by Dave Young. The output of this is:
efi_bgrt: efi_bgrt_init acpi_table_bgrt.version 1
efi_bgrt: efi_bgrt_init acpi_table_bgrt.status 0
efi_bgrt: efi_bgrt_init acpi_table_bgrt.image_type 0
efi_bgrt: efi_bgrt_init acpi_table_bgrt.image_address a62b01800000001
efi_bgrt_init acpi_table_bgrt00000000: 42 47 52 54 3c 00 00 00 00 5f 41 4c 41 53 4b 41
efi_bgrt_init acpi_table_bgrt00000010: 41 20 4d 20 49 00 00 00 09 20 07 01 41 4d 49 20
efi_bgrt_init acpi_table_bgrt00000020: 13 00 01 00 01 00 00 00 01 00 00 00 18 b0 62 0a
efi_bgrt_init acpi_table_bgrt00000030: 00 00 00 00 00 00 00 00
The problem might be caused by the memcpy call in line https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/platform/efi/efi-bgrt.c?h=v4.11.2#n71. If I put the pr_info calls after that line, then the bgrt table will not be printed to the kmsg before the oops occurs and the system halts.
If this memcpy line will be commented out, then my system boots fine. Due to the missing/wrong "bmp_header.id" it will then goto out in the next if condition and "Ignoring BGRT: Incorrect BMP magic number..." will be added to the kmsg. Please find the full kmsg for this case here https://bugzilla.kernel.org/attachment.cgi?id=256841
For comparison I have also added the kmsg for the last working kernel 4.10.9 here https://bugzilla.kernel.org/attachment.cgi?id=256843.
(In reply to spinnau from comment #8)
> For comparison I have also added the kmsg for the last working kernel 4.10.9
> here https://bugzilla.kernel.org/attachment.cgi?id=256843.
With the 4.10 kernel on my system BGRT was ignored, as memremap of the bmp image header failed. But despite this message, the system was booting fine.
[ 0.112643] ioremap: invalid physical address a62b01800000001
[ 0.112738] efi_bgrt: Ignoring BGRT: failed to map image header memory
If I change the "early_memremap" of the image header in kernel 4.11 back to the "memremap" call from kernel 4.10, then the old behavior can be restored (memremap fails, BGRT will be ignored) and booting works again. But this clearly isn't the right solution, as it leaves some errors.
The patch for non-EFI boot mentioned in comments #3 and #4 also doesn't help in my case.
On Arch Linux forum https://bbs.archlinux.org/viewtopic.php?id=226520 we have collected ACPI Data Table [BGRT] dumps of affected systems that don't boot with linux-4.11 and also of non-affected systems. For convenience I will attach the ACPI dumps to this bug report.
From comparison it can be seen, that the affected and non-affected systems differ in length of the raw table data.
affected: Raw Table Data: Length 60 (0x3C)
non-affected: Raw Table Data: Length 56 (0x38)
Created attachment 256875 [details]
affected system 1 (EFI boot)
Created attachment 256877 [details]
affected system 2 (EFI boot)
Created attachment 256881 [details]
affected system 3 (EFI boot)
Created attachment 256883 [details]
affected system 4 (EFI boot)
Created attachment 256887 [details]
affected system 5 (EFI boot)
Created attachment 256889 [details]
non-affected system 1 (EFI boot)
Created attachment 256891 [details]
non-affected system 2 (EFI boot)
Posted a patch:
Here is a patch to fix this issue:
Here is a patch to fix this issue:
Many thanks to Dave Young for the patch. I can confirm that the patch https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?id=0a97e704d93fe4facf2bffe3c78095b9d441df42 modified and applied to linux-4.11.3 solves the problem on my system with EFI boot.
Due to the check the invalid image address is detected and the system boots fine with this kmsg as expected:
# dmesg |grep -i bgrt
[ 0.000000] ACPI: BGRT 0x00000000CA0F4C80 00003C (v00 ALASKA A M I 01072009 AMI 00010013)
[ 0.000000] efi_bgrt: Ignoring BGRT: invalid image address
The patch from Dave has been merged by Linus in v4.12-rc5 and it has also been applied to the v4.11 stable tree.
Closing, thanks everyone!