diff options
author | Borislav Petkov <bp@suse.de> | 2021-05-12 12:33:10 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-05-12 13:22:57 +0300 |
commit | 1bc67873d401e6c2e6e30be7fef21337db07a042 (patch) | |
tree | 439d894c6e30cb505ebf48f201823c3856943655 | |
parent | 64e1f5872a8c3d80bce4686b4ab5dbc6e6bd30c5 (diff) | |
download | linux-1bc67873d401e6c2e6e30be7fef21337db07a042.tar.xz |
x86/asm: Simplify __smp_mb() definition
Drop the bitness ifdeffery in favor of using _ASM_SP,
which is the helper macro for the rSP register specification
for 32 and 64 bit depending on the build.
No functional changes.
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210512093310.5635-1-bp@alien8.de
-rw-r--r-- | arch/x86/include/asm/barrier.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h index 4819d5e5a335..3ba772a69cc8 100644 --- a/arch/x86/include/asm/barrier.h +++ b/arch/x86/include/asm/barrier.h @@ -54,11 +54,8 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, #define dma_rmb() barrier() #define dma_wmb() barrier() -#ifdef CONFIG_X86_32 -#define __smp_mb() asm volatile("lock; addl $0,-4(%%esp)" ::: "memory", "cc") -#else -#define __smp_mb() asm volatile("lock; addl $0,-4(%%rsp)" ::: "memory", "cc") -#endif +#define __smp_mb() asm volatile("lock; addl $0,-4(%%" _ASM_SP ")" ::: "memory", "cc") + #define __smp_rmb() dma_rmb() #define __smp_wmb() barrier() #define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0) |