efi: Check the number of EFI configuration tables entries
PATCH v2 1/1 efi: Check the number of EFI configuration tables entries
Only try and access the EFI configuration tables if there there are any reported. This allows EFI to be continued to used on systems where there are no configuration table entries.
v2: Move return on nr_tables==0 earlier
--- arch/x86/platform/efi/quirks.c | 3 +++ drivers/firmware/efi/efi.c | 3 +++ 2 files changed, 6 insertions(+)
arch/x86/platform/efi/quirks.c +3 -0
@@ -471,6 +471,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables)void *p, *tablep;struct efi_setup_data *data; +if (nr_tables ==0 ) +return 0 ; +if (!efi_setup)return 0 ;
drivers/firmware/efi/efi.c +3 -0
@@ -628,6 +628,9 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables)void *config_tables;int sz, ret; +if (efi.systab->nr_tables ==0 ) +return 0 ; +if (efi_enabled (EFI_64BIT )) sz =sizeof (efi_config_table_64_t);else
Signature · 1 line
2.20.1
Quoted 44 lines · Rob Bradford
Only try and access the EFI configuration tables if there there are any
reported. This allows EFI to be continued to used on systems where there
are no configuration table entries.v2: Move return on nr_tables==0 earlier
Signed-off-by Rob Bradford <[email protected]>--- arch/x86/platform/efi/quirks.c | 3 +++ drivers/firmware/efi/efi.c | 3 +++ 2 files changed, 6 insertions(+)arch/x86/platform/efi/quirks.c +3
-0@@ -471,6 +471,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables)void *p, *tablep;struct efi_setup_data *data; +if (nr_tables ==0 ) +return 0 ; +if (!efi_setup)return 0 ;drivers/firmware/efi/efi.c +3
-0@@ -628,6 +628,9 @@ int __initefi_config_init (efi_config_table_type_t *arch_tables) void *config_tables;int sz, ret; +if (efi.systab->nr_tables ==0 ) +return 0 ; +if (efi_enabled (EFI_64BIT )) sz =sizeof (efi_config_table_64_t);
Quoted 1 line
else
Any chance of getting this into the tree? Without this we can't boot the kernel in EFI mode on our KVM based hypervisor[1] & firmware[2] as it does not provide any tables, nor does it need to.
Rob
[1] https://github.com/intel/cloud-hypervisor
[2] https://github.com/intel/rust-hypervisor-firmware
Quoted 41 lines · Robert
Quoted 39 lines · Rob Bradford
Only try and access the EFI configuration tables if there there are any
reported. This allows EFI to be continued to used on systems where there
are no configuration table entries.v2: Move return on nr_tables==0 earlier
Signed-off-by Rob Bradford <[email protected]>--- arch/x86/platform/efi/quirks.c | 3 +++ drivers/firmware/efi/efi.c | 3 +++ 2 files changed, 6 insertions(+)arch/x86/platform/efi/quirks.c +3
-0@@ -471,6 +471,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables)void *p, *tablep;struct efi_setup_data *data; +if (nr_tables ==0 ) +return 0 ; +if (!efi_setup)return 0 ;drivers/firmware/efi/efi.c +0
-0@@ -628,6 +628,9 @@ int __initefi_config_init (efi_config_table_type_t *arch_tables) void *config_tables;int sz, ret;
Quoted 11 lines
Quoted 6 lines
drivers/firmware/efi/efi.c +3
-0+if (efi.systab->nr_tables ==0 ) +return 0 ; +if (efi_enabled (EFI_64BIT )) sz =sizeof (efi_config_table_64_t);else
Any chance of getting this into the tree? Without this we can't boot the kernel in EFI mode on our KVM based hypervisor[1] & firmware[2] as it does not provide any tables, nor does it need to.
Apologies for the delay. I will pick it up today.