diff options
author | Lei Wen <adrian.wenl@gmail.com> | 2011-09-23 04:04:09 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-10-17 04:13:41 -0400 |
commit | 2b034922af2caa19df86f0c502e76cb6f6e910f9 (patch) | |
tree | 023c9962c7f0a53037212b767fa50a8ea346ebec /arch/arm/kernel/machine_kexec.c | |
parent | 7f94e9cc5e965519d865bf20215036f359a1e299 (diff) |
ARM: 7098/1: kdump: copy kernel relocation code at the kexec prepare stage
This copy really don't need to do at the very second before the kernel
would crash.
Signed-off-by: Lei Wen <leiwen@marvell.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/machine_kexec.c')
-rw-r--r-- | arch/arm/kernel/machine_kexec.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index e59bbd496c39..c1b4463dcc83 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -32,6 +32,24 @@ static atomic_t waiting_for_crash_ipi; | |||
32 | 32 | ||
33 | int machine_kexec_prepare(struct kimage *image) | 33 | int machine_kexec_prepare(struct kimage *image) |
34 | { | 34 | { |
35 | unsigned long page_list; | ||
36 | void *reboot_code_buffer; | ||
37 | page_list = image->head & PAGE_MASK; | ||
38 | |||
39 | reboot_code_buffer = page_address(image->control_code_page); | ||
40 | |||
41 | /* Prepare parameters for reboot_code_buffer*/ | ||
42 | kexec_start_address = image->start; | ||
43 | kexec_indirection_page = page_list; | ||
44 | kexec_mach_type = machine_arch_type; | ||
45 | kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; | ||
46 | |||
47 | /* copy our kernel relocation code to the control code page */ | ||
48 | memcpy(reboot_code_buffer, | ||
49 | relocate_new_kernel, relocate_new_kernel_size); | ||
50 | |||
51 | flush_icache_range((unsigned long) reboot_code_buffer, | ||
52 | (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); | ||
35 | return 0; | 53 | return 0; |
36 | } | 54 | } |
37 | 55 | ||
@@ -82,31 +100,14 @@ void (*kexec_reinit)(void); | |||
82 | 100 | ||
83 | void machine_kexec(struct kimage *image) | 101 | void machine_kexec(struct kimage *image) |
84 | { | 102 | { |
85 | unsigned long page_list; | ||
86 | unsigned long reboot_code_buffer_phys; | 103 | unsigned long reboot_code_buffer_phys; |
87 | void *reboot_code_buffer; | 104 | void *reboot_code_buffer; |
88 | 105 | ||
89 | |||
90 | page_list = image->head & PAGE_MASK; | ||
91 | |||
92 | /* we need both effective and real address here */ | 106 | /* we need both effective and real address here */ |
93 | reboot_code_buffer_phys = | 107 | reboot_code_buffer_phys = |
94 | page_to_pfn(image->control_code_page) << PAGE_SHIFT; | 108 | page_to_pfn(image->control_code_page) << PAGE_SHIFT; |
95 | reboot_code_buffer = page_address(image->control_code_page); | 109 | reboot_code_buffer = page_address(image->control_code_page); |
96 | 110 | ||
97 | /* Prepare parameters for reboot_code_buffer*/ | ||
98 | kexec_start_address = image->start; | ||
99 | kexec_indirection_page = page_list; | ||
100 | kexec_mach_type = machine_arch_type; | ||
101 | kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; | ||
102 | |||
103 | /* copy our kernel relocation code to the control code page */ | ||
104 | memcpy(reboot_code_buffer, | ||
105 | relocate_new_kernel, relocate_new_kernel_size); | ||
106 | |||
107 | |||
108 | flush_icache_range((unsigned long) reboot_code_buffer, | ||
109 | (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); | ||
110 | printk(KERN_INFO "Bye!\n"); | 111 | printk(KERN_INFO "Bye!\n"); |
111 | 112 | ||
112 | if (kexec_reinit) | 113 | if (kexec_reinit) |