Emit a DEBUG_WARN message if there is not enough flash space left to
write/update a variable. This condition is currently not logged
appropriately in all cases, given that full variable store can easily
render the system unbootable.
This new message helps identifying this condition quickly.

Launching OVMF with a full variable store then looks like this (Debug
Output):
[...]
CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60
UpdateVariable failed: Out of flash space
Select Item: 0xE
Select Item: 0x19
RecordVarErrorFlag (0xEF) Timeout:8BE4DF61-93CA-11D2-AA0D-00E098032B8C - 
0x00000007 - 0x4E
CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60
UpdateVariable failed: Out of flash space
PlatformBootManagerBeforeConsole: SetVariable(Timeout, 3): Out of Resources
RecordVarErrorFlag (0xEF) BootOrder:8BE4DF61-93CA-11D2-AA0D-00E098032B8C - 
0x00000007 - 0x52
CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60
UpdateVariable failed: Out of flash space

ASSERT_EFI_ERROR (Status = Out of Resources)
ASSERT 
/home/osteffen/work/firmware/edk2/edk2/edk2/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c(361):
 !(((INTN)(RETURN_STATUS)(Status)) < 0)


PR: https://github.com/tianocore/edk2/pull/5435

Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: Laszlo Ersek <ler...@redhat.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Rebecca Cran <rebe...@bsdio.com>
Cc: Yuwei Chen <yuwei.c...@intel.com>

Oliver Steffen (1):
  MdeModulePkg: Warn if out of flash space when writing variables

 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.44.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116322): https://edk2.groups.io/g/devel/message/116322
Mute This Topic: https://groups.io/mt/104723951/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to