From patchwork Wed Jan 13 11:11:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 362076 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp427633jap; Wed, 13 Jan 2021 03:12:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPVwRqP1sfuytHkCzKq5Ln0CC0zolB3R6AICeMm0EdKGW3y7hQMzgC3vNy0tzi3ClAfRNC X-Received: by 2002:aa7:d915:: with SMTP id a21mr1313221edr.251.1610536326447; Wed, 13 Jan 2021 03:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610536326; cv=none; d=google.com; s=arc-20160816; b=TLfn/YsQwQ7x9/mFeikKim93FmUiNWH74t7HbUjA6lGlbPFUpsDYqNNOKZY6vvBWc/ zihspHE9AJ4AlkCGkrsC/dMEKGnY13B4Iu0RUfBKBtG1TZCCDLUdZMs0wSugLSq7pCC9 8SIBTvJQEpXXBjVs6z0KsJG4JgHNgV8VI9Y1l9bxG4uKPiMNxNDIAtFZeFhFUBia0D4G secWHo/8Y7g4slpRQodjKjBaox6jv0Du2K7VT99vT8hElFjkcN7oDr1x8O5qz/G96H7I m83fc6Ca84WTIHsfElAnoI+jnLwIQhBt1QzbmqE3GXupolRu/WAlETzdlEJvC3wUrp7j Sugg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Wp45vpaN0pa3O5GeZttcqmxv8bUm9OYik8r1JeGHXDg=; b=Z18q4RWzDAgQdYI4iOVtvLHy5MNznZiG42n1GuvWWw+5RwrfUsadUictq22BnNZfbo ec5+AESyLaOf8ae5RA34CuQCnvU+r6sfCQto4vwlacOoU3gAOwZcrziy7j1+AJI0ThMv PHhzv9N4MvFQ7j7OgmX8kBcU7DsPWT62BgZpbOWG1LZn8LxteX1loS+NoZ3qMN+sRx4z y6BjlgudAwNJxozoISuRU8stkHXYt1WI1zTSDXYUtHvRLika6EFQc/mefF23JuAjqATI 0zGSVCj4w4Bl4MXhTgtMSMg9msmVckbSqWjmDKqATp3/HMxDJhxzq0CC/MtCFn7oNnFm 1rjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e/RyYYcX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 h15si768654ejq.383.2021.01.13.03.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 03:12:06 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="e/RyYYcX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37B80825F1; Wed, 13 Jan 2021 12:12:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="e/RyYYcX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D5348261E; Wed, 13 Jan 2021 12:11:56 +0100 (CET) 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_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 AA4718250D for ; Wed, 13 Jan 2021 12:11:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wr1-x42b.google.com with SMTP id q18so1694195wrn.1 for ; Wed, 13 Jan 2021 03:11:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Wp45vpaN0pa3O5GeZttcqmxv8bUm9OYik8r1JeGHXDg=; b=e/RyYYcXya5HpbCEW9L1zvaubF0jTTUscN47kU525iKVIHb3swWEVbtHlzt46cv99R dJCq016+cl2UdBC02qjXcqNQCyfIE8lT3Is7uJIZPVSCO7RGOGfwirK9L3t9MeSoSJKs bvIp8dOStAAF6ae/TUpFTYCAo2BRRe9dDKJN7sYsT79g99XRp2O4qDOa2NLip/zwgiCH jLotXo16OjW30rOZpV65UFMPbXG6g3uMJIYL8YD0u4tBb7wG5h+LbJvPCypxqactuNA5 eKcKW2h1E2DvlydEKOg62LtMVVPqpLEASs1T0v3kxMKy0qNQvr+NJAcbj8P2XJvMP8D4 GIvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Wp45vpaN0pa3O5GeZttcqmxv8bUm9OYik8r1JeGHXDg=; b=lPYHw9X5HQXAoB9JNKoUD5SUETonOoQlKOOU/J1FPSknRuFsZACIYqCrICDOFMKQYW RjgpBs8Ul2+7vD9M1Fs50Fso6ujjjZsQ1Fi71zwB9ZsF/L7WeyCy7HJvHgc40ackH7Nq yOT0UsQBDzqEkTznZ1Xc4/so05m8Yud+nxYG78nzYb5Y+nbbBiQNazZ3NMw4BsGJt58e BqqINroTmwXKz9WFmDr5LBMjikyvHfL73KXk/1dbKaf08FXiVh7ymPgH5YC2dGfpikd3 VZjoVBnsxgYnJDnj1dxa53RfB5+SLNolfAA0LUPfufy2iLbU9pqsHV/Aby9ePw6kFZ1s 7C7A== X-Gm-Message-State: AOAM530WHHZarUJsaG1MGnNPHgQgr+Z7/8SFAhxdFjAVYAzwgJHRuytA +ZCdOaE55780VloGret55/rpkQ== X-Received: by 2002:a05:6000:185:: with SMTP id p5mr1991614wrx.403.1610536312234; Wed, 13 Jan 2021 03:11:52 -0800 (PST) Received: from apalos.home ([2a02:587:4667:3e9:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id r2sm2589869wrn.83.2021.01.13.03.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 03:11:51 -0800 (PST) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: takahiro.akashi@linaro.org, Ilias Apalodimas , Alexander Graf , u-boot@lists.denx.de Subject: [RFC 0/3] Change logic of EFI LoadFile2 protocol for initrd loading Date: Wed, 13 Jan 2021 13:11:46 +0200 Message-Id: <20210113111149.64567-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.30.0.rc2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Hi, This is the revised version of [1]. After the discussion we had with Akashi and Heinrich, storing a device path in the variable is preferable to a custom U-Boot string. In hindsight and after reading the EFI spec a bit further, using a custom EFI variable to hold that device path doesn't look great either, we can do better than that. Turns out we can use the array of device paths defined in the EFI spec and store OS specific device paths [2]. So I converted this to an RFC instead, exploring this idea. The variabale is now stored as the second array member in the EFI_LOAD_OPTIONS and later retrieved in order to load the file when the kernel requests it. Another big change is that installing the EFI protocol itself will cause an error if the file's not found and the bootmgr will fallback to other valid boot options. The efi selftest for the load option itself is not included in the RFC. I'll go ahead and change it if there's general agreement on the feature. [1] https://lists.denx.de/pipermail/u-boot/2020-December/436080.html [2] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf section 3.1.3 Ilias Apalodimas (3): efi_loader: Introduce helper functions for EFI efi_loader: efi_loader: Replace config option for initrd loading efidebug: add multiple device path instances on Boot#### cmd/bootefi.c | 3 + cmd/efidebug.c | 89 ++++++++++++++++-- include/efi_helper.h | 23 +++++ include/efi_loader.h | 1 + lib/efi_loader/Kconfig | 13 +-- lib/efi_loader/efi_bootmgr.c | 3 + lib/efi_loader/efi_helper.c | 146 +++++++++++++++++++++++++++++ lib/efi_loader/efi_load_initrd.c | 154 ++++++++++++++++--------------- 8 files changed, 341 insertions(+), 91 deletions(-) create mode 100644 include/efi_helper.h create mode 100644 lib/efi_loader/efi_helper.c -- 2.30.0.rc2