quick kexec: Fix conflicts with xen load live update

Add KEXEC_FLAGS_MAX to avoid conflicting with KEXEC_LIVE_UPDATE.

Signed-off-by: snoweay <sangyan@163.com>
This commit is contained in:
snoweay 2022-02-23 06:54:50 +00:00 committed by Gitee
parent 3895c0840a
commit 878120c450
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 26 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From c4fa8f8344a5f7a3147c8bee34d37b6af35d02e7 Mon Sep 17 00:00:00 2001
From 893ef61ca2b1e857b950654c1bb57f3624df5dc5 Mon Sep 17 00:00:00 2001
From: snoweay <snoweay@163.com>
Date: Wed, 12 Aug 2020 07:53:13 -0400
Subject: [PATCH] kexec: Add quick kexec support
@ -14,24 +14,41 @@ just like kdump(kexec on crash), by using reserved memory.
We also add this support in syscall kexec_load of linux kernel
through flags of KEXEC_QUICK.
Add KEXEC_FLAGS_MAX to avoid conflicting with KEXEC_LIVE_UPDATE.
---
kexec/kexec-syscall.h | 1 +
kexec/kexec-syscall.h | 2 ++
kexec/kexec-xen.h | 2 +-
kexec/kexec.c | 10 ++++++++++
kexec/kexec.h | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
4 files changed, 16 insertions(+), 2 deletion(-)
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index bea29d4..6eea272 100644
index bea29d4..5f22353 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -109,6 +109,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
@@ -109,6 +109,8 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd,
#define KEXEC_ON_CRASH 0x00000001
#define KEXEC_PRESERVE_CONTEXT 0x00000002
+#define KEXEC_QUICK 0x00000004
+#define KEXEC_FLAGS_MAX 0x00000010
#define KEXEC_ARCH_MASK 0xffff0000
/* Flags for kexec file based system call */
diff --git a/kexec/kexec-xen.h b/kexec/kexec-xen.h
index 70fb576..d417c90 100644
--- a/kexec/kexec-xen.h
+++ b/kexec/kexec-xen.h
@@ -79,7 +79,7 @@ extern int __xc_interface_close(xc_interface *xch);
#endif
#ifndef KEXEC_LIVE_UPDATE
-#define KEXEC_LIVE_UPDATE 0x00000004
+#define KEXEC_LIVE_UPDATE KEXEC_FLAGS_MAX
#endif
int xen_get_kexec_range(int range, uint64_t *start, uint64_t *end);
diff --git a/kexec/kexec.c b/kexec/kexec.c
index f63b36b..5b8beca 100644
--- a/kexec/kexec.c

View File

@ -4,7 +4,7 @@
Name: kexec-tools
Version: 2.0.23
Release: 2
Release: 3
License: GPLv2
Summary: The kexec/kdump userspace component
URL: https://www.kernel.org/
@ -289,6 +289,9 @@ done
%endif
%changelog
* Wed Feb 23 2022 snoweay <snoweay@163.com> - 2.0.23-3
- Fix conflicts between quick kexec and load-live-update with xen.
* Wed Dec 29 2021 zhouwenpei <zhouwenpei1@huawei.com> - 2.0.23-2
- modify the patch header