Skip to contentSkip to conversation

ARM: kuser: consistently use usr_ret for returning from helpers

PATCH New Will Deacon 3 participants 3 messages Jan 27, 2012 – Jan 30, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: kuser: consistently use usr_ret for returning from helpers

__kuser_cmpxchg64 has a return path using bx lr to get back to the caller. This is actually ok since the code in question is predicated on CONFIG_CPU_32v6K, but for the sake of consistency using the usr_ret macro is probably better.

Cc Nicolas Pitre <[email protected]>
Cc Dave Martin <[email protected]>
---
 arch/arm/kernel/entry-armv.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/entry-armv.S +1 -1
index 3a456c6..be16a48 100644
@@ -790,7 +790,7 @@ __kuser_cmpxchg64:				@ 0xffff0f60
 	smp_dmb	arm
 	rsbs	r0, r3, #0			@ set returned val and C flag
 	ldmfd	sp!, {r4, r5, r6, r7}
-	bx	lr
+	usr_ret	lr
 
 #elif !defined(CONFIG_SMP)
 
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 ARM: kuser: consistently use usr_ret for returning from helpers

Quoted 4 lines · Will Deacon

__kuser_cmpxchg64 has a return path using bx lr to get back to the caller. This is actually ok since the code in question is predicated on CONFIG_CPU_32v6K, but for the sake of consistency using the usr_ret macro is probably better.

Indeed.

Quoted 3 lines
Cc Nicolas Pitre <[email protected]>
Cc Dave Martin <[email protected]>
Quoted 20 lines
---
 arch/arm/kernel/entry-armv.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/entry-armv.S +1 -1
index 3a456c6..be16a48 100644
@@ -790,7 +790,7 @@ __kuser_cmpxchg64:				@ 0xffff0f60
 	smp_dmb	arm
 	rsbs	r0, r3, #0			@ set returned val and C flag
 	ldmfd	sp!, {r4, r5, r6, r7}
-	bx	lr
+	usr_ret	lr
 
 #elif !defined(CONFIG_SMP)
 
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/1 ARM: kuser: consistently use usr_ret for returning from helpers

In reply to Will Deacon
Quoted 8 lines · Will Deacon

__kuser_cmpxchg64 has a return path using bx lr to get back to the caller. This is actually ok since the code in question is predicated on CONFIG_CPU_32v6K, but for the sake of consistency using the usr_ret macro is probably better.

Cc Nicolas Pitre <[email protected]>
Cc Dave Martin <[email protected]>

This matches the way I originally intended usr_ret to be used.

Quoted 20 lines
---
 arch/arm/kernel/entry-armv.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/kernel/entry-armv.S +1 -1
index 3a456c6..be16a48 100644
@@ -790,7 +790,7 @@ __kuser_cmpxchg64:				@ 0xffff0f60
 	smp_dmb	arm
 	rsbs	r0, r3, #0			@ set returned val and C flag
 	ldmfd	sp!, {r4, r5, r6, r7}
-	bx	lr
+	usr_ret	lr
 
 #elif !defined(CONFIG_SMP)
 
Signature · 1 line
1.7.4.1