]> git.baikalelectronics.ru Git - kernel.git/commit
efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot
authorDave Young <dyoung@redhat.com>
Fri, 26 May 2017 11:36:51 +0000 (12:36 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 28 May 2017 09:06:17 +0000 (11:06 +0200)
commit71c0ea3d504a1727626d4d0c8a49d9b36b72ed56
tree40bf8105a7a5313a6cf146592a85b948b21b3658
parent97ed5ee7e6a8db91c166f0051938b6e062ddf0f7
efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot

Sabrina Dubroca reported an early panic:

  BUG: unable to handle kernel paging request at ffffffffff240001
  IP: efi_bgrt_init+0xdc/0x134

  [...]

  ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

... which was introduced by:

  c5315d0c1883 ("efi/x86: Move the EFI BGRT init code to early init code")

The cause is that on this machine the firmware provides the EFI ACPI BGRT
table even on legacy non-EFI bootups - which table should be EFI only.

The garbage BGRT data causes the efi_bgrt_init() panic.

Add a check to skip efi_bgrt_init() in case non-EFI bootup to work around
this firmware bug.

Tested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: <stable@vger.kernel.org> # v4.11+
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Fixes: c5315d0c1883 ("efi/x86: Move the EFI BGRT init code to early init code")
Link: http://lkml.kernel.org/r/20170526113652.21339-6-matt@codeblueprint.co.uk
[ Rewrote the changelog to be more readable. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/efi-bgrt.c