mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Rob Bradford <robert.bradford@intel.com>
Cc: x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Rik van Riel <riel@surriel.com>, Juergen Gross <jgross@suse.com>,
	Jian-Hong Pan <jian-hong@endlessm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] x86/reboot: Avoid EFI reboot when not running on EFI
Date: Thu, 29 Aug 2019 14:18:19 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908291416560.1938@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190829101119.7345-1-robert.bradford@intel.com>

On Thu, 29 Aug 2019, Rob Bradford wrote:

CC+ Ard

> Replace the check using efi_runtime_disabled() which only checks if EFI
> runtime was disabled on the kernel command line with a call to
> efi_enabled(EFI_RUNTIME_SERVICES) to check if EFI runtime services are
> available.
> 
> In the situation where the kernel was booted without an EFI environment
> then only efi_enabled(EFI_RUNTIME_SERVICES) correctly represents that no
> EFI is available. Setting "noefi" or "efi=noruntime" on the commandline
> continue to have the same effect as efi_enabled(EFI_RUNTIME_SERVICES)
> will return false.
>
>
> Signed-off-by: Rob Bradford <robert.bradford@intel.com>
> ---
>  arch/x86/kernel/reboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index 09d6bded3c1e..0b0a7fccdb00 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -500,7 +500,7 @@ static int __init reboot_init(void)
>  	 */
>  	rv = dmi_check_system(reboot_dmi_table);
>  
> -	if (!rv && efi_reboot_required() && !efi_runtime_disabled())
> +	if (!rv && efi_reboot_required() && efi_enabled(EFI_RUNTIME_SERVICES))

Why is efi_reboot_required() set at all in that situation?

Thanks,

	tglx



  reply	other threads:[~2019-08-29 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 10:11 Rob Bradford
2019-08-29 12:18 ` Thomas Gleixner [this message]
2019-08-29 14:34   ` Bradford, Robert
2019-09-12 12:40     ` Bradford, Robert
2019-09-13 18:54     ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1908291416560.1938@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jian-hong@endlessm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=riel@surriel.com \
    --cc=robert.bradford@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®