5.6-### doesn't boot
Hi,
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
Thanks, Jörg
Quoted 7 lines · Jörg Otte
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updates
but not having any messages at all makes it hard to guess where it would be.
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Linus
Quoted 25 lines · Linus Torvalds
Quoted 7 lines · Jörg Otte
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updates
Quoted 6 lines
but not having any messages at all makes it hard to guess where it would be.
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
It would also be nice to know: are you EFI-booting or BIOS-booting? And are you using EFI mixed mode? (That is, are you booting a 64-bit kernel using 32-bit EFI?)
Quoted 12 lines · Linus Torvalds
Quoted 7 lines · Jörg Otte
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updates
If I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in /boot/grub/grub.cfg and adding this to the boot options might improve the debug output:
earlyprintk=vga initcall_debug ignore_loglevel debug panic_on_warn
So for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga initcall_debug ignore_loglevel debug panic_on_warn $vt_handoff
If this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Also, a warning: if the normal boot log contains spurious warnings then the new 'panic_on_warn' option will cause additional trouble on good kernels.
Thanks,
Ingo
Am Fr., 31. Jan. 2020 um 07:43 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 57 lines · Linus Torvalds
Quoted 13 lines · Jörg Otte
Quoted 7 lines
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updatesIf I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in
/boot/grub/grub.cfgand adding this to the boot options might improve the debug output:earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warnSo for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warn$vt_handoffIf this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
Quoted 8 lines
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Also, a warning: if the normal boot log contains spurious warnings then the new '
panic_on_warn' option will cause additional trouble on good kernels.
It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmaps
Unfortunately I can not revert because of compile errors!
In file included from /media/jojo/deftoshiba/kernel/linux/init/main.c:48:
/media/jojo/deftoshiba/kernel/linux/include/linux/efi.h:975:1: error:
version control conflict marker in file
<<<<<<< HEAD
^~~~~~~ /media/jojo/deftoshiba/kernel/linux/include/linux/efi.h:980:1: error:
version control conflict marker in file
=======
^~~~~~~ /media/jojo/deftoshiba/kernel/linux/include/linux/efi.h:982:1: error:
version control conflict marker in file
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
parent of
1db91035d01a... efi: Add tracking for dynamically allocated memmaps
....
EFI boot crash regression (was: Re: 5.6-### doesn't boot)
(Cc:ed Dan and Ard)
Quoted 63 lines · Jörg Otte
Am Fr., 31. Jan. 2020 um 07:43 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 62 lines · Linus Torvalds
Quoted 13 lines · Jörg Otte
Quoted 7 lines
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updatesIf I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in
/boot/grub/grub.cfgand adding this to the boot options might improve the debug output:earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warnSo for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warn$vt_handoffIf this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Quoted 8 lines
Quoted 3 lines
Also, a warning: if the normal boot log contains spurious warnings then the new '
panic_on_warn' option will cause additional trouble on good kernels.It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmaps
Thanks a ton, that's very useful!
I've Cc:-ed the EFI gents who are developing this code, maybe they'll spot the bug.
Thanks,
Ingo
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 78 lines · Ingo Molnar
(Cc:ed Dan and Ard)
Quoted 63 lines · Jörg Otte
Am Fr., 31. Jan. 2020 um 07:43 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 62 lines · Linus Torvalds
Quoted 13 lines · Jörg Otte
Quoted 7 lines
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updatesIf I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in
/boot/grub/grub.cfgand adding this to the boot options might improve the debug output:earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warnSo for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warn$vt_handoffIf this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Quoted 8 lines
Quoted 3 lines
Also, a warning: if the normal boot log contains spurious warnings then the new '
panic_on_warn' option will cause additional trouble on good kernels.It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmaps
Quoted 4 lines
Thanks a ton, that's very useful!
I've Cc:-ed the EFI gents who are developing this code, maybe they'll spot the bug.
I'll take a look. Jörg, can you paste a full dmesg from a good boot?
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Am Fr., 31. Jan. 2020 um 19:48 Uhr schrieb Dan Williams <[email protected]>:
Quoted 80 lines · Ingo Molnar
Quoted 78 lines
(Cc:ed Dan and Ard)
Quoted 71 lines · Jörg Otte
Am Fr., 31. Jan. 2020 um 07:43 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 57 lines · Linus Torvalds
Quoted 13 lines · Jörg Otte
Quoted 7 lines
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updatesIf I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in
/boot/grub/grub.cfgand adding this to the boot options might improve the debug output:earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warnSo for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warn$vt_handoffIf this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
Quoted 8 lines
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Also, a warning: if the normal boot log contains spurious warnings then the new '
panic_on_warn' option will cause additional trouble on good kernels.It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmaps
Quoted 6 lines
Quoted 4 lines
Thanks a ton, that's very useful!
I've Cc:-ed the EFI gents who are developing this code, maybe they'll spot the bug.
I'll take a look. Jörg, can you paste a full dmesg from a good boot?
Here it is.
Thanks, Jörg
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 83 lines · Jörg Otte
Am Fr., 31. Jan. 2020 um 19:48 Uhr schrieb Dan Williams <[email protected]>:
Quoted 80 lines · Ingo Molnar
Quoted 78 lines
(Cc:ed Dan and Ard)
Quoted 71 lines · Jörg Otte
Am Fr., 31. Jan. 2020 um 07:43 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 57 lines · Linus Torvalds
Quoted 13 lines · Jörg Otte
Quoted 7 lines
my notebook doesn't boot with current kernel. Booting stops right after displaying "loading initial ramdisk..". No further displays. Also nothing is wriiten to the logs.
last known good kernel is : vmlinuz-5.5.0-00849-gb0be0eff1a5a first known bad kernel is : vmlinuz-5.5.0-01154-gc677124e631d
It would be lovely if you can bisect a bit. But my merges in that range are all from Ingo:
Quoted 8 lines
Ingo Molnar (7):
header cleanup
objtool updates
RCU updates
EFI updates
locking updates
perf updates
scheduler updatesIf I had to guess then perhaps the EFI changes look the most dangerous ones from these trees - but in principle most of these trees could contain a boot crasher/hang bug.
Quoted 2 lines
but not having any messages at all makes it hard to guess where it would be.
To improve debug output:
Removing any 'fbcon' options in
/boot/grub/grub.cfgand adding this to the boot options might improve the debug output:earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warnSo for example if the relevant kernel boot entry in grub.cfg looks like this:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro splash $vt_handoff
Then editing it to the following could in principle produce (much) more verbose boot output:
linux /vmlinuz-5.3.0-26-generic root=UUID=1bcxabe3-0b62-4x04-b456-47cd90c0e6x4 ro earlyprintk=vga
initcall_debugignore_logleveldebugpanic_on_warn$vt_handoffIf this produces more output than just "loading initial ramdisk..' then a photo of the hung screen would be sufficient, no need to transcribe it.
Quoted 2 lines
A few bisect runs would narrow it down a fair amount. Bisecting all the way would be even better, of course,
Agreed!
Quoted 8 lines
If compiling full kernels for bisections takes too long (for example because the .config is from a distro kernel) then running "make localmodconfig" to create a config tailored to the currently active modules will cut down significantly on build time.
Also, a warning: if the normal boot log contains spurious warnings then the new '
panic_on_warn' option will cause additional trouble on good kernels.It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmaps
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Thanks a ton, that's very useful!
I've Cc:-ed the EFI gents who are developing this code, maybe they'll spot the bug.
I'll take a look. Jörg, can you paste a full dmesg from a good boot?
Here it is.
Hello Jörg,
Could you please try whether the change below fixes the issue?
arch/x86/platform/efi/efi.c +0 -1
@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map -
n_removal),
+ .size = efi.memmap.desc_size *
(efi.memmap.nr_map - n_removal),
.flags = 0,
};Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 9 lines · Ard Biesheuvel
Hello Jörg,
Could you please try whether the change below fixes the issue?
arch/x86/platform/efi/efi.c +0
-0
arch/x86/platform/efi/efi.c static void __init efi_clean_memmap(void) · line 312
Quoted 6 lines
arch/x86/platform/efi/efi.c +1
-1@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), .flags = 0,
Oh, I actually noticed this one, but convinced myself that it's correct, because GCC didn't warn about uninitialized data.
But maybe in this weird case data.desc_size as used within its own initializer is zero?
Thanks,
Ingo
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 23 lines · Ingo Molnar
Quoted 9 lines · Ard Biesheuvel
Hello Jörg,
Could you please try whether the change below fixes the issue?
arch/x86/platform/efi/efi.c +0
-0arch/x86/platform/efi/efi.c static void __init efi_clean_memmap(void) · line 312
Quoted 6 lines
arch/x86/platform/efi/efi.c +1
-1@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), .flags = 0,Oh, I actually noticed this one, but convinced myself that it's correct, because GCC didn't warn about uninitialized data.
Quoted 3 lines
But maybe in this weird case data.desc_size as used within its own initializer is zero?
Something like that, yes. Note that size and desc_size appear in opposite order in the struct definition, and this may also affect how the compiler handles this.
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
In reply to Ingo MolnarAm So., 2. Feb. 2020 um 10:22 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 23 lines · Ard Biesheuvel
Quoted 10 lines
Hello Jörg,
Could you please try whether the change below fixes the issue?
arch/x86/platform/efi/efi.c +0
-0arch/x86/platform/efi/efi.c static void __init efi_clean_memmap(void) · line 312
Quoted 6 lines
arch/x86/platform/efi/efi.c +1
-1@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), .flags = 0,Oh, I actually noticed this one, but convinced myself that it's correct, because GCC didn't warn about uninitialized data.
Quoted 3 lines
But maybe in this weird case data.desc_size as used within its own initializer is zero?
Patch makes my kernel booting again :)
Thanks, Jörg
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 24 lines · Jörg Otte
Am So., 2. Feb. 2020 um 10:22 Uhr schrieb Ingo Molnar <[email protected]>:
Quoted 23 lines · Ard Biesheuvel
Quoted 10 lines
Hello Jörg,
Could you please try whether the change below fixes the issue?
arch/x86/platform/efi/efi.c +0
-0arch/x86/platform/efi/efi.c static void __init efi_clean_memmap(void) · line 312
Quoted 6 lines
arch/x86/platform/efi/efi.c +1
-1@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) .phys_map = efi.memmap.phys_map, .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), + .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal), .flags = 0,Oh, I actually noticed this one, but convinced myself that it's correct, because GCC didn't warn about uninitialized data.
Quoted 4 lines
Quoted 2 lines
But maybe in this weird case data.desc_size as used within its own initializer is zero?
Patch makes my kernel booting again :)
Thank you! I'll send the fix to Linus later today.
Ingo
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
In reply to Jörg OtteOn Sat, Feb 1, 2020 at 7:35 AM Jörg Otte <[email protected]> wrote:
[..]
Quoted 3 lines
Quoted 1 line
I'll take a look. Jörg, can you paste a full dmesg from a good boot?
Here it is.
Much appreciated, I found an old Haswell laptop and am able to reproduce the boot hang.
RFC PATCH 1/1 Revert the EFI leak fixes for now (was: Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot))
In reply to Ingo MolnarQuoted 11 lines · Jörg Otte
It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmapsUnfortunately I can not revert because of compile errors!
In file included from /media/jojo/deftoshiba/kernel/linux/init/main.c:48:
/media/jojo/deftoshiba/kernel/linux/include/linux/efi.h:975:1: error:
version control conflict marker in file
<<<<<<< HEAD
So 1db91035d0 doesn't revert cleanly, because 484a418d0754 depends on it, plus there a third commit (f0ef6523475f) that has a semantic dependency on 1db91035d01a.
But you can revert them all, if done in reverse chronological order:
git revert f0ef6523475f # ("efi: Fix efi_memmap_alloc() leaks")
git revert 484a418d0754 # ("efi: Fix handling of multiple efi_fake_mem= entries") git revert 1db91035d01a # ("efi: Add tracking for dynamically allocated memmaps")
You can paste those three lines into a shell as-is, or you can apply the patch below which is a combination of these three reverts.
Jörg, can you confirm that doing these reverts fixes booting on your system? If it does then a full dmesg from that kernel would be useful.
FWIW I reviewed the bisected commit and didn't find the bug but I also couldn't convince myself it's a 1:1 identity transformation and cleanup of the existing logic.
The size arithmethics transformation looks correct at first sight, but the data->flags handling in particular looks rather interwoven.
Thanks,
Ingo
============================>
arch/x86/platform/efi/efi.c | 10 ++---- arch/x86/platform/efi/quirks.c | 23 +++++++------ drivers/firmware/efi/fake_mem.c | 43 ++++++++++++------------ drivers/firmware/efi/memmap.c | 72 ++++++++++++----------------------------- include/linux/efi.h | 13 +++----- 5 files changed, 63 insertions(+), 98 deletions(-)
arch/x86/platform/efi/efi.c +2 -8
@@ -304,16 +304,10 @@ static void __init efi_clean_memmap(void) }if (n_removal >0 ) { -struct efi_memory_map_data data = { - .phys_map = efi.memmap.phys_map, - .desc_version = efi.memmap.desc_version, - .desc_size = efi.memmap.desc_size, - .size = data.desc_size * (efi.memmap.nr_map - n_removal), - .flags =0 , - }; +u64 size = efi.memmap.nr_map - n_removal;pr_warn ("Removing %d invalid memory map entries.\n" , n_removal); -efi_memmap_install (&data); +efi_memmap_install (efi.memmap.phys_map, size); } }
arch/x86/platform/efi/quirks.c +14 -9
@@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(efi_query_variable_store);*/ void __init efi_arch_mem_reserve (phys_addr_t addr,u64 size) { -struct efi_memory_map_data data = {0 }; +phys_addr_t new_phys, new_size;struct efi_mem_range mr;efi_memory_desc_t md;int num_entries;
@@ -272,21 +272,24 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size) num_entries =efi_memmap_split_count (&md, &mr.range); num_entries += efi.memmap.nr_map; -if (efi_memmap_alloc (num_entries, &data) !=0 ) { + new_size = efi.memmap.desc_size * num_entries; + + new_phys =efi_memmap_alloc (num_entries); +if (!new_phys) {pr_err ("Could not allocate boot services memmap\n" );return ; } - new =early_memremap (data.phys_map, data.size); + new =early_memremap (new_phys, new_size);if (!new) {pr_err ("Failed to map new boot services memmap\n" );return ; }efi_memmap_insert (&efi.memmap, new, &mr); -early_memunmap (new, data.size); +early_memunmap (new, new_size); -efi_memmap_install (&data); +efi_memmap_install (new_phys, num_entries);e820__range_update (addr, size,E820_TYPE_RAM ,E820_TYPE_RESERVED );e820__update_table (e820_table); }
@@ -405,7 +408,7 @@ static void __init efi_unmap_pages(efi_memory_desc_t *md)void __init efi_free_boot_services (void ) { -struct efi_memory_map_data data = {0 }; +phys_addr_t new_phys, new_size;efi_memory_desc_t *md;int num_entries =0 ;void *new, *new_md;
@@ -460,12 +463,14 @@ void __init efi_free_boot_services(void)if (!num_entries)return ; -if (efi_memmap_alloc (num_entries, &data) !=0 ) { + new_size = efi.memmap.desc_size * num_entries; + new_phys =efi_memmap_alloc (num_entries); +if (!new_phys) {pr_err ("Failed to allocate new EFI memmap\n" );return ; } - new =memremap (data.phys_map, data.size,MEMREMAP_WB ); + new =memremap (new_phys, new_size,MEMREMAP_WB );if (!new) {pr_err ("Failed to map new EFI memmap\n" );return ;
@@ -489,7 +494,7 @@ void __init efi_free_boot_services(void)memunmap (new); -if (efi_memmap_install (&data) !=0 ) { +if (efi_memmap_install (new_phys, num_entries)) {pr_err ("Could not install new EFI memmap\n" );return ; }
drivers/firmware/efi/fake_mem.c +22 -21
67 lines not on this page · raw message
drivers/firmware/efi/memmap.c +21 -51
116 lines not on this page · raw message
include/linux/efi.h +4 -9
@@ -759,8 +759,8 @@ typedef union {/* * Architecture independent structure for describing a memory map for the -* benefit of efi_memmap_init_early(), and for passing context between -* efi_memmap_alloc() and efi_memmap_install(). +* benefit of efi_memmap_init_early(), saving us the need to pass four +* parameters. */ struct efi_memory_map_data {phys_addr_t phys_map;
@@ -778,8 +778,6 @@ struct efi_memory_map {unsigned long desc_version;unsigned long desc_size;#define EFI_MEMMAP_LATE (1UL << 0) -#define EFI_MEMMAP_MEMBLOCK (1UL << 1) -#define EFI_MEMMAP_SLAB (1UL << 2)unsigned long flags; };
@@ -974,14 +972,11 @@ static inline efi_status_t efi_query_variable_store(u32 attributes,#endif extern void __iomem *efi_lookup_mapped_addr (u64 phys_addr); -extern int __init efi_memmap_alloc (unsigned int num_entries, -struct efi_memory_map_data *data); -extern void __efi_memmap_free (u64 phys,unsigned long size, -unsigned long flags); +extern phys_addr_t __init efi_memmap_alloc (unsigned int num_entries);extern int __init efi_memmap_init_early (struct efi_memory_map_data *data);extern int __init efi_memmap_init_late (phys_addr_t addr,unsigned long size);extern void __init efi_memmap_unmap (void ); -extern int __init efi_memmap_install (struct efi_memory_map_data *data); +extern int __init efi_memmap_install (phys_addr_t addr,unsigned int nr_map);extern int __init efi_memmap_split_count (efi_memory_desc_t *md,struct range *range); extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap,
Re: [TEST PATCH RFC] Revert the EFI leak fixes for now (was: Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot))
Quoted 33 lines · Ingo Molnar
Quoted 11 lines · Jörg Otte
It's bisected.
The first bad commit is :1db91035d01aa8bfa2350c00ccb63d629b4041ad
efi: Add tracking for dynamically allocated memmapsUnfortunately I can not revert because of compile errors!
In file included from /media/jojo/deftoshiba/kernel/linux/init/main.c:48:
/media/jojo/deftoshiba/kernel/linux/include/linux/efi.h:975:1: error:
version control conflict marker in file
<<<<<<< HEADSo
1db91035d0doesn't revert cleanly, because484a418d0754depends on it, plus there a third commit (f0ef6523475f) that has a semantic dependency on1db91035d01a.But you can revert them all, if done in reverse chronological order:
git revert
f0ef6523475f# ("efi: Fixefi_memmap_alloc()leaks")
git revert484a418d0754# ("efi: Fix handling of multiple efi_fake_mem= entries") git revert1db91035d01a# ("efi: Add tracking for dynamically allocated memmaps")You can paste those three lines into a shell as-is, or you can apply the patch below which is a combination of these three reverts.
Jörg, can you confirm that doing these reverts fixes booting on your system? If it does then a full dmesg from that kernel would be useful.
Quoted 6 lines
FWIW I reviewed the bisected commit and didn't find the bug but I also couldn't convince myself it's a 1:1 identity transformation and cleanup of the existing logic.
The size arithmethics transformation looks correct at first sight, but the
data->flagshandling in particular looks rather interwoven.
Agreed, but the only flags change that I couldn't convince myself was correct is this:
arch/x86/platform/efi/efi.c +0 -0
@@ -309,7 +309,7 @@ static void __init efi_clean_memmap(void) .desc_version = efi.memmap.desc_version, .desc_size = efi.memmap.desc_size, .size = data.desc_size * (efi.memmap.nr_map -
n_removal),
- .flags = 0,
+ .flags = efi.memmap.flags & EFI_MEMMAP_LATE,
};
pr_warn("Removing %d invalid memory map entries.\n", n_removal);...but efi_clean_memmap() should "early".
A message that is not in the archive (sent off-list or not yet received): CAKv+Gu-oPrM7oh-oTbpQsUmXcYvp9KxjXFb3DUGk__qu59rdBQ@mail.gmail.com
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 2 lines · Ard Biesheuvel
earlycon=efifb may help to get better diagnostics, but you will need to use a camera to capture the output
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 7 lines · Dan Williams
Quoted 2 lines · Ard Biesheuvel
earlycon=efifb may help to get better diagnostics, but you will need to use a camera to capture the output
Yeah, so it definitely has to do with the n_removal > 0 path.
Did you try the change I suggested to Joerg?
Dan Williams
Tested-byRe: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 6 lines · Ard Biesheuvel
Quoted 4 lines · Dan Williams
Quoted 1 line · Ard Biesheuvel
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
earlycon=efifb may help to get better diagnostics, but you will need to use a camera to capture the output
Yeah, so it definitely has to do with the
n_removal> 0 path.Did you try the change I suggested to Joerg?
Nice, it worked.
Re: EFI boot crash regression (was: Re: 5.6-### doesn't boot)
Quoted 12 lines · Dan Williams
Quoted 10 lines · Ard Biesheuvel
Quoted 7 lines · Dan Williams
Quoted 2 lines · Ard Biesheuvel
earlycon=efifb may help to get better diagnostics, but you will need to use a camera to capture the output
Quoted 7 lines
Quoted 3 lines
Yeah, so it definitely has to do with the
n_removal> 0 path.Did you try the change I suggested to Joerg?
Nice, it worked.
Tested-by Dan Williams <[email protected]>
Thanks for confirming. I'll spin a proper patch.