public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/1] OvmfPkg/NestedInterruptTplLib: replace ASSERT() with a warning logged.
@ 2023-05-03  7:19 Gerd Hoffmann
  2023-05-05 14:10 ` [edk2-devel] " Michael Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2023-05-03  7:19 UTC (permalink / raw)
  To: devel
  Cc: Oliver Steffen, Gerd Hoffmann, Pawel Polawski, Jiewen Yao,
	Ard Biesheuvel, Jordan Justen, Michael Brown, Laszlo Ersek

OVMF can't guarantee that the ASSERT() doesn't happen.  Misbehaving
EFI applications can trigger this.  So log a warning instead and try
to continue.

Reproducer: Fetch windows 11 22H2 iso image, boot it in qemu with OVMF.

Traced to BootServices->Stall() being called with IPL=TPL_HIGH_LEVEL
and Interrupts /enabled/ while windows is booting.

Cc: Michael Brown <mcb30@ipxe.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 OvmfPkg/Library/NestedInterruptTplLib/Tpl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/NestedInterruptTplLib/Tpl.c b/OvmfPkg/Library/NestedInterruptTplLib/Tpl.c
index e19d98878eb7..fdd7d15c4ba8 100644
--- a/OvmfPkg/Library/NestedInterruptTplLib/Tpl.c
+++ b/OvmfPkg/Library/NestedInterruptTplLib/Tpl.c
@@ -39,7 +39,9 @@ NestedInterruptRaiseTPL (
   //
   ASSERT (GetInterruptState () == FALSE);
   InterruptedTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-  ASSERT (InterruptedTPL < TPL_HIGH_LEVEL);
+  if (InterruptedTPL >= TPL_HIGH_LEVEL) {
+    DEBUG ((DEBUG_WARN, "%a: Called at IPL %d\n", __func__, InterruptedTPL));
+  }
 
   return InterruptedTPL;
 }
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-05-09 13:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03  7:19 [PATCH v2 1/1] OvmfPkg/NestedInterruptTplLib: replace ASSERT() with a warning logged Gerd Hoffmann
2023-05-05 14:10 ` [edk2-devel] " Michael Brown
2023-05-05 18:56   ` Laszlo Ersek
2023-05-05 23:27     ` Michael Brown
2023-05-05 23:57       ` Ard Biesheuvel
2023-05-08  6:45         ` Laszlo Ersek
2023-05-09  9:13           ` Ard Biesheuvel
2023-05-08  6:38       ` Laszlo Ersek
2023-05-08 21:31         ` [PATCH 0/2] OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL Michael Brown
2023-05-09  7:05           ` Gerd Hoffmann
2023-05-09  8:43           ` Laszlo Ersek
2023-05-09 12:08             ` [edk2-devel] " Michael Brown
2023-05-09 13:27               ` Laszlo Ersek
     [not found]         ` <20230508213100.3949708-1-mcb30@ipxe.org>
2023-05-08 21:31           ` [PATCH 1/2] OvmfPkg: Clarify invariants for NestedInterruptTplLib Michael Brown
2023-05-08 21:31           ` [PATCH 2/2] OvmfPkg: Relax assertion that interrupts do not occur at TPL_HIGH_LEVEL Michael Brown
2023-05-09  8:35             ` Laszlo Ersek
2023-05-09  9:42               ` Gerd Hoffmann
2023-05-09 12:04               ` [edk2-devel] " Michael Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox