From patchwork Wed Aug 20 11:23:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 67 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=1755689065; bh=UvgdkXDtK725nkYW5EFcEPnbYgA/jx+zHN/EdhlBlO8=; 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=pyrX9uHaaCwW8j7nMsclxEt8GcwhT8ti4ubaor+KwRrhHbfSslb/eNEIdbZB0Ibu8 rdBPWSyBUfDhtAF9P7fqqR0Nn+GOLQeQNQfipVSFX5ExcQSDGulbxb+DFiVNqpR/Xj EP6ye5VXk7T8Mcezz1zHEQEYqMF8U5tXhG6EX9bc9fDLHXfZpkf4keNGlqqAh3Mzar UL7GJ77n+MEjSvjfjHSkgJlE5T4X8/9FpgF7gFblgi0W2MRm3X6dIYZG29ndBJJIhF VSrvlKrBMmRYMSfwjB9lc/kZYuoM8dxhy4EFmcimNdsxLS1fNhp0f3hTnGtcgrLDx6 uelsmCiKm0Bdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 17AE86767C for ; Wed, 20 Aug 2025 05:24:25 -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 1TeHyDmYwWhy for ; Wed, 20 Aug 2025 05:24:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689062; bh=UvgdkXDtK725nkYW5EFcEPnbYgA/jx+zHN/EdhlBlO8=; 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=O2Op7Lze81Gd/HNlAFoJgJY1NEP3Ew5IstZKDVBCJkaoWvRzXI+b5oKQHg8wBkPz3 byy6+oaKS15ptempPanDcsJPDMmpqAQgcIgKBsdO2At7sE2oiLqDHFS0lUTLnlbNkc krIuG8Lfq1jQmDiMDLhf/Qlvi6RMySbJ8MLjI3WeoISO8a/ESMhIM+ZaeQ0N/AKJ3q za7UOyZYohOQkr68/DBlj+uq6V++NSDkDHwVPzlh0lVjTZAVH1ivW7hqT5UzhEOivc bzeerphh01BsRuEUIw0cNZnC+zq/FJ+zJKcszq8nJPOfNN+N4yzOj7ACHKYHcq3/QR LJzF/doEEEmlA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8B9B674FA for ; Wed, 20 Aug 2025 05:24:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=NuOVz7kt46eHehj46JN7w+KN4Gq6ocX2OlP86Ubqy5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=prdQdz5WXRWVbvpqgyh6XI0A1XMITMQzEB+inst51OqM5gDa7BBqr/cI9ySv7kGmr w+CdCPkC+pjfNkH6G4SKqCw4lYPY5BqkvjUAMkd7eXrI5FzJYIy80xkj7g7cbQf/fN kr31n4dp9Jmhc5sXrvpdz2wxOlsiMLEHbNmO2mNIf7CKyIdqCra1ufBLMQBBuV6cP+ g9yhXktndk2zWOo0g5MHqknEtrq7x9ccbAOzLi30MzGfZEyySKmD669F+Fu+lbnYO7 lM9GYyE15sFzhAq596r5vAw/ACnvg8UwBf/zy90/zAPH+AP+2g2MNTH7kZse0uvNdT smtJ7BzLv3WyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BACB167691; Wed, 20 Aug 2025 05:24:18 -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 hEBftxqbUfdq; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689054; bh=V/F5RunSfn3AEg0CmzgSgG6SmIw9fwVbxMXg1psos2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fab7O4Z162lIMKYKDDcVTS0v1tZeP1889Qr3+JMpXSrJqsZcnjEQDNHIbbHVUz3fs YNsgjnm7KQFlAA0b4JO1KDyxwlmBO+tey0RJfV0DAxV0m+hPjeLgHpddMbCxKzmCrN zrHJKutIztHSXOqptZ3Eqtt1yNd4K7WWKHdMSG6u1pUQ4sEG57j8giV4tnENC5hiWM 3MAyqjPy47ATyhZiQRAczXSjqshKsZZNfsQECm7kVwXm5CnCB5W/iNy4e1qFU1gjPL 22JJGbzS9ax72oM1hVRn+uz/xu9oBpXEV3ltJfQ1qvuwwojkupBcoIgHQN27rL1xLn yoBNyIV/kqx1w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1D9A16767E; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:23 -0600 Message-ID: <20250820112340.147082-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6XUHLBKKOMJJ3IVVDJLWY3AWWV4PLEK3 X-Message-ID-Hash: 6XUHLBKKOMJJ3IVVDJLWY3AWWV4PLEK3 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 v2 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 --- (no changes since v1) 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); +} +