Blame kexec_file-add-kexec_file-flag-to-support-debug-prin.patch

Baoquan He a2cf60
From 9d9cf8de8b2ad8273861a30476a46f34cd34871a Mon Sep 17 00:00:00 2001
Baoquan He a2cf60
From: Baoquan He <bhe@redhat.com>
Baoquan He a2cf60
Date: Tue, 14 Nov 2023 23:20:30 +0800
Baoquan He a2cf60
Subject: [PATCH] kexec_file: add kexec_file flag to support debug printing
Baoquan He a2cf60
Content-type: text/plain
Baoquan He a2cf60
Baoquan He a2cf60
This add KEXEC_FILE_DEBUG to kexec_file_flags so that it can be passed
Baoquan He a2cf60
to kernel when '-d' is added with kexec_file_load interface. With that
Baoquan He a2cf60
flag enabled, kernel can enable the debugging message printing.
Baoquan He a2cf60
Baoquan He a2cf60
Signed-off-by: Baoquan He <bhe@redhat.com>
Baoquan He a2cf60
Signed-off-by: Simon Horman <horms@kernel.org>
Baoquan He a2cf60
---
Baoquan He a2cf60
 kexec/kexec-syscall.h | 1 +
Baoquan He a2cf60
 kexec/kexec.c         | 1 +
Baoquan He a2cf60
 2 files changed, 2 insertions(+)
Baoquan He a2cf60
Baoquan He a2cf60
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
Baoquan He a2cf60
index 2559bffb93da..73e52543e1b0 100644
Baoquan He a2cf60
--- a/kexec/kexec-syscall.h
Baoquan He a2cf60
+++ b/kexec/kexec-syscall.h
Baoquan He a2cf60
@@ -119,6 +119,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
Baoquan He a2cf60
 #define KEXEC_FILE_UNLOAD	0x00000001
Baoquan He a2cf60
 #define KEXEC_FILE_ON_CRASH	0x00000002
Baoquan He a2cf60
 #define KEXEC_FILE_NO_INITRAMFS	0x00000004
Baoquan He a2cf60
+#define KEXEC_FILE_DEBUG	0x00000008
Baoquan He a2cf60
 
Baoquan He a2cf60
 /* These values match the ELF architecture values. 
Baoquan He a2cf60
  * Unless there is a good reason that should continue to be the case.
Baoquan He a2cf60
diff --git a/kexec/kexec.c b/kexec/kexec.c
Baoquan He a2cf60
index 9d0ec46e5657..222f79e3112e 100644
Baoquan He a2cf60
--- a/kexec/kexec.c
Baoquan He a2cf60
+++ b/kexec/kexec.c
Baoquan He a2cf60
@@ -1477,6 +1477,7 @@ int main(int argc, char *argv[])
Baoquan He a2cf60
 			return 0;
Baoquan He a2cf60
 		case OPT_DEBUG:
Baoquan He a2cf60
 			kexec_debug = 1;
Baoquan He a2cf60
+			kexec_file_flags |= KEXEC_FILE_DEBUG;
Baoquan He a2cf60
 			break;
Baoquan He a2cf60
 		case OPT_NOIFDOWN:
Baoquan He a2cf60
 			skip_ifdown = 1;
Baoquan He a2cf60
-- 
Baoquan He a2cf60
2.41.0
Baoquan He a2cf60