From patchwork Sun Mar 14 19:05:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 400110 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2861669jai; Sun, 14 Mar 2021 12:05:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmLwac9yqVnyYh+Y84j9We+iiiFW8UEsAnA0upgUsnazYAFz3fZ8AhIPcSSXq5nZGg5txN X-Received: by 2002:a17:906:bb06:: with SMTP id jz6mr19618682ejb.429.1615748756879; Sun, 14 Mar 2021 12:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615748756; cv=none; d=google.com; s=arc-20160816; b=RZufHgUqzlbBDiXqk6Vyot7jXOFzc/wzS+u6ZPdcsywtbpIrZwhHxPaURLSTFQIltj r9vU3fSUDLN4i0TGnFg+Hn/xY0uoxh2jZGPGjBIuR3sli8QJ6PKF3Sf0v9e56FrqQTac b6GStjojQxF3VYvsLOwoLZzCQNV44s3LtPSL06KaU1d2oS9+V/kx/ACCjCe41I1VggHb 6RpPKLPyg3yQg4T9HbahvzlFHf1CCwSEcd/4cRgC9BPDy7AZ+zW0/JaA/SyV91iQw9FZ w1sddSWknBHNekP93G91mO52rz/ZzwWx16No6gCcZBBIQqUPUAkFJUHxzCQCMsYFBeg9 VEJw== 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=5HIr1oyHHJHJkHWy2KCseddHs88+4bXia2/WFjbHajA=; b=Jox/QcX1fVsL21DFMK/ILDzqHPXn01iJ8mAPa5dAcrFGTWyaDk7sgVWPLwtxP/c5Ue Ehi+4E80Zb/c6sRikm2d7j5R0cnqXIlxZLqwL8dPvXz4K4265+ForGDCW4PGvXnSVcxq at2hHOjeyIXkrE7iCjqRAQfbNOvZKShAIDVWo4ZPfhKMjIS/CwIvooLSQKvzW8yLQqty TfvXVZtmDh80SK5xUd1unfgUlvF5yypvB0S8ZgkL7FiweQM3bDkzt2gG3aKbtcZH/S7w MVCOXijA2vQBehIXEhMbIRoUtIKCdvG02htt76X/itJNIp9Utpvdjznp4pu7CrekIVwM XrQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H2p8svv5; 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 y7si9260109ejm.72.2021.03.14.12.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 12:05:56 -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=pass header.i=@linaro.org header.s=google header.b=H2p8svv5; 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 0A01F82936; Sun, 14 Mar 2021 20:05:56 +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="H2p8svv5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E744B8291D; Sun, 14 Mar 2021 20:05:53 +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,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 304F782906 for ; Sun, 14 Mar 2021 20:05:45 +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-wm1-x32e.google.com with SMTP id j4-20020a05600c4104b029010c62bc1e20so18231611wmi.3 for ; Sun, 14 Mar 2021 12:05:45 -0700 (PDT) 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=5HIr1oyHHJHJkHWy2KCseddHs88+4bXia2/WFjbHajA=; b=H2p8svv5w9gFaSse4PXKDoo0i0qCuhvL/Cz1KpKzqRnGGCtm+xBVJTQnlaGwzVulYq gHBCCPoFduyMtW3jDCb4a2g5H0jlEVF2I0xEXpFJrCQxAFTJoQ56lORwMipy7qtRlFjp oiHQU3feyA/ntuDQKK6JCzVixvswFDlpDHi5A06/e2smEoEsDeOqDamZfq6EsNABgXI5 JpOsbtz1efHve3J2sR+dY9jWIMrZ4Sw5kh+Ah9CS8K6IRIZ3g5I84UqHRISnhoSHXeFG tY1Zh0ZkBYVrZsq5E6kxJftzkMJa4MP5q9H8u2g9oZiFNvDbFKv2myfauAAe3m+j/DHH dBOA== 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=5HIr1oyHHJHJkHWy2KCseddHs88+4bXia2/WFjbHajA=; b=Jy1e5V6aKIQAw6iEP0Exo/yNKKo8eq8OewEKkkf3Vv+DTXRLOLe9kMhpOcOZQHD3wh souzPXi6n/PHlAcww9zglM8Mc4ObSzI+oTs7DSFimQuvB0/KuJ+JCMijghjhcUPEKN8f LmpBTqk/dLYsygmEJGV3YnywvMsrUlEtLuQW/qL70Z92IypQhEOUTIz1QWnfAj4W0xqK /XoNliPVjA5xghkKLA+uhmLElqpzKFOXZhTwkmfI2JO9BQc5oMB/o887pwnp3P1dt5kB RW3ubrAfR8o20gHddLp7CsENovF3iSjsmg8luD28oGFQkwb2S9Y7AQNkRK4CxnohP6e+ 0oNQ== X-Gm-Message-State: AOAM531C55rUTLxrXD46/PiJvMzCDAWwAVjFTKqNnztJeiBijOHfVGtG FWlCgaGSxWhIyLAwAbIxNGNpuQ== X-Received: by 2002:a7b:c5cc:: with SMTP id n12mr22611880wmk.123.1615748744713; Sun, 14 Mar 2021 12:05:44 -0700 (PDT) Received: from localhost.localdomain (ppp-94-64-113-158.home.otenet.gr. [94.64.113.158]) by smtp.gmail.com with ESMTPSA id 3sm18718029wry.72.2021.03.14.12.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 12:05:44 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: takahiro.akashi@linaro.org, Ilias Apalodimas , Alexander Graf , Sughosh Ganu , u-boot@lists.denx.de Subject: [PATCH 0/6 v3] Loadfile2 for initrd loading Date: Sun, 14 Mar 2021 21:05:32 +0200 Message-Id: <20210314190541.129687-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.30.2 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.4 at phobos.denx.de X-Virus-Status: Clean Hi! This is v2 of [1] Changes since v2: - Lengths checks when interpreting a device path, to make sure we aren't going out of bounds - renamed efi_get_file_size -> efi_file size and moved it itn efi_file.c - Fix uninitialized variable related errors reported by Cppcheck - Fixed various error messages for easier end user readbility - renamed _efi_dp_append() -> efi_dp_append_or_concatenate() - Picked up Reviewed-by tags - Enabling the protocol by default Changes since v1: - minor coding style fixes from Heinrich - changed the DP format. Instead of VenMedia - 0x01 - initrd, we skip the 0x01 between VenMedia and the first file. - final device path is stripped in efi_get_dp_from_boot() instead of get_initrd_fp() - Fixed comments on documentation [1] https://lists.denx.de/pipermail/u-boot/2021-March/443399.html Ilias Apalodimas (6): efi_selftest: Remove loadfile2 for initrd selftests efi_loader: Add device path related functions for initrd via Boot#### efi_loader: Add helper functions for EFI efi_loader: Replace config option for initrd loading efidebug: add multiple device path instances on Boot#### doc: Update uefi documentation for initrd loading options cmd/bootefi.c | 3 + cmd/efidebug.c | 193 ++++++++++++--- doc/board/emulation/qemu_capsule_update.rst | 4 +- doc/uefi/uefi.rst | 24 +- include/efi_loader.h | 12 + lib/efi_loader/Kconfig | 17 +- lib/efi_loader/Makefile | 1 + lib/efi_loader/efi_bootmgr.c | 19 +- lib/efi_loader/efi_device_path.c | 106 ++++++++- lib/efi_loader/efi_file.c | 39 ++++ lib/efi_loader/efi_helper.c | 98 ++++++++ lib/efi_loader/efi_load_initrd.c | 202 +++++++++------- lib/efi_loader/efi_var_common.c | 33 +++ lib/efi_selftest/Makefile | 1 - lib/efi_selftest/efi_selftest_load_initrd.c | 221 ------------------ .../test_efi_capsule/test_capsule_firmware.py | 6 +- test/py/tests/test_efi_secboot/test_signed.py | 16 +- .../test_efi_secboot/test_signed_intca.py | 8 +- .../tests/test_efi_secboot/test_unsigned.py | 8 +- 19 files changed, 626 insertions(+), 385 deletions(-) create mode 100644 lib/efi_loader/efi_helper.c delete mode 100644 lib/efi_selftest/efi_selftest_load_initrd.c -- 2.30.2