|
@@ -143,10 +143,8 @@ void (*kexec_reinit)(void);
|
|
|
|
|
|
void machine_kexec(struct kimage *image)
|
|
|
{
|
|
|
- unsigned long page_list;
|
|
|
- unsigned long reboot_code_buffer_phys;
|
|
|
- unsigned long reboot_entry = (unsigned long)relocate_new_kernel;
|
|
|
- unsigned long reboot_entry_phys;
|
|
|
+ unsigned long page_list, reboot_entry_phys;
|
|
|
+ void (*reboot_entry)(void);
|
|
|
void *reboot_code_buffer;
|
|
|
|
|
|
/*
|
|
@@ -159,9 +157,6 @@ void machine_kexec(struct kimage *image)
|
|
|
|
|
|
page_list = image->head & PAGE_MASK;
|
|
|
|
|
|
- /* we need both effective and real address here */
|
|
|
- reboot_code_buffer_phys =
|
|
|
- page_to_pfn(image->control_code_page) << PAGE_SHIFT;
|
|
|
reboot_code_buffer = page_address(image->control_code_page);
|
|
|
|
|
|
/* Prepare parameters for reboot_code_buffer*/
|
|
@@ -174,10 +169,11 @@ void machine_kexec(struct kimage *image)
|
|
|
|
|
|
/* copy our kernel relocation code to the control code page */
|
|
|
reboot_entry = fncpy(reboot_code_buffer,
|
|
|
- reboot_entry,
|
|
|
+ &relocate_new_kernel,
|
|
|
relocate_new_kernel_size);
|
|
|
- reboot_entry_phys = (unsigned long)reboot_entry +
|
|
|
- (reboot_code_buffer_phys - (unsigned long)reboot_code_buffer);
|
|
|
+
|
|
|
+ /* get the identity mapping physical address for the reboot code */
|
|
|
+ reboot_entry_phys = virt_to_idmap(reboot_entry);
|
|
|
|
|
|
pr_info("Bye!\n");
|
|
|
|