[PATCH] UBUNTU: [arm] Fix kexec on ARM by properly calling the relocation function

Michael Casadevall sonicmctails at gmail.com
Tue Jan 20 14:43:38 UTC 2009


From: Michael Casadevall <michael.casadevall at canonical.com>

The kexec syscall function is broken on ARM due to it not properly calling
the relocation stub with the correct arguments. This patch puts machine_kexec
in line with the other architectures, and allows kexec to work peroply on ARM.
It has been tested on the versatile kernel successfully.

Signed-off-by: Michael Casadevall <michael.casadevall at canonical.com>
---
 arch/arm/kernel/machine_kexec.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 440dc62..d16f6f4 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -23,6 +23,11 @@ extern unsigned long kexec_indirection_page;
 extern unsigned long kexec_mach_type;
 extern unsigned long kexec_boot_atags;
 
+typedef NORET_TYPE void (*relocate_new_kernel_t)(
+				unsigned long indirection_page,
+				unsigned long reboot_code_buffer,
+				unsigned long start_address) ATTRIB_NORET;
+				
 /*
  * Provide a dummy crash_notes definition while crash dump arrives to arm.
  * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
@@ -50,7 +55,7 @@ void machine_kexec(struct kimage *image)
 	unsigned long page_list;
 	unsigned long reboot_code_buffer_phys;
 	void *reboot_code_buffer;
-
+	relocate_new_kernel_t rnk;
 
 	page_list = image->head & PAGE_MASK;
 
@@ -76,5 +81,7 @@ void machine_kexec(struct kimage *image)
 
 	cpu_proc_fin();
 	setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
-	cpu_reset(reboot_code_buffer_phys);
+	
+	rnk = (relocate_new_kernel_t) reboot_code_buffer;
+	(*rnk)(page_list, reboot_code_buffer_phys, image->start);
 }
-- 
1.6.0.4





More information about the kernel-team mailing list