All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi/efivars: Set generic ops before loading SSDT
@ 2020-11-23 17:28 Amadeusz Sławiński
  2020-11-23 22:53 ` Ard Biesheuvel
  2020-11-27 16:49 ` [tip: efi/urgent] " tip-bot2 for Amadeusz Sławiński
  0 siblings, 2 replies; 4+ messages in thread
From: Amadeusz Sławiński @ 2020-11-23 17:28 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-efi; +Cc: Cezary Rojewski, Amadeusz Sławiński

Efivar allows for overriding of SSDT tables, however starting with
commit bf67fad19e493b ("efi: Use more granular check for availability for variable services")
this use case is broken. When loading SSDT generic ops should be set
first, however mentioned commit reversed order of operations. Fix this
by restoring original order of operations.

Fixes: bf67fad19e493b ("efi: Use more granular check for availability for variable services")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 drivers/firmware/efi/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 5e5480a0a32d..6c6eec044a97 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -390,10 +390,10 @@ static int __init efisubsys_init(void)
 
 	if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
 				      EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
-		efivar_ssdt_load();
 		error = generic_ops_register();
 		if (error)
 			goto err_put;
+		efivar_ssdt_load();
 		platform_device_register_simple("efivars", 0, NULL, 0);
 	}
 
-- 
2.25.1


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

* Re: [PATCH] efi/efivars: Set generic ops before loading SSDT
  2020-11-23 17:28 [PATCH] efi/efivars: Set generic ops before loading SSDT Amadeusz Sławiński
@ 2020-11-23 22:53 ` Ard Biesheuvel
  2020-11-25 10:18   ` Rojewski, Cezary
  2020-11-27 16:49 ` [tip: efi/urgent] " tip-bot2 for Amadeusz Sławiński
  1 sibling, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2020-11-23 22:53 UTC (permalink / raw)
  To: Amadeusz Sławiński; +Cc: linux-efi, Cezary Rojewski

On Mon, 23 Nov 2020 at 16:11, Amadeusz Sławiński
<amadeuszx.slawinski@linux.intel.com> wrote:
>
> Efivar allows for overriding of SSDT tables, however starting with
> commit bf67fad19e493b ("efi: Use more granular check for availability for variable services")
> this use case is broken. When loading SSDT generic ops should be set
> first, however mentioned commit reversed order of operations. Fix this
> by restoring original order of operations.
>
> Fixes: bf67fad19e493b ("efi: Use more granular check for availability for variable services")
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> ---
>  drivers/firmware/efi/efi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 5e5480a0a32d..6c6eec044a97 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -390,10 +390,10 @@ static int __init efisubsys_init(void)
>
>         if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
>                                       EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
> -               efivar_ssdt_load();
>                 error = generic_ops_register();
>                 if (error)
>                         goto err_put;
> +               efivar_ssdt_load();
>                 platform_device_register_simple("efivars", 0, NULL, 0);
>         }
>
> --
> 2.25.1
>

Thanks. Queued as a fix.

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

* RE: [PATCH] efi/efivars: Set generic ops before loading SSDT
  2020-11-23 22:53 ` Ard Biesheuvel
@ 2020-11-25 10:18   ` Rojewski, Cezary
  0 siblings, 0 replies; 4+ messages in thread
From: Rojewski, Cezary @ 2020-11-25 10:18 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi, Amadeusz Sławiński

On 2020-11-23 11:53 PM, Ard Biesheuvel wrote:
> On Mon, 23 Nov 2020 at 16:11, Amadeusz Sławiński
> <amadeuszx.slawinski@linux.intel.com> wrote:
>>
>> Efivar allows for overriding of SSDT tables, however starting with
>> commit bf67fad19e493b ("efi: Use more granular check for availability for variable services")
>> this use case is broken. When loading SSDT generic ops should be set
>> first, however mentioned commit reversed order of operations. Fix this
>> by restoring original order of operations.
>>
>> Fixes: bf67fad19e493b ("efi: Use more granular check for availability for variable services")
>> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
>> ---
>>   drivers/firmware/efi/efi.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
>> index 5e5480a0a32d..6c6eec044a97 100644
>> --- a/drivers/firmware/efi/efi.c
>> +++ b/drivers/firmware/efi/efi.c
>> @@ -390,10 +390,10 @@ static int __init efisubsys_init(void)
>>
>>          if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
>>                                        EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
>> -               efivar_ssdt_load();
>>                  error = generic_ops_register();
>>                  if (error)
>>                          goto err_put;
>> +               efivar_ssdt_load();
>>                  platform_device_register_simple("efivars", 0, NULL, 0);
>>          }
>>
> 
> Thanks. Queued as a fix.
> 

Sorry for the late reply. This is a good finding by Amadeo. If in any
case you need more credibility, feel free to apply my:

Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>

Czarek


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

* [tip: efi/urgent] efi/efivars: Set generic ops before loading SSDT
  2020-11-23 17:28 [PATCH] efi/efivars: Set generic ops before loading SSDT Amadeusz Sławiński
  2020-11-23 22:53 ` Ard Biesheuvel
@ 2020-11-27 16:49 ` tip-bot2 for Amadeusz Sławiński
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Amadeusz Sławiński @ 2020-11-27 16:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: amadeuszx.slawinski, Cezary Rojewski, Ard Biesheuvel, x86,
	linux-kernel

The following commit has been merged into the efi/urgent branch of tip:

Commit-ID:     50bdcf047503e30126327d0be4f0ad7337106d68
Gitweb:        https://git.kernel.org/tip/50bdcf047503e30126327d0be4f0ad7337106d68
Author:        Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
AuthorDate:    Mon, 23 Nov 2020 12:28:17 -05:00
Committer:     Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Wed, 25 Nov 2020 16:55:02 +01:00

efi/efivars: Set generic ops before loading SSDT

Efivars allows for overriding of SSDT tables, however starting with
commit

  bf67fad19e493b ("efi: Use more granular check for availability for variable services")

this use case is broken. When loading SSDT generic ops should be set
first, however mentioned commit reversed order of operations. Fix this
by restoring original order of operations.

Fixes: bf67fad19e493b ("efi: Use more granular check for availability for variable services")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20201123172817.124146-1-amadeuszx.slawinski@linux.intel.com
Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 5e5480a..6c6eec0 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -390,10 +390,10 @@ static int __init efisubsys_init(void)
 
 	if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
 				      EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
-		efivar_ssdt_load();
 		error = generic_ops_register();
 		if (error)
 			goto err_put;
+		efivar_ssdt_load();
 		platform_device_register_simple("efivars", 0, NULL, 0);
 	}
 

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

end of thread, other threads:[~2020-11-27 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 17:28 [PATCH] efi/efivars: Set generic ops before loading SSDT Amadeusz Sławiński
2020-11-23 22:53 ` Ard Biesheuvel
2020-11-25 10:18   ` Rojewski, Cezary
2020-11-27 16:49 ` [tip: efi/urgent] " tip-bot2 for Amadeusz Sławiński

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.