From patchwork Wed Aug 20 00:40:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 49 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650491; bh=T56m8dPjTHI2bXxgdEx4pjbU4DyQ/l9rzPsqXWhHo2I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kf1NLjel6ZYRXLFjzJcEuizUMGC5ButIRl0uW20cgif1QQ0/gsZTwlezd8fx7gFoF 98Gx7YXfbzg2U7Bf8//WG1CPFswzFgGIpEHDBRr6ZxbDh/T+yzuuBy6BmREs6fyyBj UchwTvKj+06GwmnbkLF01j+ITQUrxp+00dCHn5C3946QtLosvgWViB79GLlHgWPQaH xHTdgsdL5zPZb9BLoCi5tjYSEF2mqsN4KuHFHlL9gXsJz7K84pEggwkJ4edrJgzlHG Pi6oPmQvC+TV5wPsoWg1p6DYi6+z/D3PuyqDechZqP1HiUXlSsorGdJpXqM7yDJn63 E8PFga9ofHuMA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A4C7675C0 for ; Tue, 19 Aug 2025 18:41:31 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xuE00jNEjdMN for ; Tue, 19 Aug 2025 18:41:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650489; bh=T56m8dPjTHI2bXxgdEx4pjbU4DyQ/l9rzPsqXWhHo2I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eSlFo5ipP5mX5flDd0zjve08BjhEbTpEoaXqJXuemWisjU7mo9VlrAhF5DuDfG0/L dCL8m2hDGbwB25zqawD1k3mdGoRc/UTY+ezqPItXBQyFypuAU47Bt3cI+hcs1iqe+F W7s5xRoEhNCVyQxn/SZTYT+iDwHM9EaDtknIQbkkLTqdOeUIm8A6H8Qb2x651Zf7/h xebxAzVBu140OQ67XA39gVmV6EYfYafyGT+57JggcipHOruoWH3eYK8Cl9r4/5g2jQ fvnZi4Ld5NBwQY2ur140N6BSA4zNRsxe/aS1bCPvNoaITA13JD32CfceBS1voyU27T yF+qX4d4okCyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 506496765F for ; Tue, 19 Aug 2025 18:41:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650486; bh=QarTifUHaafadFLq2e4UuMX1IlBYWnwQbQMkykCxGjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8XN+w8An4OjZ9Tw3mLw+W2RgwLyV0yjxn31vOdw7lnBBto0GjPEw5EgsZuui1bei IWTd8I78OmZgXURFtrHEBE+Y4Bmjx0lgDrg+AhcSLqkWNxGGM4cG7FXRyNOsXPbF0U eNgHoJ/8OalkKAB4ZV0i4sE3dmN4f6eTN4t3KGcB2qndznPi0fTPLY2+qUCRVPYgZK DhbeosIJpg91dVU/6en2dUfb5sZLN08TF4PvsqzoiCheS9KW1EUtoomcFM03vZvmZv IvQHsf1dY1Qh5JQg0Fa6vQrUjW+ejH5IkFq2lLXG4uz/rluSnOd+Atd7WDNH8wLfgs 9tO4YjAO8FBVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69F636728E; Tue, 19 Aug 2025 18:41:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id plFofeU37zYR; Tue, 19 Aug 2025 18:41:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650484; bh=U5bI96oGa2TXkNTpHiVr+nr0r3RWYoUlEShzoksTbnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cpev9YuBwAIaTf7bL64rZ5PPzR4m9LyXzpsdQfmdyRDOsrq05yg5B0GC7+0bMHPYt ELRQgsOo0gMJHTYEIbsym1mEX3YC8LyayjbEdUBbE5Gzvm7d0QfBiMEhsOyNUI/bKT rkU5UlWcpzju9uMxHd/bsWVym7/vCn2qGMDbr8LNgfKGGo7/A9XQ/NmzEB1MauuGHG niGm6JdSdXP9eCIs39zu+PBpa5XN/ned4ARIRM51jOfTSFU5RhRQxkrhhXsEPxErJk X/qbc46PW9lnftH5gJO5lRXYsjQvru6/N1xi45r1gQ5VKIS8CDOUtkqC5vv/52a1+q TZmMAWsCR4dVQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9319B675DE; Tue, 19 Aug 2025 18:41:24 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:25 -0600 Message-ID: <20250820004039.3920254-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820004039.3920254-1-sjg@u-boot.org> References: <20250820004039.3920254-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MV4OFIC22B34NUBY5TOG5P3WZG2FBQNX X-Message-ID-Hash: MV4OFIC22B34NUBY5TOG5P3WZG2FBQNX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/18] efi: app: Implement efidebug boot dump List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Seeing the boot order is useful in the app. Everything we need is present except an implementation of efi_query_variable_info_int(), so add that and enable 'efidebug boot dump'. Signed-off-by: Simon Glass --- cmd/efidebug.c | 6 ------ lib/efi_client/efi_vars.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 2f1fecf494a..a48e0de1208 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1234,9 +1234,6 @@ static int do_efi_boot_dump(struct cmd_tbl *cmdtp, int flag, efi_guid_t guid; efi_status_t ret; - if (app_not_supported("boot dump")) - return CMD_RET_FAILURE; - if (argc > 1) return CMD_RET_USAGE; @@ -1615,9 +1612,6 @@ static int do_efi_query_info(struct cmd_tbl *cmdtp, int flag, u64 max_variable_size; int i; - if (app_not_supported("query")) - return CMD_RET_FAILURE; - for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-bs")) attr |= EFI_VARIABLE_BOOTSERVICE_ACCESS; diff --git a/lib/efi_client/efi_vars.c b/lib/efi_client/efi_vars.c index e652ee3f243..4fc48b90d6c 100644 --- a/lib/efi_client/efi_vars.c +++ b/lib/efi_client/efi_vars.c @@ -39,3 +39,17 @@ efi_status_t efi_get_next_variable_name_int(efi_uintn_t *variable_name_size, return run->get_next_variable_name(variable_name_size, variable_name, vendor); } + +efi_status_t efi_query_variable_info_int(u32 attributes, + u64 *maximum_variable_storage_size, + u64 *remaining_variable_storage_size, + u64 *maximum_variable_size) +{ + struct efi_runtime_services *run = efi_get_run(); + + return run->query_variable_info(attributes, + maximum_variable_storage_size, + remaining_variable_storage_size, + maximum_variable_size); +} +