public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhenyu Zhang" <zhenyzha@redhat.com>
To: devel@edk2.groups.io
Cc: zhenyzha@redhat.com, ardb+tianocore@kernel.org,
	jiewen.yao@intel.com, jordan.l.justen@intel.com,
	kraxel@redhat.com, marcandre.lureau@redhat.com,
	stefanb@linux.ibm.com, anthony.perard@citrix.com, julien@xen.org,
	osteffen@redhat.com
Subject: [edk2-devel] [PATCH v3 1/1] OvmfPkg:Add variable store is full debug info
Date: Sun, 10 Sep 2023 22:46:34 -0400	[thread overview]
Message-ID: <20230911024634.3658859-1-zhenyzha@redhat.com> (raw)

From: "Zhenyu Zhang" <zhenyzha@redhat.com>

We observed that EDK2 hits an ASSERT (Out of Resources) when
booting with a full variable store. The message provided in
this case is not helpful for non-experts.
Add debug information to help users understand what caused
the assertion.

 Actual results:
 RecordVarErrorFlag (0xEF) 9A144FE2A47E:937FE521-95AE-4D1A-8929-
 48BCD90AD31A - 0x00000003 - 0x92
 CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF98

 Synchronous Exception at 0x000000023CA60374
 ......
 ASSERT_EFI_ERROR (Status = Out of Resources)
 ASSERT /builddir/build/BUILD/edk2-ba91d0292e59/OvmfPkg/Library/
 PlatformBootManagerLib/BdsPlatform.c(142): !(((INTN)(RETURN_
 STATUS)(Status)) < 0)

Cc: Oliver Steffen <osteffen@redhat.com>
Cc: Gerd Hoffmann <ghoffman@redhat.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Stefan Berger <stefanb@linux.ibm.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
Signed-off-by: Zhenyu Zhang <zhenyzha@redhat.com>
---
 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 8dc2bbf97371..fc2d64d69207 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -139,6 +139,9 @@ PlatformRegisterFvBootOption (
 
   if (OptionIndex == -1) {
     Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
+    if (Status == EFI_OUT_OF_RESOURCES) {
+      DEBUG ((DEBUG_ERROR, "ERROR: Variable store is full.\n"));
+    }
     ASSERT_EFI_ERROR (Status);
   }
 
-- 
2.39.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108474): https://edk2.groups.io/g/devel/message/108474
Mute This Topic: https://groups.io/mt/101285762/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2023-09-11  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11  2:46 Zhenyu Zhang [this message]
2023-09-13  8:53 ` [edk2-devel] [PATCH v3 1/1] OvmfPkg:Add variable store is full debug info Ard Biesheuvel
2023-09-20  8:30   ` Zhenyu Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230911024634.3658859-1-zhenyzha@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox