From patchwork Thu Apr 24 20:19:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ying-Chun Liu \(PaulLiu\)" X-Patchwork-Id: 883960 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp3631397wrs; Thu, 24 Apr 2025 13:20:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlI2RMHNM+/BmuETUaahb7oMevigWibVjfJfSFv4IYl50kVA79CATJXZsNBwUg0aLFN04SFA==@linaro.org X-Google-Smtp-Source: AGHT+IHBczuX/G36nhdKipE93eQUdPuENQ4RRd6VzXOIJmVDKKsiKVBS8CI7+54i1CNvtqKw27ao X-Received: by 2002:a05:6000:1ace:b0:390:fe8b:f442 with SMTP id ffacd0b85a97d-3a072bfab3fmr580489f8f.54.1745526000252; Thu, 24 Apr 2025 13:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745526000; cv=none; d=google.com; s=arc-20240605; b=K8MEXk9ZtprRu7Q1fiD9kseT6uwkgj4KvbNxpSPMaUyOhwwHi9Ehz4v26nSLfA267e VVXAW7BRmeHqBRKD5GjRH5UYnwxpp5qihC+lX4ay8fAIrnHUsocOxSL9/UQZFLKh+Err NDbdHN2874R3E4ehWDLbJC2EFuDBsinfsii5Kn4Yp8tIjxdBjF8JqDHFo7y60PeDLBtR N4RXgfEq+yhQKAa2M5tUYn9kkwUXZ1vHdRmyIp3UKACjneacYPJgPv4bQH0krnMLD/rZ 0dWCbb4JE0Z8u4bSKcmyg7ktzn3iAfWGsKW3V/akEoTT2BKP6CN0PIBQiXdg64/QATlZ xqvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jSX/9sQGbKqDWDDqeHEWYA9ns/DUT3sg+GNNs1iBoWM=; fh=yXVQQdlQRM26TTYMoA2yrv//F921MlR4o2VBZ4jl39k=; b=VHwdfZ+qAxKfIQk9K2SmhVTlgCsxY6RW27sb1GKiUmF32S5DWpJ/ePjD/2Q+IZ2sVI SdP1bpJWxLQ4L//GBgjyBI7soJns3Mub6hQS/0PQmOVAX33w03B5k6UM5eifhSFEUqb5 wj6Yob/XDUANysl2vBj+UNRqzg3yy+HYiN62LI8H0Xp4jJw6td5K+in0b7OrxIV27Shp UQ2B5rMFomnm6ToEpLv9A+whSmOkEcHFFU+8f3PRZpmLFMr3yLCEIoH6URz1uL1pK6+w aLvck4lB9leMU1un6o2kvW9jyvGZgZessIvatFL03I57kvidWOol7Bi1l6iCLBM9V+f3 8hWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b="c/nfdVzH"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dara=fail header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ffacd0b85a97d-3a073e5634asi122960f8f.491.2025.04.24.13.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 13:20:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b="c/nfdVzH"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dara=fail header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB14282064; Thu, 24 Apr 2025 22:19:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c/nfdVzH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2EC281E25; Thu, 24 Apr 2025 22:19:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 425EC8056A for ; Thu, 24 Apr 2025 22:19:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=grandpaul@gmail.com Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-306b6ae4fb3so1614702a91.1 for ; Thu, 24 Apr 2025 13:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745525982; x=1746130782; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=jSX/9sQGbKqDWDDqeHEWYA9ns/DUT3sg+GNNs1iBoWM=; b=c/nfdVzHr1oHWlrQ9RkLKcztY0wu0WzfEk1y6j843mQ5ICxwu7ZpllFD1qowTvw0Sc A3fF/i/aClQHgUU4VCURIw17ewYGsuVMrkVFLZ6grBN59RjEfizC5TJs+ryrVmbK/E9I kE2LWZzg35xrOd1Itz+PujMpxwYV+6P/JmOQ+j1UtkZyGznGAbXV2PRFPh0h1/dBoA3S tZxl184LuGMuapFjlYbF6Ae/YhjEW32H5Blujjwud5ZOCdOVxJ4xVfx3CtUCQMyHpUKc ozmkRYzCWJhlz3vCMosjKI3egEwuzJvYB3A0C8Fewx+jPf0Vafp6EO4hXqUhq6TD44u+ k6JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745525982; x=1746130782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jSX/9sQGbKqDWDDqeHEWYA9ns/DUT3sg+GNNs1iBoWM=; b=r6lNujCoyQjOvW3IgVShnUo5gIbd1err+WPvWTTaB8LyzVuZ4/GxQyRe/m8H+VbyRp +0fyHnM5lxzDWtjES0YK6UmFWdic12w8+u/tpk4yAFYBZxgUi2C2mxZMvDawkjjF44fe Ucxyw/MWWRAMI7MTG19eoLotDUqQXgJM9L9fBF8JRmela0Yry6frjcDGg6BuAy2xvoL8 GvN6aPB8xh7KiJGoum+XdXP8ycpld78wJI9r+ndeb1kvwmXpO2AP5PXGaKi1a4aC+Oli X9yPs+ehxbL4SlBnCtD/DR61QR8JanJdDZ5FDxcM9Oj4TpyTHmhoHgq5tkCrv/P1V6Ic 4CnA== X-Gm-Message-State: AOJu0YxpHAI9aiDSQrh4DphAEQ6yy8VyC1d0MIZp0BMziD02OPiHP2yD O9se6OyWCJWZYvNIcZ5k88La9B1ssrZy2YcJdUNGSyx4ZyDfxDMdRRwuqA== X-Gm-Gg: ASbGnctIhXsvfefFN41oHEVYTQ/IuHTasi8c+sMhYjnzicBwT/tLktp78J5kAbd75bl PJAI9Z+0CGHfbUtWSx3j3gE3nHQCtQR543jgAD/PyG44zPlPo5p13dubX99I4eU2kAkVQvVzAYr OlzRsA7dI2YIgc8+veI+soStRlRkikE4A+Y7HjZUMKyovVZsB0wTBEyu6BA174ZfmGfT0wCZmnN 2ySegvvl8QxxRx2w9+9l7k7wcpxLax3OuBV8s0EuqTCIDHVIDFHvJAtmaEtyU6a6Sw+rjFPMIQU 6B+NBvfzdmoKGy/yetgCgPp7j7Ic/dJk3SXv X-Received: by 2002:a17:90b:3851:b0:2ff:58b8:5c46 with SMTP id 98e67ed59e1d1-309f5534319mr1385606a91.8.1745525981643; Thu, 24 Apr 2025 13:19:41 -0700 (PDT) Received: from localhost ([61.71.79.124]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-309f7754d52sm39217a91.19.2025.04.24.13.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 13:19:41 -0700 (PDT) From: "Ying-Chun Liu (PaulLiu)" To: u-boot@lists.denx.de Cc: "Ying-Chun Liu (PaulLiu)" , Heinrich Schuchardt , Ilias Apalodimas Subject: [PATCH v2 2/3] efi: add EFI_DEBUG_IMAGE_INFO_TABLE for debug Date: Fri, 25 Apr 2025 04:19:25 +0800 Message-ID: <20250424201927.2027257-3-paulliu@debian.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250424201927.2027257-1-paulliu@debian.org> References: <20250424201927.2027257-1-paulliu@debian.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: "Ying-Chun Liu (PaulLiu)" EFI_DEBUG_IMAGE_INFO_TABLE is used to store EFI_LOADED_IMAGE for debug purpose. This commit adds the table to the EFI_CONFIGURATION_TABLE. This feature is described in UEFI Spec version 2.10. Section 18.4. Signed-off-by: Ying-Chun Liu (PaulLiu) Cc: Heinrich Schuchardt Cc: Ilias Apalodimas --- include/efi_api.h | 24 ++++++++++++++++++++++++ lib/efi_loader/efi_boottime.c | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/include/efi_api.h b/include/efi_api.h index 5017d9037cd..0f4245091f1 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -238,6 +238,10 @@ enum efi_reset_type { EFI_GUID(0xcce33c35, 0x74ac, 0x4087, 0xbc, 0xe7, \ 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27) +#define EFI_DEBUG_IMAGE_INFO_TABLE_GUID \ + EFI_GUID(0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, \ + 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b) + struct efi_conformance_profiles_table { u16 version; u16 number_of_profiles; @@ -564,6 +568,26 @@ struct efi_loaded_image { efi_status_t (EFIAPI *unload)(efi_handle_t image_handle); }; +#define EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS 0x01 +#define EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED 0x02 + +struct efi_debug_image_info_normal { + u32 image_info_type; + struct efi_loaded_image *loaded_image_protocol_instance; + efi_handle_t image_handle; +}; + +union efi_debug_image_info { + u32 *image_info_type; + struct efi_debug_image_info_normal *normal_image; +}; + +struct efi_debug_image_info_table_header { + volatile u32 update_status; + u32 table_size; + union efi_debug_image_info *efi_debug_image_info_table; +}; + #define EFI_DEVICE_PATH_PROTOCOL_GUID \ EFI_GUID(0x09576e91, 0x6d3f, 0x11d2, \ 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 366bc0d2b1d..e2665459e44 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -4038,6 +4038,16 @@ efi_status_t efi_initialize_system_table(void) return ret; } +struct efi_debug_image_info_table_header __efi_runtime_data +efi_m_debug_info_table_header = { + 0, + 0, + NULL +}; + +const efi_guid_t efi_debug_image_info_table_guid = + EFI_DEBUG_IMAGE_INFO_TABLE_GUID; + /** * efi_initialize_system_table() - Initialize system table * @@ -4053,6 +4063,8 @@ efi_status_t efi_initialize_system_table_pointer(void) u64 addr; u64 aligned_addr; u32 crc32_value; + efi_guid_t debug_image_info_table_guid = + efi_debug_image_info_table_guid; /* Allocate configuration table array */ ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, @@ -4077,5 +4089,9 @@ efi_status_t efi_initialize_system_table_pointer(void) (const unsigned char *)systab_pointer, sizeof(struct efi_system_table_pointer)); systab_pointer->crc32 = crc32_value; + + ret = efi_install_configuration_table(&debug_image_info_table_guid, + &efi_m_debug_info_table_header); + return ret; }