Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753402AbdGXMXT (ORCPT ); Mon, 24 Jul 2017 08:23:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbdGXMXK (ORCPT ); Mon, 24 Jul 2017 08:23:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4E94A61BB0 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kpanic.de Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=sassmann@kpanic.de DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4E94A61BB0 From: Stefan Assmann To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, sassmann@kpanic.de Subject: [PATCH] x86/efi: fix reboot_mode when EFI runtime services are disabled Date: Mon, 24 Jul 2017 14:22:48 +0200 Message-Id: <20170724122248.24006-1-sassmann@kpanic.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 24 Jul 2017 12:23:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 32 When EFI runtime services are disabled, for example by the "noefi" kernel cmdline parameter, the reboot_type could still be set to BOOT_EFI causing reboot to fail. Fix this by checking if EFI runtime services are disabled. Signed-off-by: Stefan Assmann --- arch/x86/kernel/reboot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 2544700a2a87..23f00770ef45 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -469,12 +469,12 @@ static int __init reboot_init(void) /* * The DMI quirks table takes precedence. If no quirks entry - * matches and the ACPI Hardware Reduced bit is set, force EFI - * reboot. + * matches and the ACPI Hardware Reduced bit is set and EFI + * runtime services have not been disabled, force EFI reboot. */ rv = dmi_check_system(reboot_dmi_table); - if (!rv && efi_reboot_required()) + if (!rv && efi_reboot_required() && !efi_runtime_disabled()) reboot_type = BOOT_EFI; return 0; -- 2.13.3