Skip to contentSkip to conversation

x86, efi: change name of efi_no_storage_paranoia parameter to efi_storage_paranoia

PATCH In review Yasuaki Ishimatsu 5 participants 19 messages Nov 8, 2013 – Nov 21, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, efi: change name of efi_no_storage_paranoia parameter to efi_storage_paranoia

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

This patch changes name of the parameter to efi_storage_paranoia and uses all efi variable storage with no parameter.

CC Matthew Garrett <matthew.garrett-05XSO3Yj/[email protected]>
CC Richard Weinberger <richard-/[email protected]>
CC Lee, Chun-Y <jlee-IBi9RG/[email protected]>
CC Matt Fleming <[email protected]>
---
 Documentation/kernel-parameters.txt | 10 +++++-----
 arch/x86/platform/efi/efi.c         |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)
Documentation/kernel-parameters.txt +5 -5
index fcbb736..2157c8e 100644
@@ -888,11 +888,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 	edd=		[EDD]
 			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.
+	efi_storage_paranoia [EFI; X86]
+			Using this parameter you cannot use your efi variable
+			storage when the remaining space of the storage becomes
+			less than 5KB. Use this parameter if your UEFI does
+			not sane gc and fulfills the spec.
 
 	eisa_irq_edge=	[PARISC,HW]
 			See header of drivers/parisc/eisa.c.
arch/x86/platform/efi/efi.c +4 -4
index c7e22ab..010a0eb 100644
@@ -107,14 +107,14 @@ static int __init setup_add_efi_memmap(char *arg)
 }
 early_param("add_efi_memmap", setup_add_efi_memmap);
 
-static bool efi_no_storage_paranoia;
+static bool efi_storage_paranoia;
 
 static int __init setup_storage_paranoia(char *arg)
 {
-	efi_no_storage_paranoia = true;
+	efi_storage_paranoia = true;
 	return 0;
 }
-early_param("efi_no_storage_paranoia", setup_storage_paranoia);
+early_param("efi_storage_paranoia", setup_storage_paranoia);
 
 
 static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
