@@ -133,6 +133,7 @@ enum {
IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5,
IORES_DESC_DEVICE_PRIVATE_MEMORY = 6,
IORES_DESC_DEVICE_PUBLIC_MEMORY = 7,
+ IORES_DESC_KEXEC_KERNEL = 8,
};
/* helpers to define resources */
@@ -303,12 +303,14 @@ extern int kexec_load_disabled;
#define KEXEC_FILE_FLAGS (KEXEC_FILE_UNLOAD | KEXEC_FILE_ON_CRASH | \
KEXEC_FILE_NO_INITRAMFS)
-/* Location of a reserved region to hold the crash kernel.
- */
+/* Location of a reserved region to hold the crash kernel. */
extern struct resource crashk_res;
extern struct resource crashk_low_res;
extern note_buf_t __percpu *crash_notes;
+/* Location of a reserved region to hold normal kexec kernel. */
+extern struct resource kexeck_res;
+
/* flag to track if kexec reboot is in progress */
extern bool kexec_in_progress;
@@ -70,6 +70,15 @@ struct resource crashk_low_res = {
.desc = IORES_DESC_CRASH_KERNEL
};
+/* Location of the reserved area for the normal kexec kernel */
+struct resource kexeck_res = {
+ .name = "Kexec kernel",
+ .start = 0,
+ .end = 0,
+ .flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
+ .desc = IORES_DESC_KEXEC_KERNEL
+};
+
int kexec_should_crash(struct task_struct *p)
{
/*
crashk_res resource is used to reserve memory for crash kernel. There is also, however, a benefit to reserve memory for normal kernel to speed up reboot performance. This is because during regular kexec reboot, kernel performs relocations to the final destination of the loaded segments, and the relocation might take a long time especially if initramfs is big. Therefore, similarly to crashk_res, add kexeck_res that will be used to reserve memory for normal kexec kernel. Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> --- include/linux/ioport.h | 1 + include/linux/kexec.h | 6 ++++-- kernel/kexec_core.c | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-)