Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F397CD6E60 for ; Tue, 2 Jun 2026 13:18:11 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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: 8bit X-purgate-ID: tlsNG-d62444/1780406268-AE143FF4-147A8090/0/0 X-purgate-type: clean X-purgate-size: 1374 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Ƅski Reviewed-by: Jan Beulich --- 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); - BUG_ON(!dir_handle); + if ( !dir_handle ) + blexit(L"BUG: !dir_handle in read_file()"); what = L"Open"; ret = dir_handle->Open(dir_handle, &FileHandle, name, -- 2.53.0