Commit 3fd6f849 authored by Richard Weinberger's avatar Richard Weinberger Committed by Greg Kroah-Hartman

x86,efi: Implement efi_no_storage_paranoia parameter

commit 8c58bf3e upstream.

Using this parameter one can disable the storage_size/2 check if
he is really sure that the UEFI does sane gc and fulfills the spec.

This parameter is useful if a devices uses more than 50% of the
storage by default.
The Intel DQSW67 desktop board is such a sucker for exmaple.
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 891d583c
...@@ -773,6 +773,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -773,6 +773,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
edd= [EDD] edd= [EDD]
Format: {"off" | "on" | "skip[mbr]"} Format: {"off" | "on" | "skip[mbr]"}
efi_no_storage_paranoia [EFI; X86]
Using this parameter you can use more than 50% of
your efi variable storage. Use this parameter only if
you are really sure that your UEFI does sane gc and
fulfills the spec otherwise your board may brick.
eisa_irq_edge= [PARISC,HW] eisa_irq_edge= [PARISC,HW]
See header of drivers/parisc/eisa.c. See header of drivers/parisc/eisa.c.
......
...@@ -102,6 +102,15 @@ static int __init setup_add_efi_memmap(char *arg) ...@@ -102,6 +102,15 @@ static int __init setup_add_efi_memmap(char *arg)
} }
early_param("add_efi_memmap", setup_add_efi_memmap); early_param("add_efi_memmap", setup_add_efi_memmap);
static bool efi_no_storage_paranoia;
static int __init setup_storage_paranoia(char *arg)
{
efi_no_storage_paranoia = true;
return 0;
}
early_param("efi_no_storage_paranoia", setup_storage_paranoia);
static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
{ {
...@@ -984,7 +993,10 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) ...@@ -984,7 +993,10 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
" is returning MaxVariableSize=0\n"); " is returning MaxVariableSize=0\n");
if (!storage_size || size > remaining_size || if (!storage_size || size > remaining_size ||
(max_size && size > max_size) || (max_size && size > max_size))
return EFI_OUT_OF_RESOURCES;
if (!efi_no_storage_paranoia &&
(remaining_size - size) < (storage_size / 2)) (remaining_size - size) < (storage_size / 2))
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment