From patchwork Mon Feb 3 10:59:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 861545 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp1955680wrr; Mon, 3 Feb 2025 02:59:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzvsPFfU0nPhNEWgkWISNeCAJwxLMdQRp4bdCFAhksQAKfidup9lBJfrAIxsL5EvJG2Ig4KQ==@linaro.org X-Google-Smtp-Source: AGHT+IHRpc2ZBdfCFDCxmXjBsy+PtKfQEf4xYZw+dmtSSw6cWMSEX0fQg2Q95uZr/73WSLnGIBaf X-Received: by 2002:a05:6402:a001:b0:5dc:81b3:5e1a with SMTP id 4fb4d7f45d1cf-5dc81b35f64mr11458551a12.7.1738580375952; Mon, 03 Feb 2025 02:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738580375; cv=none; d=google.com; s=arc-20240605; b=b+mdTu2xBpdNQTW05nHfEw8zNbqW9mK1/bIfWW81Etoga+o9cbAj0OZb3uNDO6KcED 9mbLt/u4cm7+h25uQzZBMuIQZhlUC9Wwb1M5vJVWg/q9xcrJixMlYyhGgdKKDepFqfwi FKB7akVqvbkGql9MRo31drlfHlvGGbz64cIS9qYvqfyh1+C/enDIPacEm4FWDtDvU6t+ zladiEuWoFvjSVwJP7MvHZjiA5DU4RF2wMHpdUsSlGLJT5SoAJkor++gEJ0nUUf5H1+c eHHFXqJXXFdNfEn6dIHGRdxeEiT9JBwFDJtr3+K6k02Ts485hkcHLDMaBBDrmbgU4skW uBdg== 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:message-id:date:subject:cc:to:from; bh=pmCMoFUvxhcR9Tu526hLVbdljhmWmc1IEwJu/Ktc70E=; fh=wsCyNOKiPi2cbAnd4C0ATc+aVai2WcbB+Mi/b3s2974=; b=j0B59StWTlgWFjaSMhi1GI3aLMb8VwUxk/wyuHy6aFtOKkiAQ74QWNKlHY+08EVnGv zlxGA7SvdE4xxXyR234ThDnkgYjouBmzHkN84zDaoePdk+qHmFK44KBJeP/qU108k/6q sdkLu5Y1wKX4n/dVNLNPI9H5YHX/qB0tYrrn0kYs3qBhAPJMz8ifhDCRg0SwtGSX/aKG Xm5S8OmJ3bz1FbtvVRG11BynCNd1HQEtQQ3eQkjWZ9W7Ann7HPx+1UFaw8Xesr4LYFcC AloVnvNNZWBZ22CuiyFv9NkEG/uhKXhqxYwex4S6tzi0eyjy1fyMBbTtDVFMrRwXYgm6 IY8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 4fb4d7f45d1cf-5dc723e3286si8323373a12.180.2025.02.03.02.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 02:59:35 -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; 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=fail (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 C103C800B2; Mon, 3 Feb 2025 11:59:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 46225800CF; Mon, 3 Feb 2025 11:59:33 +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=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 1DBA780087 for ; Mon, 3 Feb 2025 11:59:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DF9511FB; Mon, 3 Feb 2025 02:59:54 -0800 (PST) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5283A3F5A1; Mon, 3 Feb 2025 02:59:27 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Tom Rini , Anton Antonov , Tobias Waldekranz , Bin Meng Subject: [PATCH v4 0/5] Add pmem node for preserving distro ISO's Date: Mon, 3 Feb 2025 16:29:07 +0530 Message-Id: <20250203105912.196654-1-sughosh.ganu@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 When installing a distro via EFI HTTP boot some OS installers expect the .iso image to be preserved and treat it as a "CDROM" to install packages. This is problematic in EFI, since U-Boot mounts the image, starts the installer, and eventually calls ExitBootServices. At that point the image U-Boot mounted disappears. Some distros don't care and download the missing packages from a web archive, while others halt the installation complaining they can't find certain packages. If the firmware uses ACPI, this is supported by using NFIT which provides NVDIMM ramdisks to the OS and preserves the image. We don't have anything in place for Device Trees though. Since DT supports persistent memory nodes (pmem) use those and preserve the .iso for installers. The issue can be reproduced by attempting an EFI HTTP boot with Ubuntu live server ISO, or a Rocky Linux ISO. The installation would fail with the failure to locate certain packages. The earlier version had aligned the addition of pmem nodes with the EFI HTTP boot feature. This has been changed, based on a review comment from Heinrich to instead be done by looping through the memory based blkmamp devices. Changes since V3: * Rephrased the 2MiB alignment error message as suggested by Heinrich * Rephrased the description of fdt_fixup_pmem_region() function as suggested by Heinrich * Add the map type to the blkmap slice instead of the entire blkmap device * Move the definition of the helper function to the efi_helper.c * Remove the region of the blkmap mem map device from the EFI memory map along with adding the pmem node Ilias Apalodimas (2): efi_loader: add a function to remove memory from the EFI map efi_loader: preserve installer images in pmem Masahisa Kojima (1): fdt: add support for adding pmem nodes Sughosh Ganu (2): blkmap: store type of blkmap slice in corresponding structure blkmap: add pmem nodes for blkmap memory mapped slices boot/fdt_support.c | 41 ++++++++++++++++- boot/image-fdt.c | 9 ++++ drivers/block/blkmap.c | 82 +-------------------------------- include/blkmap.h | 87 ++++++++++++++++++++++++++++++++++++ include/efi.h | 13 ++++++ include/efi_loader.h | 11 +++-- include/fdt_support.h | 14 ++++++ lib/efi_loader/efi_bootmgr.c | 22 ++++++--- lib/efi_loader/efi_helper.c | 52 +++++++++++++++++++++ lib/efi_loader/efi_memory.c | 51 +++++++++++++++------ lib/lmb.c | 4 +- 11 files changed, 281 insertions(+), 105 deletions(-)