Skip to contentSkip to conversation

ix86: improve cmpxchg8b_emu.S

PATCH New Jan Beulich 2 participants 2 messages Sep 24, 2014 – Oct 8, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ix86: improve cmpxchg8b_emu.S

- don't include unneeded headers
- drop redundant entry point label
- complete unwind annotations
- use .L prefix on local labels to not clutter the symbol table

---
 arch/x86/lib/cmpxchg8b_emu.S |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
arch/x86/lib/cmpxchg8b_emu.S +9 -11
@@ -7,11 +7,8 @@
  */
 
 #include <linux/linkage.h>
-#include <asm/alternative-asm.h>
-#include <asm/frame.h>
 #include <asm/dwarf2.h>
 
-
 .text
 
 /*
@@ -30,27 +27,28 @@ CFI_STARTPROC
 # set the whole ZF thing (caller will just compare
 # eax:edx with the expected value)
 #
-cmpxchg8b_emu:
-	pushfl
+	pushfl_cfi
 	cli
 
 	cmpl  (%esi), %eax
-	jne not_same
+	jne .Lnot_same
 	cmpl 4(%esi), %edx
-	jne half_same
+	jne .Lhalf_same
 
 	movl %ebx,  (%esi)
 	movl %ecx, 4(%esi)
 
-	popfl
+	CFI_REMEMBER_STATE
+	popfl_cfi
 	ret
 
- not_same:
+	CFI_RESTORE_STATE
+.Lnot_same:
 	movl  (%esi), %eax
- half_same:
+.Lhalf_same:
 	movl 4(%esi), %edx
 
-	popfl
+	popfl_cfi
 	ret
 
 CFI_ENDPROC
#1 lore raw

[tip:x86/asm] x86: Improve cmpxchg8b_emu.S

x86: Improve cmpxchg8b_emu.S
Commit-ID:  5f1d919a8ca15f450c749227bc5e2e18f3cbfdb4
Gitweb:     http://git.kernel.org/tip/5f1d919a8ca15f450c749227bc5e2e18f3cbfdb4
Author:     Jan Beulich <[email protected]>
AuthorDate: Wed, 24 Sep 2014 08:40:14 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Wed, 8 Oct 2014 10:05:49 +0200

x86: Improve cmpxchg8b_emu.S

- don't include unneeded headers
- drop redundant entry point label
- complete unwind annotations
- use .L prefix on local labels to not clutter the symbol table

---
 arch/x86/lib/cmpxchg8b_emu.S | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
arch/x86/lib/cmpxchg8b_emu.S +9 -11
index 828cb71..b4807fce 100644
@@ -7,11 +7,8 @@
  */
 
 #include <linux/linkage.h>
-#include <asm/alternative-asm.h>
-#include <asm/frame.h>
 #include <asm/dwarf2.h>
 
-
 .text
 
 /*
@@ -30,27 +27,28 @@ CFI_STARTPROC
 # set the whole ZF thing (caller will just compare
 # eax:edx with the expected value)
 #
-cmpxchg8b_emu:
-	pushfl
+	pushfl_cfi
 	cli
 
 	cmpl  (%esi), %eax
-	jne not_same
+	jne .Lnot_same
 	cmpl 4(%esi), %edx
-	jne half_same
+	jne .Lhalf_same
 
 	movl %ebx,  (%esi)
 	movl %ecx, 4(%esi)
 
-	popfl
+	CFI_REMEMBER_STATE
+	popfl_cfi
 	ret
 
- not_same:
+	CFI_RESTORE_STATE
+.Lnot_same:
 	movl  (%esi), %eax
- half_same:
+.Lhalf_same:
 	movl 4(%esi), %edx
 
-	popfl
+	popfl_cfi
 	ret
 
 CFI_ENDPROC