diff mbox series

[v1] systemd: Add backport of EFI_MEMORY_ATTRIBUTE_PROTOCOL warning downgrade patch

Message ID 20260716184404.1608484-1-aswin.murugan@oss.qualcomm.com
State New
Headers show
Series [v1] systemd: Add backport of EFI_MEMORY_ATTRIBUTE_PROTOCOL warning downgrade patch | expand

Commit Message

Aswin Murugan July 16, 2026, 6:44 p.m. UTC
Add a backport systemd patch[1] that downgrades the
EFI_MEMORY_ATTRIBUTE_PROTOCOL missing message from warning to debug.

U-Boot does not currently implement EFI_MEMORY_ATTRIBUTE_PROTOCOL,
causing systemd-boot to emit a warning on every boot on EFI 2.10+
platforms. Although the condition is a known U-Boot limitation and
requires no user intervention, the warning triggers log_wait()
behavior, introducing an unnecessary ~2.5-second delay during boot
and negatively impacting boot-time KPIs.

Include the patch in the systemd recipe to suppress this
non-actionable warning, eliminate the associated ~2.5-second boot
delay, and improve boot performance on U-Boot-based systems.

[1] https://github.com/systemd/systemd/pull/43017

Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
---
 .../systemd/systemd-boot_259.5.bb             |  4 ++
 ...FI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch | 47 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_259.5.bb    |  1 +
 3 files changed, 52 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd-boot_259.5.bb b/meta/recipes-core/systemd/systemd-boot_259.5.bb
index bab2e7ae27..0344313ae6 100644
--- a/meta/recipes-core/systemd/systemd-boot_259.5.bb
+++ b/meta/recipes-core/systemd/systemd-boot_259.5.bb
@@ -8,6 +8,10 @@  DEPENDS = "libcap util-linux gperf-native python3-jinja2-native python3-pyelftoo
 inherit meson pkgconfig gettext
 inherit deploy
 
+SRC_URI += " \
+           file://0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch \
+           "
+
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 LDFLAGS =+ "${@ " ".join(d.getVar('LD').split()[1:])} "
diff --git a/meta/recipes-core/systemd/systemd/0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch b/meta/recipes-core/systemd/systemd/0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch
new file mode 100644
index 0000000000..7db73571cd
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch
@@ -0,0 +1,47 @@ 
+From 829c2f0e3dffe8b4484e730a3f3058b61e2133ad Mon Sep 17 00:00:00 2001
+From: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
+Date: Tue, 14 Jul 2026 11:37:14 +0530
+Subject: [PATCH] boot: downgrade EFI_MEMORY_ATTRIBUTE_PROTOCOL warning
+
+U-Boot currently does not implement EFI_MEMORY_ATTRIBUTE_PROTOCOL
+even when reporting EFI version >= 2.10. Consequently, systemd-boot
+emits a warning on every boot when running on U-Boot firmware.
+
+The absence of EFI_MEMORY_ATTRIBUTE_PROTOCOL is a current
+U-Boot limitation and not a condition users can remedy.
+Furthermore, the EFI specification does not require all
+firmware advertising EFI 2.10 or newer to implement the
+protocol. As a result, the warning provides little value on
+U-Boot systems while causing log_wait() to impose a 2.5-second
+boot delay.
+
+Downgrade the message to LOG_DEBUG, this keeps the diagnostic
+available for debugging purposes without penalizing normal
+boot time.
+
+Upstream-Status: Backport [ https://github.com/systemd/systemd/pull/43017 ]
+
+Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
+---
+ src/boot/linux.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/boot/linux.c b/src/boot/linux.c
+index 67ed859993..09fb63419d 100644
+--- a/src/boot/linux.c
++++ b/src/boot/linux.c
+@@ -267,10 +267,7 @@ EFI_STATUS linux_exec(
+                  * if required for NX_COMPAT */
+                 err = BS->LocateProtocol(MAKE_GUID_PTR(EFI_MEMORY_ATTRIBUTE_PROTOCOL), /* Registration= */ NULL, (void **) &memory_proto);
+                 if (err != EFI_SUCCESS)
+-                        /* Only warn if the UEFI should have support in the first place (version >= 2.10) */
+-                        log_full(err,
+-                                 ST->Hdr.Revision >= ((2U << 16) | 100U) ? LOG_WARNING : LOG_DEBUG,
+-                                 "No EFI_MEMORY_ATTRIBUTE_PROTOCOL found, skipping NX_COMPAT support.");
++                        log_debug_status(err, "No EFI_MEMORY_ATTRIBUTE_PROTOCOL found, skipping NX_COMPAT support.");
+         }
+ 
+         const PeSectionHeader *headers;
+-- 
+2.34.1
+
diff --git a/meta/recipes-core/systemd/systemd_259.5.bb b/meta/recipes-core/systemd/systemd_259.5.bb
index 27722f97bb..1e442257e1 100644
--- a/meta/recipes-core/systemd/systemd_259.5.bb
+++ b/meta/recipes-core/systemd/systemd_259.5.bb
@@ -35,6 +35,7 @@  SRC_URI += " \
            file://0001-meson-use-libfido2_cflags-dependency.patch \
            file://0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch \
            file://0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch \
+           file://0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch \
            "
 
 PAM_PLUGINS = " \