|
From: Paul M. <le...@li...> - 2007-11-02 03:43:02
|
On Wed, Oct 10, 2007 at 08:28:01AM -0700, Rafael Ignacio Zurita wrote:
> I was trying kexec in sh3 (HP jornada 660lx:
> SH7709 - HD64461) using those kexec-tools. But it gets
> frozen when run "kexec -e". I would wish to know
> what might be the issue.
>
kexec has not had any testing on SH-3 that I know of, so there are bound
to be bugs.
> root@jornada6xx:~$ export KEXEC_EMPTY_ZERO=0x0d001000
> root@jornada6xx:~$ strace kexec -e
> ...
> reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
> 0x45584543 /* LINUX_REBOOT_CMD_
> ??? */Starting new kernel
> kexec information
> segment[0]: 0x0c001000 - 0x0c002000 (0x00001000)
> segment[1]: 0x0c210000 - 0x0c3b8000 (0x001a8000)
> start : 0x8c210000
>
> nothing else happened.
This comes from kexec_info(), the next step after this is the cache flush
and then jumping in to the new code. Thinking about this a bit,
flush_cache_all() on that particular SH-3 is a no-op, so you may have to
explicitly purge the region before doing the jump.
How does something like this work?
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 5c17de5..ffd02b3 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -97,7 +97,8 @@ NORET_TYPE void machine_kexec(struct kimage *image)
relocate_new_kernel_size);
kexec_info(image);
- flush_cache_all();
+ __flush_purge_region((void *)reboot_code_buffer,
+ relocate_new_kernel_size);
/* now call it */
rnk = (relocate_new_kernel_t) reboot_code_buffer;
|