diff options
author | Christoph Lameter <cl@linux.com> | 2011-03-26 21:57:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-27 22:25:36 -0400 |
commit | d7c3f8cee81f4548de0513403b74131aee655576 (patch) | |
tree | 3512188d9be3e429284d094d4bc1fdc2299b92db /arch/x86/lib/cmpxchg16b_emu.S | |
parent | 76597cd31470fa130784c78fadb4dab2e624a723 (diff) |
percpu: Omit segment prefix in the UP case for cmpxchg_double
Omit the segment prefix in the UP case. GS is not used then
and we will generate segfaults if cmpxchg16b is used otherwise.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/lib/cmpxchg16b_emu.S')
-rw-r--r-- | arch/x86/lib/cmpxchg16b_emu.S | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/x86/lib/cmpxchg16b_emu.S b/arch/x86/lib/cmpxchg16b_emu.S index 3e8b08a6de2b..1e572c507d06 100644 --- a/arch/x86/lib/cmpxchg16b_emu.S +++ b/arch/x86/lib/cmpxchg16b_emu.S | |||
@@ -10,6 +10,12 @@ | |||
10 | #include <asm/frame.h> | 10 | #include <asm/frame.h> |
11 | #include <asm/dwarf2.h> | 11 | #include <asm/dwarf2.h> |
12 | 12 | ||
13 | #ifdef CONFIG_SMP | ||
14 | #define SEG_PREFIX %gs: | ||
15 | #else | ||
16 | #define SEG_PREFIX | ||
17 | #endif | ||
18 | |||
13 | .text | 19 | .text |
14 | 20 | ||
15 | /* | 21 | /* |
@@ -37,13 +43,13 @@ this_cpu_cmpxchg16b_emu: | |||
37 | pushf | 43 | pushf |
38 | cli | 44 | cli |
39 | 45 | ||
40 | cmpq %gs:(%rsi), %rax | 46 | cmpq SEG_PREFIX(%rsi), %rax |
41 | jne not_same | 47 | jne not_same |
42 | cmpq %gs:8(%rsi), %rdx | 48 | cmpq SEG_PREFIX 8(%rsi), %rdx |
43 | jne not_same | 49 | jne not_same |
44 | 50 | ||
45 | movq %rbx, %gs:(%rsi) | 51 | movq %rbx, SEG_PREFIX(%rsi) |
46 | movq %rcx, %gs:8(%rsi) | 52 | movq %rcx, SEG_PREFIX 8(%rsi) |
47 | 53 | ||
48 | popf | 54 | popf |
49 | mov $1, %al | 55 | mov $1, %al |