From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.13209.1683098400061932344 for ; Wed, 03 May 2023 00:20:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DlwmO0Ib; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683098398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5H9zv7WZk8/LD0Hf35OhRp1LHFY/VUmF3sjBmNIOVX4=; b=DlwmO0IbGclWU0vEOvA3/erdRS/lHrAaNLKkMjRZd9VRKtv0haW8CZ2eErFVBxGGDrntYo ieSiFUU5XWA6Qih8AixwnvxZeM81+YBp6tKLxObyNPiAPOGIzjmrmFMHYwLh+Q1zVDhqee ja6IP84sdIE4aZ3SholKgVA14FTJs7A= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-171-TSdNHGyyN1Cwlt-NSuLs0w-1; Wed, 03 May 2023 03:19:57 -0400 X-MC-Unique: TSdNHGyyN1Cwlt-NSuLs0w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F01382999B28; Wed, 3 May 2023 07:19:56 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98E051121331; Wed, 3 May 2023 07:19:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DA60F180093A; Wed, 3 May 2023 09:19:54 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Oliver Steffen , Gerd Hoffmann , Pawel Polawski , Jiewen Yao , Ard Biesheuvel , Jordan Justen , Michael Brown , Laszlo Ersek Subject: [PATCH v2 1/1] OvmfPkg/NestedInterruptTplLib: replace ASSERT() with a warning logged. Date: Wed, 3 May 2023 09:19:54 +0200 Message-Id: <20230503071954.266637-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Cc: Laszlo Ersek Signed-off-by: Gerd Hoffmann --- 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