Skip to contentSkip to conversation

Kexec on panic vmlinux initrd fix

PATCH New Vivek Goyal 1 participant 1 message Jun 21, 2005 kexec

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kexec on panic vmlinux initrd fix

Hi,

This is a minor bug fix in kexec to resolve the problem of loading panic kernel with initrd.

Thanks
Vivek

o Problem: Loading a capture kenrel fails if initrd is also being loaded. This has been observed for vmlinux image for kexec on panic case.

o This patch fixes the problem. In segment location and size verification logic, minor correction has been done. Segment memory end (mend) should be mstart + memsz - 1. This one byte offset was source of failure for initrd loading which was being loaded at hole boundary.

---

 linux-2.6.12-mm1-vivek/kernel/kexec.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
kernel/kexec.c renamed from kernel/kexec.c~kexec-on-panic-vmlinux-initrd-fix +1 -1
diff -puN kernel/kexec.c~kexec-on-panic-vmlinux-initrd-fix kernel/kexec.c
@@ -279,7 +279,7 @@ static int kimage_crash_alloc(struct kim
 		unsigned long mstart, mend;
 
 		mstart = image->segment[i].mem;
-		mend = mstart + image->segment[i].memsz;
+		mend = mstart + image->segment[i].memsz - 1;
 		/* Ensure we are within the crash kernel limits */
 		if ((mstart < crashk_res.start) || (mend > crashk_res.end))
 			goto out;

_