[RFC PATCH] ARM: kexec: Assemble relocate code in ARM mode

Taras Kondratiuk taras.kondratiuk at linaro.org
Thu Oct 10 09:44:50 EDT 2013


On 10 October 2013 12:02, Will Deacon <will.deacon at arm.com> wrote:
> On Wed, Oct 09, 2013 at 09:57:03PM +0100, Taras Kondratiuk wrote:
>> In Thumb2 kernel (CONFIG_THUMB2_KERNEL) kexec's relocate code is assembled
>> in Thumb2 mode, but cpu_v7_reset() jumps to this code in ARM state,
>> because its address is page aligned and has 0 in LSB.
>
> This used to work, but Dave broken it when he fixed the reset code in
> 153cd8e839b5 ("ARM: 7553/1: proc-v7: Ensure correct instruction set after
> cpu_reset").
>
>> Assemble this code in ARM mode to fix the issue.
>
> In the interest of keeping kexec a possibility for v7m, it might be better
> to do something similar to head.S (i.e. switch back to thumb if we're a
> thumb-2 kernel).
>

Actually only v7 jumps here in ARM, so maybe it worth to wrap the patch with
CONFIG_CPU_V7? In this case v7m won't be touched.

I'll update patch with a stub that switches back to Thumb, but honestly
I don't see a bit sense of it here. Anyway at the end of this function
instruction set is switched again.

-- 
Regards,
Taras Kondratiuk



More information about the linux-arm-kernel mailing list