[PATCH 2/2] ARM: mm: mm->context.id fix for big-endian

Ben Dooks ben.dooks at codethink.co.uk
Sat Feb 9 20:10:02 EST 2013


On 09/02/2013 23:15, Ben Dooks wrote:
> Since the new ASID code introduced in
> b5466f8728527a05a493cc4abe9e6f034a1bbaab
> uses 64bit operations, when running in BE mode we see the values in
> mm->context.id swapped around as the lowest word is being stored in
> mm->context.id + 4, instead of + 0.

The one thing I have just realised with this is that we are no-longer
going to be storing the mm->context.id data in the sat was a pre the
ASID changes, which could confuse debuggers which assume they can read
the data.

Should we fix this the easy way below, or go and change the code
in arch/arm/mm/context.c to deal with re-arranging the atomic64
accesses when in big-endian mode?

> Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
> ---
>  arch/arm/mm/proc-macros.S |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
> index eb6aa73..5a6a347 100644
> --- a/arch/arm/mm/proc-macros.S
> +++ b/arch/arm/mm/proc-macros.S
> @@ -40,7 +40,11 @@
>   * mmid - get context id from mm pointer (mm->context.id)
>   */
>  	.macro	mmid, rd, rn
> +#ifdef __ARMEB__
> +	ldr	\rd, [\rn, #MM_CONTEXT_ID + 4 ]
> +#else
>  	ldr	\rd, [\rn, #MM_CONTEXT_ID]
> +#endif
>  	.endm
>
>  /*




More information about the linux-arm-kernel mailing list