From: Breno Leitao <leitao@debian.org>
To: Ard Biesheuvel <ardb@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
Breno Leitao <leitao@debian.org>,
kernel-team@meta.com, kernel test robot <lkp@intel.com>
Subject: [PATCH 2/2] efi/runtime-wrappers: mark efi_runtime_lock_owner as __used
Date: Mon, 13 Jul 2026 06:06:48 -0700 [thread overview]
Message-ID: <20260713-efi_fixes-v1-2-cdde378d9df9@debian.org> (raw)
In-Reply-To: <20260713-efi_fixes-v1-0-cdde378d9df9@debian.org>
efi_runtime_lock_owner is only ever read by efi_runtime_assert_lock_held().
When CONFIG_BUG=n, WARN_ON() collapses to a statement that discards its
condition, so the compiler drops that read, treats the variable as
write-only and eliminates it. Debug info still references the symbol, so a
build carrying it (e.g. CONFIG_DEBUG_INFO_SPLIT) fails to link:
ld: drivers/firmware/efi/runtime-wrappers.o:(.debug_addr+0x104): undefined reference to `efi_runtime_lock_owner'
Mark the variable __used so its storage is always emitted. This seems to
be better than alternatives (READ_ONCE/__maybe_unused).
Fixes: a2860501203c ("efi/runtime-wrappers: Keep track of the efi_runtime_lock owner")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607100518.uMJJPDfP-lkp@intel.com/
Signed-off-by: Breno Leitao <leitao@debian.org>
---
drivers/firmware/efi/runtime-wrappers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
index 6f42da11a9178..2344b9d1e81f8 100644
--- a/drivers/firmware/efi/runtime-wrappers.c
+++ b/drivers/firmware/efi/runtime-wrappers.c
@@ -210,7 +210,7 @@ void efi_call_virt_check_flags(unsigned long flags, const void *caller)
*/
static DEFINE_SEMAPHORE(efi_runtime_lock, 1);
-static struct task_struct *efi_runtime_lock_owner;
+static struct task_struct *efi_runtime_lock_owner __used;
/*
* Expose the EFI runtime lock to the UV platform
--
2.53.0-Meta
next prev parent reply other threads:[~2026-07-13 13:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 13:06 [PATCH 0/2] efi/runtime-wrappers: fix linker warnings Breno Leitao
2026-07-13 13:06 ` [PATCH 1/2] efi/runtime-wrappers: mark efi_rts_park_worker() as __noreturn Breno Leitao
2026-07-13 13:06 ` Breno Leitao [this message]
2026-07-14 6:50 ` [PATCH 0/2] efi/runtime-wrappers: fix linker warnings Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260713-efi_fixes-v1-2-cdde378d9df9@debian.org \
--to=leitao@debian.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jpoimboe@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox