efi: Make EFI_VARS_PSTORE depend on EFIVAR_FS
PATCH 1/1 efi: Make EFI_VARS_PSTORE depend on EFIVAR_FS
The efivars backend to pstore will not register if the efivarfs is not available. The efivars sysfs interface was removed in Linux 6.0, meaning efivarfs is now the only way pstore can write into EFI variables. Making the dependency on the efivarfs explicit removes a stumbling block when configuring a kernel with pstore.
--- drivers/firmware/efi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/Kconfig +1 -1
@@ -9,7 +9,7 @@ config EFI_ESRT config EFI_VARS_PSTORE tristate "Register efivars backend for pstore" - depends on PSTORE + depends on PSTORE && EFIVAR_FS select UCS2_STRING default y help
Signature · 1 line
2.47.3
Quoted 11 lines · Theodore Tucker
The efivars backend to pstore will not register if the efivarfs is not available. The efivars sysfs interface was removed in Linux 6.0, meaning efivarfs is now the only way pstore can write into EFI variables. Making the dependency on the efivarfs explicit removes a stumbling block when configuring a kernel with pstore.
Signed-off-by Theodore Tucker <[email protected]>--- drivers/firmware/efi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Quoted 15 lines
drivers/firmware/efi/Kconfig +1
-1@@ -9,7 +9,7 @@ config EFI_ESRT config EFI_VARS_PSTORE tristate "Register efivars backend for pstore" - depends on PSTORE + depends on PSTORE && EFIVAR_FS select UCS2_STRING default y helpSignature · 1 line
2.47.3
Ard Biesheuvel
maintainerQuoted 7 lines · Ard Biesheuvel
Quoted 6 lines · Theodore Tucker
The efivars backend to pstore will not register if the efivarfs is not available. The efivars sysfs interface was removed in Linux 6.0, meaning efivarfs is now the only way pstore can write into EFI variables. Making the dependency on the efivarfs explicit removes a stumbling block when configuring a kernel with pstore.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Theodore Tucker <[email protected]>--- drivers/firmware/efi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Applied, thanks.
Actually, EFI pstore does not depend on efivarfs, it only depends on the efivars layer.
Why do you think it needs to depend on EFIVAR_FS?
Quoted 15 lines
Quoted 15 lines
drivers/firmware/efi/Kconfig +1
-1@@ -9,7 +9,7 @@ config EFI_ESRT config EFI_VARS_PSTORE tristate "Register efivars backend for pstore" - depends on PSTORE + depends on PSTORE && EFIVAR_FS select UCS2_STRING default y helpSignature · 1 line
2.47.3
Hi,
Quoted 5 lines · Ard Biesheuvel
Actually, EFI pstore does not depend on efivarfs, it only depends on the efivars layer.
Why do you think it needs to depend on
EFIVAR_FS?
When building a 7.0 kernel for x86 with make alldefconfig and then enabling CONFIG_EFI, CONFIG_PSTORE, and CONFIG_EFI_VARS_PSTORE, I found that the EFI pstore backend failed to register (/sys/module/pstore/parameters/backend was empty after boot) unless CONFIG_EFIVAR_FS had also been enabled explicitly.
I can see now that EFI pstore code should not need the efivarfs, and neither should userspace, since it gets access to any logs through /sys/fs/pstore. So I do appreciate that my patch may not be the right fix here, and I proposed it not as an expert on the internals of EFI pstore, but from experimentation as a user. Sorry for the noise.
I eventually ended up using the ramoops pstore backend so unfortunately no longer have the exact kernel configurations I used when this tripped me up.
Thanks and kind regards,
Theodore
Signature · 2 lines
Theodore Tucker [email protected]
Ard Biesheuvel
maintainerQuoted 15 lines · Theodore Tucker
Hi,
Quoted 5 lines · Ard Biesheuvel
Actually, EFI pstore does not depend on efivarfs, it only depends on the efivars layer.
Why do you think it needs to depend on
EFIVAR_FS?When building a 7.0 kernel for x86 with
make alldefconfigand then enablingCONFIG_EFI,CONFIG_PSTORE, andCONFIG_EFI_VARS_PSTORE, I found that the EFI pstore backend failed to register (/sys/module/pstore/parameters/backendwas empty after boot) unlessCONFIG_EFIVAR_FShad also been enabled explicitly.
Quoted 6 lines
I can see now that EFI pstore code should not need the efivarfs, and neither should userspace, since it gets access to any logs through
/sys/fs/pstore. So I do appreciate that my patch may not be the right fix here, and I proposed it not as an expert on the internals of EFI pstore, but from experimentation as a user. Sorry for the noise.
No worries.
Quoted 6 lines
I eventually ended up using the ramoops pstore backend so unfortunately no longer have the exact kernel configurations I used when this tripped me up.
Thanks and kind regards,
Thanks for the context. I've dropped your patch from the queue.
It would be nice to understand what exactly went wrong in your case, but I agree it is probably not worth your time (or mine) to try and reproduce the exact conditions under which it occurred.
Signature · 1 line
Ard.