Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Scott Talbert <swt@techie.net>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-efi@vger.kernel.org
Subject: Re: [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
Date: Thu, 12 Sep 2019 15:35:07 -0400 (EDT)
Message-ID: <alpine.DEB.2.21.1909121533270.30174@bear.techie.net> (raw)
In-Reply-To: <20190911233239.5916-1-ard.biesheuvel@linaro.org>

On Thu, 12 Sep 2019, Ard Biesheuvel wrote:

> The kernel command line option efivar_ssdt= allows a EFI variable name
> to be specified which contains an ACPI SSDT table that will be loaded
> into memory by the OS.
>
> Currently, that code will always iterate over the EFI variables and
> compare each name with the provided name, even if the command line
> option wasn't set to begin with.
>
> So bail early when no variable name was provided.
>
> Cc: Scott Talbert <swt@techie.net>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> drivers/firmware/efi/efi.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index ad3b1f4866b3..8f020827cdd3 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -282,6 +282,9 @@ static __init int efivar_ssdt_load(void)
> 	void *data;
> 	int ret;
>
> +	if (!efivar_ssdt[0])
> +		return 0;
> +
> 	ret = efivar_init(efivar_ssdt_iter, &entries, true, &entries);
>
> 	list_for_each_entry_safe(entry, aux, &entries, list) {

Thanks for the quick fix!

I can confirm this fixes booting on my Mac Pro 2012 system when applied to 
5.3-rc7.

Whenever this makes it in, if it could be targeted for the stable kernels 
as well, that would be appreciated.

Thanks,
Scott

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 23:32 Ard Biesheuvel
2019-09-12 19:35 ` Scott Talbert [this message]
2019-09-12 20:42   ` Ard Biesheuvel

Reply instructions:

You may reply publically 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.1909121533270.30174@bear.techie.net \
    --to=swt@techie.net \
    --cc=ard.biesheuvel@linaro.org \
    --cc=linux-efi@vger.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

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org linux-efi@archiver.kernel.org
	public-inbox-index linux-efi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox