[tip: x86/boot] x86/boot: Drop unused implementation of panic()
From: tip-bot2 for Ard Biesheuvel
Date: Mon Sep 28 2026 - 23:01:46 EST
The following commit has been merged into the x86/boot branch of tip:
Commit-ID: dc2a1671d983d26b8ea5a4c5de9c5a028707f40b
Gitweb: https://git.kernel.org/tip/dc2a1671d983d26b8ea5a4c5de9c5a028707f40b
Author: Ard Biesheuvel <ardb@xxxxxxxxxx>
AuthorDate: Fri, 25 Sep 2026 09:51:41 +02:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Mon, 28 Sep 2026 18:07:34 -07:00
x86/boot: Drop unused implementation of panic()
The decompressor has its own implementation of panic(), which is based
on the vsnprintf() routine provided by the EFI stub.
The decompressor's panic() has no remaining users, and is implemented in
terms of the EFI stub's snprintf() implementation, which is going away
(and relying on the EFI stub from code that does not execute in the
context of the EFI boot services is a bad idea in general).
So drop it.
Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Acked-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
Link: https://patch.msgid.link/20260925075137.44298-8-ardb@xxxxxxxxxx
---
arch/x86/boot/compressed/error.c | 19 -------------------
arch/x86/boot/compressed/error.h | 1 -
2 files changed, 20 deletions(-)
diff --git a/arch/x86/boot/compressed/error.c b/arch/x86/boot/compressed/error.c
index 19a8251..ce5ed7d 100644
--- a/arch/x86/boot/compressed/error.c
+++ b/arch/x86/boot/compressed/error.c
@@ -22,22 +22,3 @@ void error(char *m)
while (1)
asm("hlt");
}
-
-/* EFI libstub provides vsnprintf() */
-#ifdef CONFIG_EFI_STUB
-void panic(const char *fmt, ...)
-{
- static char buf[1024];
- va_list args;
- int len;
-
- va_start(args, fmt);
- len = vsnprintf(buf, sizeof(buf), fmt, args);
- va_end(args);
-
- if (len && buf[len - 1] == '\n')
- buf[len - 1] = '\0';
-
- error(buf);
-}
-#endif
diff --git a/arch/x86/boot/compressed/error.h b/arch/x86/boot/compressed/error.h
index 31f9e08..87062de 100644
--- a/arch/x86/boot/compressed/error.h
+++ b/arch/x86/boot/compressed/error.h
@@ -6,6 +6,5 @@
void warn(const char *m);
void error(char *m) __noreturn;
-void panic(const char *fmt, ...) __noreturn __cold;
#endif /* BOOT_COMPRESSED_ERROR_H */