From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751138AbdE1JwM (ORCPT ); Sun, 28 May 2017 05:52:12 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59623 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdE1JwL (ORCPT ); Sun, 28 May 2017 05:52:11 -0400 Date: Sun, 28 May 2017 02:46:35 -0700 From: tip-bot for Dave Young Message-ID: Cc: hpa@zytor.com, ard.biesheuvel@linaro.org, peterz@infradead.org, tglx@linutronix.de, dyoung@redhat.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, mingo@kernel.org, sd@queasysnail.net, matt@codeblueprint.co.uk Reply-To: tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com, ard.biesheuvel@linaro.org, sd@queasysnail.net, mingo@kernel.org, matt@codeblueprint.co.uk, torvalds@linux-foundation.org, dyoung@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <20170526113652.21339-6-matt@codeblueprint.co.uk> References: <20170526113652.21339-6-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/urgent] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot Git-Commit-ID: 7425826f4f7ac60f2538b06a7f0a5d1006405159 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7425826f4f7ac60f2538b06a7f0a5d1006405159 Gitweb: http://git.kernel.org/tip/7425826f4f7ac60f2538b06a7f0a5d1006405159 Author: Dave Young AuthorDate: Fri, 26 May 2017 12:36:51 +0100 Committer: Ingo Molnar CommitDate: Sun, 28 May 2017 11:06:17 +0200 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: 7b0a911478c7 ("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 Signed-off-by: Dave Young Signed-off-by: Ard Biesheuvel Signed-off-by: Matt Fleming Cc: # v4.11+ Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Fixes: 7b0a911478c7 ("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 --- drivers/firmware/efi/efi-bgrt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c index 04ca876..8bf2732 100644 --- a/drivers/firmware/efi/efi-bgrt.c +++ b/drivers/firmware/efi/efi-bgrt.c @@ -36,6 +36,9 @@ void __init efi_bgrt_init(struct acpi_table_header *table) if (acpi_disabled) return; + if (!efi_enabled(EFI_BOOT)) + return; + if (table->length < sizeof(bgrt_tab)) { pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n", table->length, sizeof(bgrt_tab));