diff options
author | Jan Beulich <JBeulich@suse.com> | 2014-09-24 03:37:00 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-10-08 04:05:49 -0400 |
commit | 3f63572187f5ae6a0a9e5ebee88b57e6f71c3cd4 (patch) | |
tree | 1f4284bcce03be545c681ccd7223e31ecc7c9641 /arch/x86/lib | |
parent | 212be3b2320bcf33eff648bc4e1f0edbf4d90acf (diff) |
x86: Improve cmpxchg16b_emu.S
- don't include unneeded headers
- don't open-code PER_CPU_VAR()
- drop redundant entry point label
- complete unwind annotations
- use .L prefix on local label to not clutter the symbol table
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Link: http://lkml.kernel.org/r/542290BC020000780003807D@mail.emea.novell.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/cmpxchg16b_emu.S | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/arch/x86/lib/cmpxchg16b_emu.S b/arch/x86/lib/cmpxchg16b_emu.S index 1e572c507d06..40a172541ee2 100644 --- a/arch/x86/lib/cmpxchg16b_emu.S +++ b/arch/x86/lib/cmpxchg16b_emu.S | |||
@@ -6,15 +6,8 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | #include <linux/linkage.h> | 8 | #include <linux/linkage.h> |
9 | #include <asm/alternative-asm.h> | ||
10 | #include <asm/frame.h> | ||
11 | #include <asm/dwarf2.h> | 9 | #include <asm/dwarf2.h> |
12 | 10 | #include <asm/percpu.h> | |
13 | #ifdef CONFIG_SMP | ||
14 | #define SEG_PREFIX %gs: | ||
15 | #else | ||
16 | #define SEG_PREFIX | ||
17 | #endif | ||
18 | 11 | ||
19 | .text | 12 | .text |
20 | 13 | ||
@@ -39,24 +32,25 @@ CFI_STARTPROC | |||
39 | # *atomic* on a single cpu (as provided by the this_cpu_xx class of | 32 | # *atomic* on a single cpu (as provided by the this_cpu_xx class of |
40 | # macros). | 33 | # macros). |
41 | # | 34 | # |
42 | this_cpu_cmpxchg16b_emu: | 35 | pushfq_cfi |
43 | pushf | ||
44 | cli | 36 | cli |
45 | 37 | ||
46 | cmpq SEG_PREFIX(%rsi), %rax | 38 | cmpq PER_CPU_VAR((%rsi)), %rax |
47 | jne not_same | 39 | jne .Lnot_same |
48 | cmpq SEG_PREFIX 8(%rsi), %rdx | 40 | cmpq PER_CPU_VAR(8(%rsi)), %rdx |
49 | jne not_same | 41 | jne .Lnot_same |
50 | 42 | ||
51 | movq %rbx, SEG_PREFIX(%rsi) | 43 | movq %rbx, PER_CPU_VAR((%rsi)) |
52 | movq %rcx, SEG_PREFIX 8(%rsi) | 44 | movq %rcx, PER_CPU_VAR(8(%rsi)) |
53 | 45 | ||
54 | popf | 46 | CFI_REMEMBER_STATE |
47 | popfq_cfi | ||
55 | mov $1, %al | 48 | mov $1, %al |
56 | ret | 49 | ret |
57 | 50 | ||
58 | not_same: | 51 | CFI_RESTORE_STATE |
59 | popf | 52 | .Lnot_same: |
53 | popfq_cfi | ||
60 | xor %al,%al | 54 | xor %al,%al |
61 | ret | 55 | ret |
62 | 56 | ||