From patchwork Fri Jul 7 04:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 700012 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3663325wrs; Thu, 6 Jul 2023 21:01:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrHhfPyMrmkU6cSRcgHgoxkHh2YY4JEnmRxpdcviP2c5yY+95F98QeSAY1SZf6Y/7wKO5f X-Received: by 2002:a92:d5d2:0:b0:345:d583:5c64 with SMTP id d18-20020a92d5d2000000b00345d5835c64mr3651957ilq.24.1688702495034; Thu, 06 Jul 2023 21:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688702495; cv=none; d=google.com; s=arc-20160816; b=TuB7hfF828T1yci2yzG8gn606aXUndYixeo3Pfdbjx8F3tajQFlVlk/IEAFoA6233P p5SDVOGuzqIBFW64tTYLa0PJ6oVrre7Uc4zcPsQrZiql89CPXaCfCUUPlbOjWQ/bpLk/ Nj/7WhqwzydUe9v+snoXBFGPxtk441M51xWPOK6xw6UyaArjt5Nl7C/TJTjaTGkDctx/ 4FP10dtoq+3Sj6p5eQq+OlRsgHpsSgZhNCJFiKPdNaBStBQsHnCsNcO1D7MmSY1LpnTe RLyrBGwzZkRE2bqDXLvdKtc8qpAOP+uHAtYxjpp/MdVr/7CyvYOO+ZhcTY+kLEzi0DEX OMzw== 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=oTRfHBsFGfAZ97A0BSfeTr2afcEqKG6usDfs5C48kbE=; fh=UqK/4Wc1IgH8GVyLylIZPdO/qWI3a/IzA+fwLs4tfXk=; b=nwr8tUHhdriHCMY0G1qvtOCypZ83dk0Xv3gX6eLDWcsbQPohG304BKrlp+pyp5p/Uq ngPSMQWVqSJ8p1dYc0zgKD7+DeMmyRp2PSS8R7ORSX6NtbTIdUMBkOKErew3iHVTJhFa bO6oqgvwg4M3ipVMEDlbrDTXx4ird32LJ1/zMQjhXrFmaKY3tZmwW0rhyeDYMYwQTfq7 tVsDEt5IpHG8hRWjQPYiq5gtfJopwj3ynYh1ofzuzDG8Y+/q6kKypeSvvT7SjJlw2Q/A QrGws0NTUz7WWQBebSbY98iIW77z//9kPycqXRBI+qw2aI4/t/ncX11ng3KoYVwzUom/ XhCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YYOhy6iM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id o18-20020a92d4d2000000b003462564a557si1160060ilm.26.2023.07.06.21.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 21:01:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YYOhy6iM; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 047B1863B8; Fri, 7 Jul 2023 06:01:32 +0200 (CEST) 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="YYOhy6iM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD037863BA; Fri, 7 Jul 2023 06:01:30 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LOTS_OF_MONEY,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (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 D9424863B2 for ; Fri, 7 Jul 2023 06:01:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-668730696a4so908334b3a.1 for ; Thu, 06 Jul 2023 21:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688702486; x=1691294486; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oTRfHBsFGfAZ97A0BSfeTr2afcEqKG6usDfs5C48kbE=; b=YYOhy6iMsjd+pw75FAL4QvX05TaES2uyfFwbl0xdrrFK6SaIuBGmoSGfjf4TwsUStz 3GapdvcQAzBLu4qAIzdrQY4OS2/OTTUMyFDTwUrUN4w83zYI1E6ffjt8UoKSLcWUUIUg NxI+f1nQ4Hrr50K6CuYBUssi4wC6I7/3H0Z6VQv9xgH22YzuvX/oY9q9r2MCAE4hjKcK ZaEZOub/RrmjWFReHyQWUELThhXALtkqy9hK+R1OVZQRBbMiJnE4Z/p2o7qDFERr6P57 7dyZTyQN2Jgh6NOCPiiDokdVtb0Eh9MayCk0TtBbj/FvE/vbGtt2RTY+D23/2A1CSBOI uZFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688702486; x=1691294486; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oTRfHBsFGfAZ97A0BSfeTr2afcEqKG6usDfs5C48kbE=; b=AolyBqIMm8VR8uEQpTC13YDdFvH5y54wkODemXUaepBffXXjB9GlYipad7z1WsWnbe zkPdFqrGi7U6cWkKFDCHBr2nrPxXdjpsGEsIZI8Sxo0/zAXqCi0X4xqU1W2WSrzRM5j2 NcDKdZSlA5zQvBqOIMQ8ftWsv856ePxYaQMYjUh4DfNQtWP+RBspOgAMpD23AOPh02V9 WwJBDQOY+3o7D0I4W+REGU2R7blJ4NehOK/sE0m8b30uICKvxg/l89gstfiHfYqiTZpn IAP8FizDIrEXxtSez2mxB1rQqXWHiQ/HHsq+H4xMWN6+cjw+PmrEPPojkdQvZwp1Fxdl r/kw== X-Gm-Message-State: ABy/qLY3wH2sjE1e/dRwd+KcPhKxt4Y+hWiLaig6ZCR8mxZlWJ4giEH3 GIolRLNDoeGLfGSozQVlsZNu16tV/gH4NDidU3w= X-Received: by 2002:a05:6a20:918a:b0:10f:f672:6e88 with SMTP id v10-20020a056a20918a00b0010ff6726e88mr3571885pzd.4.1688702485855; Thu, 06 Jul 2023 21:01:25 -0700 (PDT) Received: from localhost ([164.70.16.189]) by smtp.gmail.com with ESMTPSA id 1-20020a170902ee4100b001ab2b415bdbsm2141112plo.45.2023.07.06.21.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 21:01:25 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , AKASHI Takahiro , Masahisa Kojima Subject: [PATCH 0/4] introduce EFI_RAM_DISK_PROTOCOL Date: Fri, 7 Jul 2023 13:00:40 +0900 Message-Id: <20230707040045.485790-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 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 This series introduces the EFI_RAM_DISK_PROTOCOL implementation. The major purpose of this series is a preparation for EFI HTTP(S) boot. Now U-Boot can download the distro installer ISO image via wget or tftpboot commands, but U-Boot can not mount the downloaded ISO image. By calling EFI_RAM_DISK_PROTOCOL->register API, user can mount the ISO image and boot the distro installer. Note that the installation process may not proceed after the distro installer calls ExitBootServices() since there is no hand-off process for the block device of memory mapped ISO image. The EFI_RAM_DISK_PROTOCOL was tested with the debian network installer[1] on qemu_arm64 platform. The example procedure is as follows. => tftpboot 41000000 mini.iso => efidebug disk load 41000000 $filesize After these commands, ISO image is mounted like: => efidebug dh 000000007eec5910 (efiblk#0) /RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0) Block IO 000000007eec6140 (efiblk#0:1) /RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0)/HD(1,0x01,0,0x0,0x33800) Block IO 000000007eec62b0 (efiblk#0:2) /RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0)/HD(2,0x01,0,0x33800,0x10000) Block IO System Partition Simple File System => dm tree blk 0 [ + ] efi_blk `-- efiblk#0 partition 0 [ + ] blk_partition |-- efiblk#0:1 partition 1 [ + ] blk_partition `-- efiblk#0:2 Debian can be successfully installed with this RAM disk on QEMU. [TODO] - udevices created in ./lib/efi_driver/efi_block_device.c::efi_bl_bind() are not removed when the efi_handle is removed. So after unload the RAM disk, udevices still exist. I plan to add a udevice removal process in ./lib/efi_driver/efi_uclass.c::efi_uc_stop(). In addition, I also plan to add unbind() callback in struct efi_driver_ops. [1] https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/mini.iso Masahisa Kojima (4): efi_loader: add RAM disk device path efi_loader: add EFI_RAM_DISK_PROTOCOL implementation cmd: efidebug: add RAM disk mount command efi_selftest: add EFI_RAM_DISK_PROTOCOL selftest cmd/efidebug.c | 117 ++++++ include/efi_api.h | 32 ++ include/efi_loader.h | 4 + lib/efi_driver/efi_uclass.c | 7 +- lib/efi_loader/Kconfig | 6 + lib/efi_loader/Makefile | 1 + lib/efi_loader/efi_device_path_to_text.c | 14 + lib/efi_loader/efi_ram_disk.c | 334 +++++++++++++++ lib/efi_loader/efi_setup.c | 6 + lib/efi_selftest/Makefile | 1 + lib/efi_selftest/efi_selftest_ram_disk.c | 511 +++++++++++++++++++++++ lib/uuid.c | 4 + 12 files changed, 1035 insertions(+), 2 deletions(-) create mode 100644 lib/efi_loader/efi_ram_disk.c create mode 100644 lib/efi_selftest/efi_selftest_ram_disk.c base-commit: e2e2aea5733f0d23cd9593bbefe5c803c552dcb9