[PATCH] ARM: mvebu: Fix the operand list in the inline asm of armada_370_xp_pmsu_idle_enter
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Sat Jul 5 00:08:16 PDT 2014
Dear Gregory CLEMENT,
On Fri, 4 Jul 2014 16:22:16 +0200, Gregory CLEMENT wrote:
> In the inline asm part of the function armada_370_xp_pmsu_idle_enter()
> the input operand was used. The intent here was to let the compiler
> choose this register so it could do the optimization it
> needed.
>
> However an input operand is not supposed to be modified by the inline
> asm code. This can lead to improper generated instructions.
>
> In some case generated instruction the compiler made the choice to
> reuse the same register to store the return value. But in the assembly
> part this register was modified, so it can lead to return an wrong
> value.
>
> The fix is to use a clobber. Thanks to this the compiler will know
> that the value of this register will be modified.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
More information about the linux-arm-kernel
mailing list