linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
@ 2019-09-11 23:32 Ard Biesheuvel
  2019-09-12 19:35 ` Scott Talbert
  0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2019-09-11 23:32 UTC (permalink / raw)
  To: linux-efi; +Cc: Ard Biesheuvel, Scott Talbert

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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
  2019-09-11 23:32 [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified Ard Biesheuvel
@ 2019-09-12 19:35 ` Scott Talbert
  2019-09-12 20:42   ` Ard Biesheuvel
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Talbert @ 2019-09-12 19:35 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
  2019-09-12 19:35 ` Scott Talbert
@ 2019-09-12 20:42   ` Ard Biesheuvel
  2019-09-19 18:01     ` Scott Talbert
  0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2019-09-12 20:42 UTC (permalink / raw)
  To: Scott Talbert; +Cc: linux-efi

On Thu, 12 Sep 2019 at 20:35, Scott Talbert <swt@techie.net> wrote:
>
> 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.
>

I'll send it out as a fix with a cc to -stable.

Thanks,
Ard.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
  2019-09-12 20:42   ` Ard Biesheuvel
@ 2019-09-19 18:01     ` Scott Talbert
  2019-09-25 15:57       ` Ard Biesheuvel
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Talbert @ 2019-09-19 18:01 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi

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.
>>
>
> I'll send it out as a fix with a cc to -stable.

Hi - just a quick reminder on this as I don't see it in Linus' tree yet. 
Not that I need it urgently, but just want to make sure it isn't 
forgotten.

Thanks,
Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified
  2019-09-19 18:01     ` Scott Talbert
@ 2019-09-25 15:57       ` Ard Biesheuvel
  0 siblings, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2019-09-25 15:57 UTC (permalink / raw)
  To: Scott Talbert; +Cc: linux-efi

On Thu, 19 Sep 2019 at 20:01, Scott Talbert <swt@techie.net> wrote:
>
> 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.
> >>
> >
> > I'll send it out as a fix with a cc to -stable.
>
> Hi - just a quick reminder on this as I don't see it in Linus' tree yet.
> Not that I need it urgently, but just want to make sure it isn't
> forgotten.
>

Hi Scott,

This should get sent out in the next couple of day. It usually takes
another week or so after that for changes to make it into Linus's
tree.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-25 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 23:32 [PATCH] efi: don't iterate over EFI vars pointlessly if no SSDT override was specified Ard Biesheuvel
2019-09-12 19:35 ` Scott Talbert
2019-09-12 20:42   ` Ard Biesheuvel
2019-09-19 18:01     ` Scott Talbert
2019-09-25 15:57       ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).