@@ -1066,7 +1066,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
 	 * 5KB. This figure was provided by Samsung, so should be safe.
 	 */
 	if ((remaining_size - size < EFI_MIN_RESERVE) &&
-		!efi_no_storage_paranoia) {
+		efi_storage_paranoia) {
 
 		/*
 		 * Triggering garbage collection may require that the firmware
#1 lore raw

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 11 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

Quoted 7 lines

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

And how does one know that his UEFI is broken?
"Oh my board is briked because I wrote too much into a variable, maybe setting efi_storage_paranoia would have saved me. Let's try with the next board..." ;)

Thanks,
//richard

#2 lore raw
Quoted 11 lines · richard-/[email protected] writes:

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 5 lines

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

And how does one know that his UEFI is broken?
"Oh my board is briked because I wrote too much into a variable, maybe setting efi_storage_paranoia would have saved me. Let's try with the next board..." ;)

Agreed. It's hard for people to fix their briked motherboard. At least it's hard for someone who is the first time meet this issue like me. :-( and IMO, at least 51% of uefi firmwares on the world is buggy... ;) However, if we simply make all buggy firmware become a brick, the vendors will more careful in their next generation of products... But it's painful for everyone, both customers and vendors.

Quoted 6 lines

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best,
Madper Xie.
#3 lore raw
In reply to Richard Weinberger
Quoted 15 lines · Richard Weinberger

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 14 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

Quoted 6 lines
Quoted 4 lines

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

And how does one know that his UEFI is broken?

I have no idea. But at least, bricked board is broken UEFI. Do you know the issue occurs on several boards or specific board?

Thanks,
Yasuaki Ishimatsu

Quoted 6 lines

"Oh my board is briked because I wrote too much into a variable, maybe setting efi_storage_paranoia would have saved me. Let's try with the next board..." ;)

Thanks,
//richard

#4 lore raw

Am 08.11.2013 10:34, schrieb Yasuaki Ishimatsu:

Quoted 21 lines
Quoted 20 lines · Richard Weinberger

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 18 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

Quoted 4 lines
Quoted 1 line

And how does one know that his UEFI is broken?

I have no idea. But at least, bricked board is broken UEFI. Do you know the issue occurs on several boards or specific board?

On *many* boards including laptops....
Please read the history of the whole issue.

Thanks,
//richard

#5 lore raw
Quoted 22 lines · Richard Weinberger

Am 08.11.2013 10:34, schrieb Yasuaki Ishimatsu:

Quoted 21 lines
Quoted 20 lines · Richard Weinberger

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 18 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

And how does one know that his UEFI is broken?

I have no idea. But at least, bricked board is broken UEFI. Do you know the issue occurs on several boards or specific board?

On *many* boards including laptops....
Please read the history of the whole issue.

Thank you for your comment.
I has read git log. But there is no information like this. So I will read them of related threads again. Do you know good threads to know the history of the issue?

Thanks,
Yasuaki Ishimatsu

Quoted 4 lines

Thanks,
//richard

#6 lore raw

Am 08.11.2013 11:25, schrieb Yasuaki Ishimatsu:

Quoted 28 lines
Quoted 27 lines · Richard Weinberger

Am 08.11.2013 10:34, schrieb Yasuaki Ishimatsu:

Quoted 25 lines
Quoted 15 lines · Richard Weinberger

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 14 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

Quoted 6 lines
Quoted 4 lines

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

And how does one know that his UEFI is broken?

I have no idea. But at least, bricked board is broken UEFI. Do you know the issue occurs on several boards or specific board?

Quoted 7 lines
Quoted 2 lines

On *many* boards including laptops....
Please read the history of the whole issue.

Thank you for your comment.
I has read git log. But there is no information like this. So I will read them of related threads again. Do you know good threads to know the history of the issue?

Everything started with an issue that killed Samsung laptops:
http://mjg59.dreamwidth.org/22855.html

Later it was found that if you write too much into UEFI variables many UEFI implementations will do bad things.

Thanks,
//richard

#7 lore raw
Quoted 38 lines · Richard Weinberger

Am 08.11.2013 11:25, schrieb Yasuaki Ishimatsu:

Quoted 28 lines
Quoted 27 lines · Richard Weinberger

Am 08.11.2013 10:34, schrieb Yasuaki Ishimatsu:

Quoted 25 lines
Quoted 15 lines · Richard Weinberger

Am 08.11.2013 08:33, schrieb Yasuaki Ishimatsu:

Quoted 14 lines

By following works, my system very often fails set_variable() to set new variable to efi variable storage and shows "efivars: set_variable() failed:
status=-28" message.

- commit 31ff2f20d9003e74991d135f56e503fe776c127c
efi: Distinguish between "remaining space" and actually used space
- commit 8c58bf3eec3b8fc8162fe557e9361891c20758f2
x86,efi: Implement efi_no_storage_paranoia parameter
- commit f8b8404337de4e2466e2e1139ea68b1f8295974f
Modify UEFI anti-bricking code

When booting my system, remaining space of efi variable storage is about 5KB. So there is no room that sets a new variable to the storage.

Quoted 6 lines
Quoted 4 lines

According to above works, efi_no_storage_paranoia parameter was prepared for sane UEFI which can do gc and fulfills spec. But why need a system with a sane UEFI set the parameter? It is wrong. A system with a broken UEFI should set the parameter.

And how does one know that his UEFI is broken?

I have no idea. But at least, bricked board is broken UEFI. Do you know the issue occurs on several boards or specific board?

Quoted 7 lines
Quoted 2 lines

On *many* boards including laptops....
Please read the history of the whole issue.

Thank you for your comment.
I has read git log. But there is no information like this. So I will read them of related threads again. Do you know good threads to know the history of the issue?

Quoted 5 lines

Everything started with an issue that killed Samsung laptops:
http://mjg59.dreamwidth.org/22855.html

Later it was found that if you write too much into UEFI variables many UEFI implementations will do bad things.

Thanks for the information.
I will read it.

Thanks,
Yasuaki Ishimatsu

Quoted 4 lines

Thanks,
//richard

#8 lore raw
Quoted 8 lines · Yasuaki Ishimatsu
Quoted 5 lines

Everything started with an issue that killed Samsung laptops:
http://mjg59.dreamwidth.org/22855.html

Later it was found that if you write too much into UEFI variables many UEFI implementations will do bad things.

Thanks for the information.
I will read it.

Out of curiosity, what hardware are you using?

Signature · 1 line
Matt Fleming, Intel Open Source Technology Center
#9 lore raw

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

Thanks,
Yasuaki Ishimatsu

Quoted 12 lines · Matt Fleming
Quoted 8 lines · Yasuaki Ishimatsu
Quoted 5 lines

Everything started with an issue that killed Samsung laptops:
http://mjg59.dreamwidth.org/22855.html

Later it was found that if you write too much into UEFI variables many UEFI implementations will do bad things.

Thanks for the information.
I will read it.

Out of curiosity, what hardware are you using?

#10 lore raw

Howdy Yasuaki,
I know some boxes with small NVRAM (less than 64kb?) will meet many issues if we always keep ~5kb free space.
But if we really do not keep some free space as default, many box will become a brick. (In fact, I just fixed a bricked dell xps 8500 last week. 5kb is not enough for dell xps...)
So maybe the better way is: we check the size of nvram and decide how many space we retain.

Quoted 30 lines · [email protected] writes:

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

Thanks,
Yasuaki Ishimatsu

Quoted 4 lines · Matt Fleming
Quoted 3 lines · Yasuaki Ishimatsu
Quoted 3 lines

Everything started with an issue that killed Samsung laptops:
http://mjg59.dreamwidth.org/22855.html

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Later it was found that if you write too much into UEFI variables many UEFI implementations will do bad things.

Thanks for the information.
I will read it.

Out of curiosity, what hardware are you using?

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best,
Madper Xie.
#11 lore raw
In reply to Yasuaki Ishimatsu
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Signature · 1 line
Matt Fleming, Intel Open Source Technology Center
#12 lore raw

Hi Matt,

Sorry for late the reply.

Quoted 22 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

Quoted 2 lines

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Thanks,
Yasuaki Ishimatsu

#13 lore raw
Quoted 28 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 22 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

Quoted 6 lines
Quoted 2 lines

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Quoted 2 lines

Thanks,
Yasuaki Ishimatsu

--
Best,
Madper

#14 lore raw
Quoted 34 lines · Madper Xie
Quoted 31 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 24 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Quoted 7 lines
Quoted 3 lines

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Even if we got EFI_OUT_OF_RESOURCES while running Linux, gc does not run. Trigger of gc is when EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI. So on my system, if EFI_OUT_OF_RESOURCES occurs by the 5Kbyte threshold, we cannot use nvram storage until EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI.

Thanks,
Yasuaki Ishimatsu

Quoted 8 lines
Quoted 3 lines

Thanks,
Yasuaki Ishimatsu

--
Best,
Madper

#15 lore raw

於 三,2013-11-20 於 15:26 +0900,Yasuaki Ishimatsu 提到:

Quoted 43 lines
Quoted 34 lines · Madper Xie
Quoted 31 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 24 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Quoted 7 lines
Quoted 3 lines

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Quoted 8 lines

Even if we got EFI_OUT_OF_RESOURCES while running Linux, gc does not run. Trigger of gc is when EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI. So on my system, if EFI_OUT_OF_RESOURCES occurs by the 5Kbyte threshold, we cannot use nvram storage until EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI.

Thanks,
Yasuaki Ishimatsu

Can we try to trigger gc by EFI_OUT_OF_RESOURCE in EFI stub kernel or EFI boot loader to recover NVRAM space? Does work with the BIOS on this machine?

Thanks a lot!
Joey Lee

#16 lore raw
Quoted 50 lines · joeyli

於 三,2013-11-20 於 15:26 +0900,Yasuaki Ishimatsu 提到:

Quoted 49 lines
Quoted 34 lines · Madper Xie
Quoted 31 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 24 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Quoted 7 lines
Quoted 3 lines

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Even if we got EFI_OUT_OF_RESOURCES while running Linux, gc does not run. Trigger of gc is when EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI. So on my system, if EFI_OUT_OF_RESOURCES occurs by the 5Kbyte threshold, we cannot use nvram storage until EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI.

Quoted 6 lines
Quoted 2 lines

Thanks,
Yasuaki Ishimatsu

Can we try to trigger gc by EFI_OUT_OF_RESOURCE in EFI stub kernel or EFI boot loader to recover NVRAM space? Does work with the BIOS on this machine?

Yes. I can trigger gc by EFI_OUT_OF_RESOUCE in EFI shell on my machine.

Thanks,
Yasuaki Ishimatu

Quoted 5 lines

Thanks a lot!
Joey Lee

#17 lore raw

於 四,2013-11-21 於 18:13 +0900,Yasuaki Ishimatsu 提到:

Quoted 54 lines
Quoted 53 lines · joeyli

於 三,2013-11-20 於 15:26 +0900,Yasuaki Ishimatsu 提到:

Quoted 51 lines
Quoted 34 lines · Madper Xie
Quoted 31 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 24 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Quoted 7 lines
Quoted 3 lines

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Even if we got EFI_OUT_OF_RESOURCES while running Linux, gc does not run. Trigger of gc is when EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI. So on my system, if EFI_OUT_OF_RESOURCES occurs by the 5Kbyte threshold, we cannot use nvram storage until EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI.

Thanks,
Yasuaki Ishimatsu

Quoted 9 lines
Quoted 3 lines

Can we try to trigger gc by EFI_OUT_OF_RESOURCE in EFI stub kernel or EFI boot loader to recover NVRAM space? Does work with the BIOS on this machine?

Yes. I can trigger gc by EFI_OUT_OF_RESOUCE in EFI shell on my machine.

Thanks,
Yasuaki Ishimatu

OK, then maybe can try to trigger gc in EFI stub before ExitBootService().

Another problem is what's the reasonable threshold. The threshold should bigger then 5Kbyte, then we write a dummy BootTime NV variable to trigger gc.

Thanks
Joey Lee

#18 lore raw

於 四,2013-11-21 於 17:53 +0800,joeyli 提到:

Quoted 68 lines

於 四,2013-11-21 於 18:13 +0900,Yasuaki Ishimatsu 提到:

Quoted 54 lines
Quoted 53 lines · joeyli

於 三,2013-11-20 於 15:26 +0900,Yasuaki Ishimatsu 提到:

Quoted 51 lines
Quoted 34 lines · Madper Xie
Quoted 31 lines · [email protected] writes:

Hi Matt,

Sorry for late the reply.

Quoted 24 lines · Matt Fleming
Quoted 6 lines · Yasuaki Ishimatsu

Hi Matt,

I uses FUJITSU's x86 box.
This does not become bricked even if I use all efi variable storage. Thus I want a way to not need to specify efi_no_storage_paranoia parameter.

The efi_no_storage_paranoia parameter was introduced because some machines do not initiate garbage collection of the NVRAM until you allocate all space - basically it's a switch to turn off the "save 5KB of stoarge at all times" workaround that is needed to avoid bricking some machines.

The intention of the switch is not to allow you to fill your NVRAM just because you can. If that is something you want to do then I think it's fair to require you to explicitly turn on efi_no_storage_paranoia. But I'm assuming here that you are doing something like writing lots and lots of pstore entries and just want to write as many as your variable storage will allow? Or are you doing something more fundamental like creating BootXXXX entries?

What are you doing to run into the 5KB reserve? How much NVRAM does your machine come with?

Quoted 7 lines
Quoted 3 lines

I just add boot entry to NVRAM by efibootmgr command. But when Linux boots up, the remaining NVRAM is less than 5Kbyte. So I cannnot add new entry.

Howdy Yasuaki,
If the remaining NVRAM is less than 5Kb, your writing will trigger a NVRAM storage reclamation. However you still failed creating entry. So I'm just curious what itmes occupy lots of nvram storage space.

Even if we got EFI_OUT_OF_RESOURCES while running Linux, gc does not run. Trigger of gc is when EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI. So on my system, if EFI_OUT_OF_RESOURCES occurs by the 5Kbyte threshold, we cannot use nvram storage until EFI_OUT_OF_RESOURCES occurs on pre OS environment with UEFI.

Thanks,
Yasuaki Ishimatsu

Quoted 9 lines
Quoted 3 lines

Can we try to trigger gc by EFI_OUT_OF_RESOURCE in EFI stub kernel or EFI boot loader to recover NVRAM space? Does work with the BIOS on this machine?

Yes. I can trigger gc by EFI_OUT_OF_RESOUCE in EFI shell on my machine.

Thanks,
Yasuaki Ishimatu

OK, then maybe can try to trigger gc in EFI stub before ExitBootService().

Quoted 7 lines

Another problem is what's the reasonable threshold. The threshold should bigger then 5Kbyte, then we write a dummy BootTime NV variable to trigger gc.

Thanks
Joey Lee

hm... after review your mail, if the free NVRAM space of issue machine is REALLY less then 5K even after gc. Then there have no way to write any variable unless user remove some NV variable.

Thanks
Joey Lee