[PATCH v3 01/44] efi/runtime-wrappers: Restore IRQ flags before proceeding with prints
Vladimir Murzin
vladimir.murzin at arm.com
Mon Nov 30 07:54:23 PST 2026
Sashiko reported that in case live IRQ flags do not match expected one
after EFI runtime call we proceed with prints before restoring IRQ
flags. That creates window where prints executed with unexpected IRQ
state. Instead, switch the order of operations: first restore IRQ
flags to know good value and only then proceed with prints.
Signed-off-by: Vladimir Murzin <vladimir.murzin at arm.com>
---
drivers/firmware/efi/runtime-wrappers.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
index eea4f32e6474..20d63d028922 100644
--- a/drivers/firmware/efi/runtime-wrappers.c
+++ b/drivers/firmware/efi/runtime-wrappers.c
@@ -165,14 +165,17 @@ void efi_call_virt_check_flags(unsigned long flags, const void *caller)
cur_flags = efi_call_virt_save_flags();
- mismatch = flags ^ cur_flags;
- if (!WARN_ON_ONCE(mismatch & ARCH_EFI_IRQ_FLAGS_MASK))
+ mismatch = (flags ^ cur_flags) & ARCH_EFI_IRQ_FLAGS_MASK;
+
+ if (!mismatch)
return;
+ arch_efi_restore_flags(flags);
+
+ WARN_ON_ONCE(1);
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_NOW_UNRELIABLE);
pr_err_ratelimited(FW_BUG "IRQ flags corrupted (0x%08lx=>0x%08lx) by EFI call from %pS\n",
flags, cur_flags, caller ?: __builtin_return_address(0));
- arch_efi_restore_flags(flags);
}
/*
--
2.34.1
More information about the linux-arm-kernel
mailing list