Thread (15 messages) 15 messages, 4 authors, 2025-01-06

Re: [PATCH v2 5/5] crash: Remove KEXEC_CORE_NOTE_NAME

From: Dave Martin <Dave.Martin@arm.com>
Date: 2025-01-06 14:51:54
Also in: kexec, linux-mm, linux-s390, lkml

Hi,

On Sat, Jan 04, 2025 at 11:38:38PM +0900, Akihiko Odaki wrote:
quoted hunk ↗ jump to hunk
Now KEXEC_CORE_NOTE_NAME is only used at one place and it does not seem
to provide any value anymore. Replace the remaining usage with the
literal and remove the macro.

Signed-off-by: Akihiko Odaki <redacted>
---
 arch/s390/kernel/crash_dump.c | 2 +-
 include/linux/kexec.h         | 2 --
 include/linux/vmcore_info.h   | 1 -
 3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index cd0c93a8fb8b..4a9817489e35 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -253,7 +253,7 @@ static const char *nt_name(Elf64_Word type)
 	const char *name = "LINUX";
 
 	if (type == NT_PRPSINFO || type == NT_PRSTATUS || type == NT_PRFPREG)
-		name = KEXEC_CORE_NOTE_NAME;
+		name = "CORE";
If I've understood the code here correctly, the note type is supplied
at all the nt_init() and nt_size() call sites, so instead of this hack
can we wrap those in macros that get the formal name from elf.h rather
than guessing it here?  e.g.:

#define nt_size(..., note, ...) \
	__nt_size(..., NT ## _ ## note, NN ## _ ## note, ...)

etc.

The compiler is quite likely to fold away most of the implied
duplication of code (it would be interesting to look at the compiler
output) -- but anyway, this is super-slow-path: nobody expects realtime
response when the kernel has crashed.

[...]

Cheers
---Dave
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help