diff mbox

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

Message ID 1360451709-19740-3-git-send-email-ben.dooks@codethink.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Dooks Feb. 9, 2013, 11:15 p.m. UTC
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.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/mm/proc-macros.S |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Ben Dooks Feb. 10, 2013, 1:10 a.m. UTC | #1
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@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
>
>  /*
Sergei Shtylyov Feb. 10, 2013, 2:14 p.m. UTC | #2
Hello.

On 10-02-2013 3:15, Ben Dooks wrote:

> Since the new ASID code introduced in b5466f8728527a05a493cc4abe9e6f034a1bbaab

    Plase also specify that commit's summary in parens (or however you like).

> 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.

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

WBR, Sergei
Ben Dooks Feb. 10, 2013, 2:17 p.m. UTC | #3
On 10/02/2013 14:14, Sergei Shtylyov wrote:
> Hello.
>
> On 10-02-2013 3:15, Ben Dooks wrote:
>
>> Since the new ASID code introduced in 
>> b5466f8728527a05a493cc4abe9e6f034a1bbaab
>
>    Plase also specify that commit's summary in parens (or however you 
> like).
>
>> 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.
>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>
> WBR, Sergei

Thanks, will sort that out and also take into account other feedback 
and
put new patches out today.
diff mbox

Patch

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
 
 /*