efi: deprecate/remove efivars sysfs interface
Subsystems (3)
Ard Biesheuvel
maintainercover efi: deprecate/remove efivars sysfs interface
This series implements the deprecation and ultimate removal of the sysfs interface that exposes the contents of the EFI variable store.
I am fully aware that removing this sysfs interface entirely may be premature, and so patch #7 is included for reference only, and not proposed for inclusion right away.
Instead, patch #6 limits availability of the efivars module to X86 and IA64, which is reasonable, given that the efivars module was superseded by the efivarfs filesystem interface before EFI support for ARM architectures was even available in Linux.
Patches #1 to #5 remove all dependencies [true or false] on the efivars.c code and its CONFIG_EFI_VARS Kconfig symbol, so it can be disabled [or dropped] cleanly.
Ard Biesheuvel (7):
efi: pstore: disentangle from deprecated efivars module
efi: pstore: move workqueue handling out of efivars
efi: efivars: un-export efivars_sysfs_init()
efi: gsmi: fix false dependency on CONFIG_EFI_VARS
efi: remove some false dependencies on CONFIG_EFI_VARS
efi: efivars: limit availability to X86 builds
efi: efivars: remove deprecated sysfs interface
.../ABI/stable/sysfs-firmware-efi-vars | 75 -- Documentation/arm/uefi.rst | 2 +- drivers/firmware/efi/Kconfig | 22 +- drivers/firmware/efi/Makefile | 1 - drivers/firmware/efi/efi-pstore.c | 83 +- drivers/firmware/efi/efivars.c | 711 ------------------ drivers/firmware/efi/vars.c | 21 - drivers/firmware/google/Kconfig | 2 +- drivers/firmware/google/gsmi.c | 8 +- include/linux/efi.h | 18 - 10 files changed, 85 insertions(+), 858 deletions(-) delete mode 100644 Documentation/ABI/stable/sysfs-firmware-efi-vars delete mode 100644 drivers/firmware/efi/efivars.c
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 1/7 efi: pstore: disentangle from deprecated efivars module
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
--- drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/efi-pstore.c | 76 ++++++++++++++++++-- drivers/firmware/efi/efivars.c | 41 +---------- include/linux/efi.h | 4 -- 4 files changed, 74 insertions(+), 49 deletions(-)
drivers/firmware/efi/Kconfig +1 -1
@@ -26,7 +26,7 @@ config EFI_ESRT config EFI_VARS_PSTORE tristate "Register efivars backend for pstore" - depends on EFI_VARS && PSTORE + depends on PSTORE default y help Say Y here to enable use efivars as a backend to pstore. This
drivers/firmware/efi/efi-pstore.c +72 -4
130 lines not on this page · raw message
drivers/firmware/efi/efivars.c +1 -40
59 lines not on this page · raw message
include/linux/efi.h +0 -4
@@ -984,8 +984,6 @@ struct efivar_entry {bool deleting; }; -extern struct list_head efivar_sysfs_list; -static inline void efivar_unregister (struct efivar_entry *var) {
@@ -1043,8 +1041,6 @@ void efivar_run_worker(void);#if defined(CONFIG_EFI_VARS ) || defined(CONFIG_EFI_VARS_MODULE )int efivars_sysfs_init (void ); -#define EFIVARS_DATA_SIZE_MAX 1024 -#endif /* CONFIG_EFI_VARS */ extern bool efi_capsule_pending (int *reset_type);
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 2/7 efi: pstore: move workqueue handling out of efivars
In reply to Ard BiesheuvelThe worker thread that gets kicked off to sync the state of the EFI variable list is only used by the EFI pstore implementation, and is defined in its source file. So let's move its scheduling there as well. Since our efivar_init() scan will bail on duplicate entries, there is no need to disable the workqueue like we did before, so we can run it unconditionally.
--- drivers/firmware/efi/efi-pstore.c | 7 +++++-- drivers/firmware/efi/vars.c | 21 -------------------- include/linux/efi.h | 3 --- 3 files changed, 5 insertions(+), 26 deletions(-)
drivers/firmware/efi/efi-pstore.c +5 -2
@@ -21,6 +21,7 @@ module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644); EFI_VARIABLE_RUNTIME_ACCESS)static LIST_HEAD (efi_pstore_list ); +static DECLARE_WORK(efivar_work, NULL);static int efi_pstore_open (struct pstore_info *psi) {
@@ -267,8 +268,9 @@ static int efi_pstore_write(struct pstore_record *record) ret =efivar_entry_set_safe (efi_name, vendor,PSTORE_EFI_ATTRIBUTES ,preemptible (), record->size, record->psi->buf); -if (record->reason ==KMSG_DUMP_OOPS ) -efivar_run_worker (); +if (record->reason ==KMSG_DUMP_OOPS &&try_module_get (THIS_MODULE )) +if (!schedule_work (&efivar_work)) +module_put (THIS_MODULE );return ret; };
@@ -412,6 +414,7 @@ static void efi_pstore_update_entries(struct work_struct *work) }kfree (entry); +module_put (THIS_MODULE ); }static __init int efivars_pstore_init (void )
drivers/firmware/efi/vars.c +0 -21
@@ -32,10 +32,6 @@ static struct efivars *__efivars;*/ static DEFINE_SEMAPHORE (efivars_lock); -static bool efivar_wq_enabled = true; -DECLARE_WORK (efivar_work,NULL ); -EXPORT_SYMBOL_GPL (efivar_work); -static bool validate_device_path (efi_char16_t *var_name,int match,u8 *buffer,unsigned long len)
@@ -391,13 +387,6 @@ static void dup_variable_bug(efi_char16_t *str16, efi_guid_t *vendor_guid,size_t i, len8 = len16 /sizeof (efi_char16_t);char *str8; -/* -* Disable the workqueue since the algorithm it uses for -* detecting new variables won't work with this buggy -* implementation of GetNextVariableName(). -*/ - efivar_wq_enabled = false; - str8 =kzalloc (len8,GFP_KERNEL );if (!str8)return ;
@@ -1157,16 +1146,6 @@ struct kobject *efivars_kobject(void) }EXPORT_SYMBOL_GPL (efivars_kobject); -/** -* efivar_run_worker - schedule the efivar worker thread -*/ -void efivar_run_worker (void ) -{ -if (efivar_wq_enabled) -schedule_work (&efivar_work); -} -EXPORT_SYMBOL_GPL (efivar_run_worker); -/** * efivars_register - register an efivars * @efivars: efivars to register
include/linux/efi.h +0 -3
@@ -1035,9 +1035,6 @@ bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,bool efivar_variable_is_removable (efi_guid_t vendor,const char *name,size_t len); -extern struct work_struct efivar_work; -void efivar_run_worker (void ); -#if defined(CONFIG_EFI_VARS ) || defined(CONFIG_EFI_VARS_MODULE )int efivars_sysfs_init (void );
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 5/7 efi: remove some false dependencies on CONFIG_EFI_VARS
In reply to Ard BiesheuvelRemove some false dependencies on CONFIG_EFI_VARS, which only controls the creation of the sysfs entries, whereas the underlying functionality that these modules rely on is enabled unconditionally when CONFIG_EFI is set.
--- drivers/firmware/efi/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/efi/Kconfig +1 -2
@@ -137,7 +137,6 @@ config EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER config EFI_BOOTLOADER_CONTROL tristate "EFI Bootloader Control" - depends on EFI_VARS default n help This module installs a reboot hook, such that if reboot() is
@@ -281,7 +280,7 @@ config EFI_EARLYCON config EFI_CUSTOM_SSDT_OVERLAYS bool "Load custom ACPI SSDT overlay from an EFI variable" - depends on EFI_VARS && ACPI + depends on EFI && ACPI default ACPI_TABLE_UPGRADE help Allow loading of an ACPI SSDT overlay from an EFI variable specified
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 4/7 efi: gsmi: fix false dependency on CONFIG_EFI_VARS
In reply to Ard BiesheuvelThe gsmi code does not actually rely on CONFIG_EFI_VARS, since it only uses the efivars abstraction that is included unconditionally when CONFIG_EFI is defined. CONFIG_EFI_VARS controls the inclusion of the code that exposes the sysfs entries, and which has been deprecated for some time.
--- drivers/firmware/google/Kconfig | 2 +- drivers/firmware/google/gsmi.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/firmware/google/Kconfig +1 -1
@@ -15,7 +15,7 @@ config GOOGLE_SMI help Say Y here if you want to enable SMI callbacks for Google platforms. This provides an interface for writing to and - clearing the event log. If EFI_VARS is also enabled this + clearing the event log. If CONFIG_EFI is also enabled this driver provides an interface for reading and writing NVRAM variables.
drivers/firmware/google/gsmi.c +4 -4
@@ -302,7 +302,7 @@ static int gsmi_exec(u8 func, u8 sub)return rc; } -#ifdef CONFIG_EFI_VARS +#ifdef CONFIG_EFI static struct efivars efivars;
@@ -483,7 +483,7 @@ static const struct efivar_operations efivar_ops = { .get_next_variable = gsmi_get_next_variable, }; -#endif /* CONFIG_EFI_VARS */ +#endif /* CONFIG_EFI */ static ssize_t eventlog_write(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr,
@@ -1007,7 +1007,7 @@ static __init int gsmi_init(void) goto out_remove_bin_file; } -#ifdef CONFIG_EFI_VARS +#ifdef CONFIG_EFI ret =efivars_register (&efivars, &efivar_ops, gsmi_kobj);if (ret) {printk (KERN_INFO "gsmi: Failed to register efivars\n" );
@@ -1047,7 +1047,7 @@ static void __exit gsmi_exit(void)unregister_die_notifier (&gsmi_die_notifier);atomic_notifier_chain_unregister (&panic_notifier_list, &gsmi_panic_notifier); -#ifdef CONFIG_EFI_VARS +#ifdef CONFIG_EFI efivars_unregister (&efivars);#endif
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 3/7 efi: efivars: un-export efivars_sysfs_init()
In reply to Ard Biesheuvelefivars_sysfs_init() is only used locally in the source file that defines it, so make it static and unexport it.
--- drivers/firmware/efi/efivars.c | 3 +-- include/linux/efi.h | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/firmware/efi/efivars.c +1 -2
@@ -638,7 +638,7 @@ static void efivars_sysfs_exit(void)kset_unregister (efivars_kset); } -int efivars_sysfs_init (void ) +static int efivars_sysfs_init (void ) {struct kobject *parent_kobj =efivars_kobject ();int error =0 ;
@@ -666,7 +666,6 @@ int efivars_sysfs_init(void)return 0 ; } -EXPORT_SYMBOL_GPL (efivars_sysfs_init);module_init (efivars_sysfs_init);module_exit (efivars_sysfs_exit);
include/linux/efi.h +0 -4
@@ -1035,10 +1035,6 @@ bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,bool efivar_variable_is_removable (efi_guid_t vendor,const char *name,size_t len); -#if defined(CONFIG_EFI_VARS ) || defined(CONFIG_EFI_VARS_MODULE ) -int efivars_sysfs_init (void ); - -#endif /* CONFIG_EFI_VARS */ extern bool efi_capsule_pending (int *reset_type); extern int efi_capsule_supported(efi_guid_t guid, u32 flags,
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 7/7 efi: efivars: remove deprecated sysfs interface
In reply to Ard Biesheuvel---
Note: for reference only - please read cover letter before replying.
Documentation/ABI/stable/sysfs-firmware-efi-vars | 75 --- drivers/firmware/efi/Kconfig | 12 - drivers/firmware/efi/Makefile | 1 - drivers/firmware/efi/efivars.c | 671 -------------------- include/linux/efi.h | 7 - 5 files changed, 766 deletions(-)
Documentation/ABI/stable/sysfs-firmware-efi-vars deleted +0 -75
@@ -1,75 +0,0 @@ -What: /sys/firmware/efi/vars -Date: April 2004 -Contact: Matt Domsch <[email protected]> -Description: - This directory exposes interfaces for interactive with - EFI variables. For more information on EFI variables, - see 'Variable Services' in the UEFI specification - (section 7.2 in specification version 2.3 Errata D). - - In summary, EFI variables are named, and are classified - into separate namespaces through the use of a vendor - GUID. They also have an arbitrary binary value - associated with them. - - The efivars module enumerates these variables and - creates a separate directory for each one found. Each - directory has a name of the form "<key>-<vendor guid>" - and contains the following files: - - attributes: A read-only text file enumerating the - EFI variable flags. Potential values - include: - - EFI_VARIABLE_NON_VOLATILE - EFI_VARIABLE_BOOTSERVICE_ACCESS - EFI_VARIABLE_RUNTIME_ACCESS - EFI_VARIABLE_HARDWARE_ERROR_RECORD - EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS - - See the EFI documentation for an - explanation of each of these variables. - - data: A read-only binary file that can be read - to attain the value of the EFI variable - - guid: The vendor GUID of the variable. This - should always match the GUID in the - variable's name. - - raw_var: A binary file that can be read to obtain - a structure that contains everything - there is to know about the variable. - For structure definition see "struct - efi_variable" in the kernel sources. - - This file can also be written to in - order to update the value of a variable. - For this to work however, all fields of - the "struct efi_variable" passed must - match byte for byte with the structure - read out of the file, save for the value - portion. - - **Note** the efi_variable structure - read/written with this file contains a - 'long' type that may change widths - depending on your underlying - architecture. - - size: As ASCII representation of the size of - the variable's value. - - - In addition, two other magic binary files are provided - in the top-level directory and are used for adding and - removing variables: - - new_var: Takes a "struct efi_variable" and - instructs the EFI firmware to create a - new variable. - - del_var: Takes a "struct efi_variable" and - instructs the EFI firmware to remove any - variable that has a matching vendor GUID - and variable key name.
drivers/firmware/efi/Kconfig +0 -12
@@ -2,18 +2,6 @@ menu "EFI (Extensible Firmware Interface) Support" depends on EFI -config EFI_VARS - tristate "EFI Variable Support via sysfs" - depends on EFI && (X86 || IA64) - default n - help - If you say Y here, you are able to get EFI (Extensible Firmware - Interface) variable information via sysfs. You may read, - write, create, and destroy EFI variables through this interface. - Note that this driver is only retained for compatibility with - legacy users: new users should use the efivarfs filesystem - instead. - config EFI_ESRT bool depends on EFI && !IA64
drivers/firmware/efi/Makefile +0 -1
@@ -14,7 +14,6 @@ obj-$(CONFIG_ACPI_BGRT) += efi-bgrt.o obj-$(CONFIG_EFI) += efi.o vars.o reboot.o memattr.o tpm.o obj-$(CONFIG_EFI) += capsule.o memmap.o obj-$(CONFIG_EFI_PARAMS_FROM_FDT) += fdtparams.o -obj-$(CONFIG_EFI_VARS) += efivars.o obj-$(CONFIG_EFI_ESRT) += esrt.o obj-$(CONFIG_EFI_VARS_PSTORE) += efi-pstore.o obj-$(CONFIG_UEFI_CPER) += cper.o
drivers/firmware/efi/efivars.c deleted +0 -671
671 lines not on this page · raw message
include/linux/efi.h +0 -7
@@ -979,17 +979,10 @@ struct efi_variable {struct efivar_entry {struct efi_variable var;struct list_head list; -struct kobject kobj;bool scanning;bool deleting; }; -static inline void -efivar_unregister (struct efivar_entry *var) -{ -kobject_put (&var->kobj); -} -int efivars_register (struct efivars *efivars,const struct efivar_operations *ops,struct kobject *kobject);
Signature · 1 line
2.17.1
Ard Biesheuvel
maintainerPATCH 6/7 efi: efivars: limit availability to X86 builds
In reply to Ard BiesheuvelCONFIG_EFI_VARS controls the code that exposes EFI variables via sysfs entries, which was deprecated before support for non-Intel architectures was added to EFI. So let's limit its availability to Intel architectures for the time being, and hopefully remove it entirely in the not too distant future.
--- Documentation/arm/uefi.rst | 2 +- drivers/firmware/efi/Kconfig | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-)
Documentation/arm/uefi.rst +1 -1
@@ -23,7 +23,7 @@ makes it possible for the kernel to support additional features: For actually enabling [U]EFI support, enable: - CONFIG_EFI=y -- CONFIG_EFI_VARS=y or m +- CONFIG_EFIVAR_FS=y or m The implementation depends on receiving information about the UEFI environment in a Flattened Device Tree (FDT) - so is only available with CONFIG_OF.
drivers/firmware/efi/Kconfig +4 -9
@@ -4,20 +4,15 @@ menu "EFI (Extensible Firmware Interface) Support" config EFI_VARS tristate "EFI Variable Support via sysfs" - depends on EFI + depends on EFI && (X86 || IA64) default n help If you say Y here, you are able to get EFI (Extensible Firmware Interface) variable information via sysfs. You may read, write, create, and destroy EFI variables through this interface. - - Note that using this driver in concert with efibootmgr requires - at least test release version 0.5.0-test3 or later, which is - available from: - <http://linux.dell.com/efibootmgr/testing/efibootmgr-0.5.0-test3.tar.gz> - - Subsequent efibootmgr releases may be found at: - <http://github.com/vathpela/efibootmgr> + Note that this driver is only retained for compatibility with + legacy users: new users should use the efivarfs filesystem + instead. config EFI_ESRT bool
Signature · 1 line
2.17.1
Re: [PATCH 1/7] efi: pstore: disentangle from deprecated efivars module
In reply to Ard BiesheuvelQuoted 9 lines · Ard Biesheuvel
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Quoted 5 lines
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
Signed-off-by Ard Biesheuvel <[email protected]>
With this and the other pstore patch, do the pstore self-tests still pass on an EFI system?
If so, please consider both:
Thanks!
Signature · 1 line
Kees Cook
Ard Biesheuvel
maintainerRe: [PATCH 1/7] efi: pstore: disentangle from deprecated efivars module
Quoted 15 lines · Kees Cook
Quoted 13 lines · Ard Biesheuvel
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
Quoted 9 lines
Quoted 1 line
Signed-off-by Ard Biesheuvel <[email protected]>With this and the other pstore patch, do the pstore self-tests still pass on an EFI system?
If so, please consider both:
Acked-by Kees Cook <[email protected]>
Selftests? Excellent! Are they documented too?
Re: [PATCH 1/7] efi: pstore: disentangle from deprecated efivars module
Quoted 21 lines · Ard Biesheuvel
Quoted 20 lines · Kees Cook
Quoted 9 lines · Ard Biesheuvel
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Quoted 5 lines
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
Signed-off-by Ard Biesheuvel <[email protected]>With this and the other pstore patch, do the pstore self-tests still pass on an EFI system?
Quoted 6 lines
Quoted 4 lines
If so, please consider both:
Acked-by Kees Cook <[email protected]>Selftests? Excellent! Are they documented too?
Not really, but they're pretty simple:
cd tools/testing/selftests/pstore *double-check "config" against running kernel config* ./pstore_tests
./pstore_crash_test
*wait for system to reboot*
cd tools/testing/selftests/pstore ./pstore_post_reboot_tests
(though please test before/after, just to make sure other deltas haven't broken things before your series -- I don't test EFI pstore with high frequency)
Signature · 1 line
Kees Cook
Ard Biesheuvel
maintainerRe: [PATCH 1/7] efi: pstore: disentangle from deprecated efivars module
Quoted 40 lines · Kees Cook
Quoted 21 lines · Ard Biesheuvel
Quoted 20 lines · Kees Cook
Quoted 9 lines · Ard Biesheuvel
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Quoted 5 lines
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
Signed-off-by Ard Biesheuvel <[email protected]>With this and the other pstore patch, do the pstore self-tests still pass on an EFI system?
Quoted 6 lines
Quoted 4 lines
If so, please consider both:
Acked-by Kees Cook <[email protected]>Selftests? Excellent! Are they documented too?
Not really, but they're pretty simple:
cd
tools/testing/selftests/pstore*double-check "config" against running kernel config* ./pstore_tests
./pstore_crash_test
*wait for system to reboot*
cdtools/testing/selftests/pstore./pstore_post_reboot_tests
Quoted 4 lines
(though please test before/after, just to make sure other deltas haven't broken things before your series -- I don't test EFI pstore with high frequency)
I have done the 'before' test on three different EFI Linux systems (x86, arm64 and ARM), and they all give me something like the below
=== Pstore unit tests (pstore_tests) === UUID=109d02e6-9395-4274-9554-2c078e87a662 Checking pstore backend is registered ... ok
backend=efi cmdline=BOOT_IMAGE=/vmlinuz-5.3.0-59-generic
root=/dev/mapper/crypt-root ro quiet splash vt.handoff=1 Checking pstore console is registered ... FAIL Checking /dev/pmsg0 exists ... FAIL
Writing unique string to /dev/pmsg0 ... FAIL
So I'm not sure if there is any point to doing the 'after' test if this is the baseline.
Ard Biesheuvel
maintainerRe: [PATCH 1/7] efi: pstore: disentangle from deprecated efivars module
Quoted 60 lines · Ard Biesheuvel
Quoted 40 lines · Kees Cook
Quoted 21 lines · Ard Biesheuvel
Quoted 20 lines · Kees Cook
Quoted 9 lines · Ard Biesheuvel
The EFI pstore implementation relies on the 'efivars' abstraction, which encapsulates the EFI variable store in a way that can be overridden by other backing stores, like the Google SMI one.
On top of that, the EFI pstore implementation also relies on the efivars.ko module, which is a separate layer built on top of the 'efivars' abstraction that exposes the [deprecated] sysfs entries for each variable that exists in the backing store.
Quoted 5 lines
Since the efivars.ko module is deprecated, and all users appear to have moved to the efivarfs file system instead, let's prepare for its removal, by removing EFI pstore's dependency on it.
Signed-off-by Ard Biesheuvel <[email protected]>With this and the other pstore patch, do the pstore self-tests still pass on an EFI system?
Quoted 6 lines
Quoted 4 lines
If so, please consider both:
Acked-by Kees Cook <[email protected]>Selftests? Excellent! Are they documented too?
Not really, but they're pretty simple:
cd
tools/testing/selftests/pstore*double-check "config" against running kernel config* ./pstore_tests
./pstore_crash_test
*wait for system to reboot*
cdtools/testing/selftests/pstore./pstore_post_reboot_testsQuoted 4 lines
(though please test before/after, just to make sure other deltas haven't broken things before your series -- I don't test EFI pstore with high frequency)
I have done the 'before' test on three different EFI Linux systems (x86, arm64 and ARM), and they all give me something like the below
=== Pstore unit tests (
pstore_tests) === UUID=109d02e6-9395-4274-9554-2c078e87a662 Checking pstore backend is registered ... ok
backend=efi cmdline=BOOT_IMAGE=/vmlinuz-5.3.0-59-generic
root=/dev/mapper/crypt-root ro quiet splash vt.handoff=1 Checking pstore console is registered ... FAIL Checking/dev/pmsg0exists ... FAIL
Writing unique string to/dev/pmsg0... FAIL
Quoted 2 lines
So I'm not sure if there is any point to doing the 'after' test if this is the baseline.
In any case, I confirmed that the new efi-pstore module
- exposes existing pstore dmesg entries correctly
- captures oops and panic messages as dmesg-efi-xxxx entries as before