ARM: 7897/1: kexec: Use the right ISA for relocate_new_kernel
authorDave Martin <dave.martin@linaro.org>
Mon, 25 Nov 2013 13:54:47 +0000 (14:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:54:10 +0000 (14:54 -0700)
commit9b21d37838fca95c85b10abf48f3059236ad5d6c
treee44aefd79b36978b2e3bd7a04e00c20fc35594e0
parent824a5f2628d62a196b67d6bde4a7fd43bd3f1abe
ARM: 7897/1: kexec: Use the right ISA for relocate_new_kernel

commit e2ccba49085ab5d71b092de2a5176eb9b19cc876 upstream.

Copying a function with memcpy() and then trying to execute the
result isn't trivially portable to Thumb.

This patch modifies the kexec soft restart code to copy its
assembler trampoline relocate_new_kernel() using fncpy() instead,
so that relocate_new_kernel can be in the same ISA as the rest of
the kernel without problems.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Reported-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Tested-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Integrated-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/relocate_kernel.S