From patchwork Wed Mar 26 14:58:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 876317 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp3217299wrb; Wed, 26 Mar 2025 07:59:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUsAGDahYZhd765oz2N6dln/EANiv67UZUX8X5MM+k8mKexEwrmt04tLAZ07Lf4C5S49WawnQ==@linaro.org X-Google-Smtp-Source: AGHT+IHxhFTfspfEHtCOld3Y6Kf4B5xlNAekkx3xpUTB4AqWYGnAuMdU1LxnWr35C++j2W28tJgR X-Received: by 2002:a05:6122:2205:b0:523:a88b:9bfd with SMTP id 71dfb90a1353d-525a84e28b3mr14215869e0c.7.1743001144799; Wed, 26 Mar 2025 07:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743001144; cv=none; d=google.com; s=arc-20240605; b=L5yrdLMBOqZu+3DL4onBeqNSn0rwtWMyhFcxTxYSmw9+1n1SpvIxGcgUF7clhNMgKg pfdjK/XBX2B6QHL8VB1v09W0JxY8JtfN8h1+soTWcMU8ugYX74qh7WvQEqQw9dSqKNdK P3RqhNng09aq9u2ewOp13Us9IvrGtYEDa8SUr3n0WTCkAs5GnRAbKJubpeHQW92lsxUo EcRqY0Y29alRTcZKbE7v3+hLY9fW4NEzuB+ZCNjHEVyviyhiCNLqSfzwlL7pXp0F9IcP cJrChkbt+PxVrEoNWAAuh2m7BKvWnkIX/OzPAC530zRjTtWDC6i7KPTgnb8g0V/Iv38Q oF4g== 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:dkim-signature; bh=pnQNr09dzRQp2cCy9CJ+3Fb9HsrTZd2ceATT5JUGgOk=; fh=mUD7jNTmec+GIkZRnjGxb3ztv97GPzkv9PMcUwWQsQk=; b=MKejNgOWebLy1nzofKBtnimDU8v8aZQsSemwtU/g/07lvLKM/qckFKOG9zTl5Es5qo kN9xtRtxqXzIFxuQk6Rdf7e1Tv0DV4zNY2V6vGj5XWk1V98UpE7GyRBLUWz4xu9OHonS zwTheZDrK8yDz4M4HZBzTiyMjTTZZQiEonPbkHhgxOS+QkCgtLUt/iUVCJI0T4vlCmcz lU4QbJffN1/kSVJwkWJwglxkWkx5RjeWcSq/T4wUCIxZJzgjpklvI773r1jS7fw2JQFB vY+rot9ivXi5xOhW4uklvBH3wxbaB9v+9J0EgycgqV5gS1Fn4LuI8mgGhlnvDSJ3EO2b KfYw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wGOkyb5n; 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; dara=neutral 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 71dfb90a1353d-525a76a8a7esi2978584e0c.263.2025.03.26.07.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Mar 2025 07:59:04 -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=wGOkyb5n; 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; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DAFBC8070C; Wed, 26 Mar 2025 15:59:02 +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="wGOkyb5n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B74781951; Wed, 26 Mar 2025 15:59:01 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 D19FE803CC for ; Wed, 26 Mar 2025 15:58:58 +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-ej1-x633.google.com with SMTP id a640c23a62f3a-ac6ed4ab410so103654166b.1 for ; Wed, 26 Mar 2025 07:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743001138; x=1743605938; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pnQNr09dzRQp2cCy9CJ+3Fb9HsrTZd2ceATT5JUGgOk=; b=wGOkyb5niVwHEbsFDkV+o1iZMPkYH540PxERWC+2eqepRHBWeJUWb9fwSFZdao3lg7 vu5/f7DN/82UFRCIMxqTW4DfrFHHfz3umG7ZlRgy1185Y91gBOqmLwYucUUjARU0dEoJ GHAFCwScYT1bIXm0yNOd1Wvvn/ul5VXAXWlFoFFbGvawTYlLWtddYhi63S8l4NbUAr+O nH5zKbGWEhUF3wRWYpJyA1VAA2FGRouNhJ/6Xjm78eKJLcsJztdqblsNRAMa9l+JDBYF gk3NeILTaz2X0u00EtYRzgy4au4u9FWgdCMx+h2mJorpI27rnKW0Z7AMEBVdKuxqLEDr DoUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743001138; x=1743605938; 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=pnQNr09dzRQp2cCy9CJ+3Fb9HsrTZd2ceATT5JUGgOk=; b=CLYJqcL/BbJdp8FsUlYh4SqJHuDZ5KSQBf6ngpXW7DS+8whcZ9zWOnk5/V7+GO99A0 YXUz3BraRNIXQB57Anqdk51adeE4cOB6Ra28bLbTmZHXdvXx9Z4+/clsMlNfglQuhUA8 SZVop030zofQXF+ysietLmV8IEp3su6C6KUv/9EV2Bziw8TT5Ad2A0b/2tkmeRCPHZ+B Ew3d58r0tNwkvqZ5SNeMgZqst86DywhuylC5WORleomGuSDKqMe7hDanbPib6sM7/NRT oyGd3orml7sv/WOUXhSgcnQPwOkt4+TwfQM8VeRAVIakGnPEGKb3azb4ySlLKxpH7bH9 MNNA== X-Gm-Message-State: AOJu0YznJwfjUBp1KtFWlCoPx6MirggVsB1lwbjmBh7JhkxkHuGBs0RZ SFNIUWM7UPvQ64qU6LSkeXBljfmD+SuqOs4q+Ejjj4SKL3PrZMgSwmxjcv6oKBsyJi4NHvCwXem o X-Gm-Gg: ASbGnctyWRxlymocXIz0xOzdHnhagoU1/Y2SgXZyAnN4FYozyMQseHL79IMS7jnDuek X2E33VGTOiCgXwr5QxW1r3ah5+qzxQx3ahrzzkvQoVmJIdeQZ2IWROMBYs9AR9QBucelGizYl4l FRo86Iv0xr2u5z5H9k9h97SRtc8dvpaTAA91kVnsC+wz5+ead4UGANTVOifyWdgnvXt0w+b8IG0 LGLrDeutRTLWpCKL8TMZDIMHBD4BZwZp0Y9aD3wUb4nph2F5JB82FDqDCIIHfQyKNtg8Hf7XOWV LAmouo1ZPwRO2+GcUSF6GjpwIP12Aq+F299W8smCIjdgyix2MVLW1rXPlLy0C0CWyuNNEJA0Ucn MZU9xNsE72oCILf8oUw4I2X8= X-Received: by 2002:a17:907:3da9:b0:ac2:29c7:8622 with SMTP id a640c23a62f3a-ac3f252f862mr2099464066b.54.1743001138084; Wed, 26 Mar 2025 07:58:58 -0700 (PDT) Received: from localhost.localdomain (ppp089210242125.access.hol.gr. [89.210.242.125]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3efd3aa21sm1057137366b.158.2025.03.26.07.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Mar 2025 07:58:57 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de, trini@konsulko.com Cc: xypron.glpk@gmx.de, Anton.Antonov@arm.com, sughosh.ganu@linaro.org, tobias@waldekranz.com, pbrobinson@gmail.com Subject: Pull request for efi-next-26032025 Date: Wed, 26 Mar 2025 16:58:50 +0200 Message-ID: <20250326145850.918186-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.47.2 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 Hi Tom, An interesting series that allows us to boot installers and live images from EFI, without any distro-specific quirks. The following changes since commit 042c8f0cb1ea5f6988e8633799f7b550876f0ae6: Merge tag 'u-boot-imx-next-20250325' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next (2025-03-25 08:57:38 -0600) are available in the Git repository at: https://source.denx.de/u-boot/custodians/u-boot-tpm/ tags/efi-next-26032025 for you to fetch changes up to 61e0a20aecf4af6cdc223bd8cd1bd82fe5e3d9f6: blkmap: pass information on ISO image to the OS (2025-03-26 13:28:08 +0200) The CI https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/25336 suffers from the lmb issue but the same patches on top master work fine https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/25338 Please pull /Ilias ---------------------------------------------------------------- When trying to boot an OS installer or a live image via EFI HTTP the following happens - U-Boot downloads the image and mounts it in memory - The EFI subsystem is invoked and the image is started - The OS calls ExitBootServices and the memory that holds the mounted image might get overwritten This results in installers complaining that they can't find installer medium or live images complaining they can't find the root filesystem. ACPI already deals with it by having NFIT and NVDIMM to provide ramdisks that need to be preserved by the OS. Linux and device trees have support for persistent memory devices (pmem). We can use them and inject a pmem node in the DT to preserve memory across the entire boot sequence. Linux will just create a block device over the reserved memory and installers/images can re-discover it. This is what it looks like from the OS perspective: nd_pmem namespace0.0: unable to guarantee persistence of writes pmem0: p1 p2 p3 EXT4-fs (pmem0p3): mounted filesystem f40f64a4-5b41-4828-856e-caaae2c1c2a0 r/w with ordered data mode. Quota mode: disabled. EXT4-fs (pmem0p3): re-mounted f40f64a4-5b41-4828-856e-caaae2c1c2a0 r/w. Quota mode: disabled. Adding 45052k swap on /dev/pmem0p2. Priority:-2 extents:1 across:45052k SS root@genericarm64:~# mount | grep pmem /dev/pmem0p3 on / type ext4 (rw,relatime) /dev/pmem0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) It's worth noting that Linux behaves differently with reserved memory (at least on arm64) and that depends on kernel config options. CONFIG_ZONE_DEVICES and CONFIG_ARM64_PMEM are such options. It boils down to how the kernel tries to map pages. If devm_memremap_pages() gets called instead of devm_memremap() mapping the memory fails. The only safe way is to remove the memory from the EFI memory map, rather than defining it as /reserved no-map;/ in the DT. ---------------------------------------------------------------- Ilias Apalodimas (2): efi_loader: allow for removal of memory from the EFI map efi_loader: remove memory occupied by a ramdisk from EFI memory map Masahisa Kojima (1): fdt: add support for adding pmem nodes Sughosh Ganu (5): efi_loader: remove unused code from copy_fdt() efi_loader: install device-tree on configuration table on every invocation blkmap: store type of blkmap slice in corresponding structure blkmap: add an attribute to preserve the mem mapping blkmap: pass information on ISO image to the OS boot/fdt_support.c | 39 +++++++++++++++++++- boot/image-fdt.c | 7 ++++ cmd/blkmap.c | 9 ++++- drivers/block/blkmap.c | 82 +++++++++++++++++++++++++++++++++++++++-- drivers/block/blkmap_helper.c | 2 +- include/blkmap.h | 33 ++++++++++++++++- include/efi.h | 13 +++++++ include/efi_loader.h | 15 ++++++++ include/fdt_support.h | 14 +++++++ lib/efi_loader/efi_bootmgr.c | 25 ++++++++++--- lib/efi_loader/efi_helper.c | 85 ++++++++++++++++++++++++++++++++++--------- lib/efi_loader/efi_memory.c | 34 +++++++++-------- 12 files changed, 310 insertions(+), 48 deletions(-)