Skip to contentSkip to conversation

efi: Make EFI_VARS_PSTORE depend on EFIVAR_FS

PATCH Applied Theodore Tucker 2 participants 5 messages Jun 25 – Aug 21 EFI

lore
Share & tools
lore
#0 lore raw

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
index 29e0729299f5..8dfd21e7a8e4 100644
@@ -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
maintainer Applied
#1 lore raw
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.

---
 drivers/firmware/efi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Quoted 15 lines
drivers/firmware/efi/Kconfig +1 -1
index 29e0729299f5..8dfd21e7a8e4 100644
@@ -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
maintainer
#2 lore raw
Quoted 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
---
 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
index 29e0729299f5..8dfd21e7a8e4 100644
@@ -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
#3 lore raw

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]
maintainer
#4 lore raw
Quoted 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 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.

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.