From nobody Mon Jun 8 04:26:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=invisiblethingslab.com ARC-Seal: i=1; a=rsa-sha256; t=1780406299; cv=none; d=zohomail.com; s=zohoarc; b=Z/IuQcN6urqHqpvOKZ8V/uxnupk9AVeHnrTZ4DA0o6oAoLbd5lB48oWFGO4xuX850OBoAfTZ1JTITBqHXfB+r1tRsVXcNjDcnVHtvM67M78aJwJqWLF/6HnFcwJa8cXOBC87B/XQK0ro8accM7CZClv+djh+h1IYIDqAnY5pgV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1780406299; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Odw3uM7GYkxyQ4rOzkRBdHo22ydzgt+9ApdUBTxVZ7Y=; b=CKph3ZEPHczYq0cIJ+iQffuzPEN2APM+EV9o4FDHbuHdxf7IDSFQoxJumKNe7HetGTymDLUPVGwGyrJhs8FjLM01CppYRfLYr0vjrdq5ViBLGynQJv26P6XZ58BfuV/A7lokTCc5CgRJWUlHOUqCIQfSxz4waVZN07nvtaXnYqs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 178040629898125.63839821385693; Tue, 2 Jun 2026 06:18:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1325024.1590536 (Exim 4.92) (envelope-from ) id 1wUP0A-0007gH-Gs; Tue, 02 Jun 2026 13:17:50 +0000 Received: by outflank-mailman (output) from mailman id 1325024.1590536; Tue, 02 Jun 2026 13:17:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUP0A-0007gA-E3; Tue, 02 Jun 2026 13:17:50 +0000 Received: by outflank-mailman (input) for mailman id 1325024; Tue, 02 Jun 2026 13:17:50 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUP09-0007ef-WB for xen-devel@lists.xenproject.org; Tue, 02 Jun 2026 13:17:50 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wUP08-00CFkQ-N9 for xen-devel@lists.xenproject.org; Tue, 02 Jun 2026 15:17:48 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a1ed7f5-bab6-0a2a0a5309dd-0a2a4501bed2-20 for ; Tue, 02 Jun 2026 15:17:48 +0200 Received: from [103.168.172.145] (helo=fout-a2-smtp.messagingengine.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a1ed7fb-c1f2-0a2a45010019-67a8ac91cfd1-3 for ; Tue, 02 Jun 2026 15:17:48 +0200 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id EEE92EC06F6; Tue, 2 Jun 2026 09:17:46 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 02 Jun 2026 09:17:46 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Jun 2026 09:17:45 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm3 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm1 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1780406266; x=1780492666; bh=Odw3uM7GYkxyQ4rOzkRBdHo22ydzgt+9 ApdUBTxVZ7Y=; b=vDnbliDAZ5CxKaktiZ7OlI5ZJqU9EtfAbGA6Z47kbREF/3nB NzgMB2QvO5lKDeDapwoCPl95cD2DNjjrZKYI9PqNXgu2i69Nyen5u4hAFgLtbEEG 9mRES7NjuuaeSzEMJ9uLGdiDEKPNRQFgHMzhLRDn43ns/9nJiyAMHGofNhHr99KN u+y+xfQI0V0lVHvIDSWHkaLsmGUGy5gGo0x8hSBfb9h1O7faEr6Qk+aelMWK0Xh0 ISAQH4a6X16GC+ruI+8CFaVxDr9mvyE9OHkj002xQPnNEqpxYw+v8fQZ4uYqVlnW NUNJcjajfoMbw3GEnG+N+648jCJ16GRpUDTY+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1780406266; x=1780492666; bh=Odw3uM7GYkxyQ4rOzkRBdHo22ydz gt+9ApdUBTxVZ7Y=; b=A71/whzQau3O60huSLq0Dkyn1dve4y2kEpfVveQmA2sD Z1YEOAtU8eBXx5qUM+FA/faZXrnxddRPbRpa28ZkMf+EWnEztFQfh2opTmDMiB5t HNIq0/dxhTl0PmuWAAma60fj9rlNAYCUhY3mc0XXVQVREaTm6GUJFQSInWskgldz Iv9ibXPxcMa7hFOpYFrKPRaogd5Soy+OKMCR+07VzocyCOMUeqUrvFjm6tpjKAP4 OSFvDGTC2og0mHunmgtctexwDLTjJ8+gLFJKc+SQEpxYF/yl1hkuL0gv6EnF4ArO Z5NLQe+rsyVVL5rFv6wKrqR2hy3XnVb2ewGqGLtWiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFQQIErjjn5Oc2MgxZTxaZ0BgRfkzV9Qce6STntFPkc2OuoG8jBX1tCUSyR0jlsj+ OrqDGIWGuMnTlVDRtsyJXZm99W6F/ZlKUCCNbjPnXmkuGUCzRXP2hLFxKw59WZqJtdgMV4 KvThuk45hqVnZaLl/UEgGxjcUUXP0uM4Iwr9H2akbjYqfZMgL44mF1U0wpbGVBDjVP6OUT VZIqbbrNmE72snbWE4/2MJZvdxfbK5nzYOs8brIbjHrz5pxmaOIzqdswSElgASMbYfmEy9 ycZm1GaR/QAE9FOf6z3tMhoX70IB97HwC/MhAbwV4wfOkGxzk49mOqdn1gqCORM5yL0FIo fj8INK2fvhePanly564/lUausJNWKhasRX9W42xRuiP/xjta87IOPFw91QXET8/7z9u/8O RCJEr2+5+b8TzW28Y0Ex4jGEBqij3M8KLsYmjE5wMXYW64/d0K7CrGtvAkEsZdJFtUN4ug xq2++FjVWJ+X7cY7w46IYHHFwKyfkL+ZiamI6KNuCiTzCnjjfLwJ5uWySXDK6R4Lz6aQxU OtnqX3zIrwEbQO4gkqS0U+h6+UUn+oF0txX+fkTH6dxBbVb37eyTAxgYRy0irykDM2KTqx tLxBcGy9mIMlRPie35QF3jsa7D/bq5mDcTLonhW7EF335NH2E3MxnLugu6eA X-ME-Proxy: Feedback-ID: i792e4853:Fastmail From: =?UTF-8?q?Szymon=20Aceda=C5=84ski?= To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , =?UTF-8?q?Szymon=20Aceda=C5=84ski?= , Jan Beulich , "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [PATCH v2] xen/efi: Use blexit() instead of BUG_ON() in read_file() Date: Tue, 2 Jun 2026 15:17:37 +0200 Message-ID: <20260602131737.2983084-1-accek@invisiblethingslab.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-d62444/1780406268-AE143FF4-147A8090/0/0 X-purgate-type: clean X-purgate-size: 1374 X-ZohoMail-DKIM: pass (identity @invisiblethingslab.com) X-ZM-MESSAGEID: 1780406302312158500 Follow-up to 880e40b187aa, which added a BUG_ON() guard in read_file(). But as Jan pointed out, before ExitBootServices BUG_ON() is not functional. It results in a hang with no message. On the other hand blexit() prints a message and returns back to the bootloader. Fixes: 880e40b187aa ("xen/efi: Fix boot from a device without a file system= ") Reported-by: Jan Beulich Signed-off-by: Szymon Aceda=C5=84ski Reviewed-by: Jan Beulich Acked-by: Marek Marczykowski-G=C3=B3recki --- Changes in v2: - Drop the Link: tag; use Reported-by: and Fixes: instead. (Jan) blexit() has been chosen over PrintErrMesg(), as the latter is predominantly used in cases where an EFI call fails (and it prints the status). xen/common/efi/boot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 2971ea8696d1..8f24df9bc23a 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -849,7 +849,8 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle= , CHAR16 *name, if ( !name ) PrintErrMesg(L"No filename", EFI_OUT_OF_RESOURCES); =20 - BUG_ON(!dir_handle); + if ( !dir_handle ) + blexit(L"BUG: !dir_handle in read_file()"); =20 what =3D L"Open"; ret =3D dir_handle->Open(dir_handle, &FileHandle, name, --=20 2.53.0