Commit 3c188518 authored by Mark Rutland's avatar Mark Rutland Committed by Peter Zijlstra

locking/atomic: delete !ARCH_ATOMIC remnants

Now that all architectures implement ARCH_ATOMIC, we can make it
mandatory, removing the Kconfig symbol and logic for !ARCH_ATOMIC.

There should be no functional change as a result of this patch.
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210525140232.53872-33-mark.rutland@arm.com
parent b9b12978
......@@ -11,9 +11,6 @@ source "arch/$(SRCARCH)/Kconfig"
menu "General architecture-dependent options"
config ARCH_ATOMIC
bool
config CRASH_CORE
bool
......
......@@ -2,7 +2,6 @@
config ALPHA
bool
default y
select ARCH_ATOMIC
select ARCH_32BIT_USTAT_F_TINODE
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
......
......@@ -6,7 +6,6 @@
config ARC
def_bool y
select ARC_TIMERS
select ARCH_ATOMIC
select ARCH_HAS_CACHE_LINE_SIZE
select ARCH_HAS_DEBUG_VM_PGTABLE
select ARCH_HAS_DMA_PREP_COHERENT
......
......@@ -3,7 +3,6 @@ config ARM
bool
default y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_BINFMT_FLAT
select ARCH_HAS_DEBUG_VIRTUAL if MMU
select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
......
......@@ -9,7 +9,6 @@ config ARM64
select ACPI_MCFG if (ACPI && PCI)
select ACPI_SPCR_TABLE if ACPI
select ACPI_PPTT if ACPI
select ARCH_ATOMIC
select ARCH_HAS_DEBUG_WX
select ARCH_BINFMT_ELF_STATE
select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
......
......@@ -2,7 +2,6 @@
config CSKY
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_DMA_PREP_COHERENT
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_HAS_SYNC_DMA_FOR_CPU
......
......@@ -2,7 +2,6 @@
config H8300
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_BINFMT_FLAT
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
select BINFMT_FLAT_OLD_ALWAYS_RAM
......
......@@ -5,7 +5,6 @@ comment "Linux Kernel Configuration for Hexagon"
config HEXAGON
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_NO_PREEMPT
# Other pending projects/to-do items.
......
......@@ -8,7 +8,6 @@ menu "Processor type and features"
config IA64
bool
select ARCH_ATOMIC
select ARCH_HAS_DMA_MARK_CLEAN
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
......
......@@ -3,7 +3,6 @@ config M68K
bool
default y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_BINFMT_FLAT
select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
......
......@@ -2,7 +2,6 @@
config MICROBLAZE
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_NO_SWAP
select ARCH_HAS_DMA_PREP_COHERENT
select ARCH_HAS_GCOV_PROFILE_ALL
......
......@@ -3,7 +3,6 @@ config MIPS
bool
default y
select ARCH_32BIT_OFF_T if !64BIT
select ARCH_ATOMIC
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
select ARCH_HAS_FORTIFY_SOURCE
......
......@@ -7,7 +7,6 @@
config NDS32
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_DMA_PREP_COHERENT
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
......
......@@ -2,7 +2,6 @@
config NIOS2
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_DMA_PREP_COHERENT
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
......
......@@ -7,7 +7,6 @@
config OPENRISC
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_DMA_SET_UNCACHED
select ARCH_HAS_DMA_CLEAR_UNCACHED
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
......
......@@ -2,7 +2,6 @@
config PARISC
def_bool y
select ARCH_32BIT_OFF_T if !64BIT
select ARCH_ATOMIC
select ARCH_MIGHT_HAVE_PC_PARPORT
select HAVE_IDE
select HAVE_FUNCTION_TRACER
......
......@@ -118,7 +118,6 @@ config PPC
# Please keep this list sorted alphabetically.
#
select ARCH_32BIT_OFF_T if PPC32
select ARCH_ATOMIC
select ARCH_ENABLE_MEMORY_HOTPLUG
select ARCH_ENABLE_MEMORY_HOTREMOVE
select ARCH_HAS_COPY_MC if PPC64
......
......@@ -12,7 +12,6 @@ config 32BIT
config RISCV
def_bool y
select ARCH_ATOMIC
select ARCH_CLOCKSOURCE_INIT
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
......
......@@ -58,7 +58,6 @@ config S390
# Note: keep this list sorted alphabetically
#
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
select ARCH_ATOMIC
select ARCH_32BIT_USTAT_F_TINODE
select ARCH_BINFMT_ELF_STATE
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
......
......@@ -2,7 +2,6 @@
config SUPERH
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU
select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU
select ARCH_HAVE_CUSTOM_GPIO_H
......
......@@ -13,7 +13,6 @@ config 64BIT
config SPARC
bool
default y
select ARCH_ATOMIC
select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
select ARCH_MIGHT_HAVE_PC_SERIO
select DMA_OPS
......
......@@ -5,7 +5,6 @@ menu "UML-specific options"
config UML
bool
default y
select ARCH_ATOMIC
select ARCH_EPHEMERAL_INODES
select ARCH_HAS_KCOV
select ARCH_NO_PREEMPT
......
......@@ -58,7 +58,6 @@ config X86
#
select ACPI_LEGACY_TABLES_LOOKUP if ACPI
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ARCH_ATOMIC
select ARCH_32BIT_OFF_T if X86_32
select ARCH_CLOCKSOURCE_INIT
select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION
......
......@@ -2,7 +2,6 @@
config XTENSA
def_bool y
select ARCH_32BIT_OFF_T
select ARCH_ATOMIC
select ARCH_HAS_BINFMT_FLAT if !MMU
select ARCH_HAS_DMA_PREP_COHERENT if MMU
select ARCH_HAS_SYNC_DMA_FOR_CPU if MMU
......
......@@ -12,14 +12,6 @@
#include <asm/cmpxchg.h>
#include <asm/barrier.h>
#ifdef CONFIG_ARCH_ATOMIC
#define __ga_cmpxchg arch_cmpxchg
#define __ga_xchg arch_xchg
#else
#define __ga_cmpxchg cmpxchg
#define __ga_xchg xchg
#endif
#ifdef CONFIG_SMP
/* we can build all atomic primitives from cmpxchg */
......@@ -30,7 +22,7 @@ static inline void generic_atomic_##op(int i, atomic_t *v) \
int c, old; \
\
c = v->counter; \
while ((old = __ga_cmpxchg(&v->counter, c, c c_op i)) != c) \
while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
c = old; \
}
......@@ -40,7 +32,7 @@ static inline int generic_atomic_##op##_return(int i, atomic_t *v) \
int c, old; \
\
c = v->counter; \
while ((old = __ga_cmpxchg(&v->counter, c, c c_op i)) != c) \
while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
c = old; \
\
return c c_op i; \
......@@ -52,7 +44,7 @@ static inline int generic_atomic_fetch_##op(int i, atomic_t *v) \
int c, old; \
\
c = v->counter; \
while ((old = __ga_cmpxchg(&v->counter, c, c c_op i)) != c) \
while ((old = arch_cmpxchg(&v->counter, c, c c_op i)) != c) \
c = old; \
\
return c; \
......@@ -120,11 +112,6 @@ ATOMIC_OP(xor, ^)
#undef ATOMIC_OP_RETURN
#undef ATOMIC_OP
#undef __ga_cmpxchg
#undef __ga_xchg
#ifdef CONFIG_ARCH_ATOMIC
#define arch_atomic_add_return generic_atomic_add_return
#define arch_atomic_sub_return generic_atomic_sub_return
......@@ -146,29 +133,4 @@ ATOMIC_OP(xor, ^)
#define arch_atomic_xchg(ptr, v) (arch_xchg(&(ptr)->counter, (v)))
#define arch_atomic_cmpxchg(v, old, new) (arch_cmpxchg(&((v)->counter), (old), (new)))
#else /* CONFIG_ARCH_ATOMIC */
#define atomic_add_return generic_atomic_add_return
#define atomic_sub_return generic_atomic_sub_return
#define atomic_fetch_add generic_atomic_fetch_add
#define atomic_fetch_sub generic_atomic_fetch_sub
#define atomic_fetch_and generic_atomic_fetch_and
#define atomic_fetch_or generic_atomic_fetch_or
#define atomic_fetch_xor generic_atomic_fetch_xor
#define atomic_add generic_atomic_add
#define atomic_sub generic_atomic_sub
#define atomic_and generic_atomic_and
#define atomic_or generic_atomic_or
#define atomic_xor generic_atomic_xor
#define atomic_read(v) READ_ONCE((v)->counter)
#define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i))
#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
#endif /* CONFIG_ARCH_ATOMIC */
#endif /* __ASM_GENERIC_ATOMIC_H */
......@@ -49,8 +49,6 @@ extern s64 generic_atomic64_cmpxchg(atomic64_t *v, s64 o, s64 n);
extern s64 generic_atomic64_xchg(atomic64_t *v, s64 new);
extern s64 generic_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u);
#ifdef CONFIG_ARCH_ATOMIC
#define arch_atomic64_read generic_atomic64_read
#define arch_atomic64_set generic_atomic64_set
#define arch_atomic64_set_release generic_atomic64_set
......@@ -74,31 +72,4 @@ extern s64 generic_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u);
#define arch_atomic64_xchg generic_atomic64_xchg
#define arch_atomic64_fetch_add_unless generic_atomic64_fetch_add_unless
#else /* CONFIG_ARCH_ATOMIC */
#define atomic64_read generic_atomic64_read
#define atomic64_set generic_atomic64_set
#define atomic64_set_release generic_atomic64_set
#define atomic64_add generic_atomic64_add
#define atomic64_add_return generic_atomic64_add_return
#define atomic64_fetch_add generic_atomic64_fetch_add
#define atomic64_sub generic_atomic64_sub
#define atomic64_sub_return generic_atomic64_sub_return
#define atomic64_fetch_sub generic_atomic64_fetch_sub
#define atomic64_and generic_atomic64_and
#define atomic64_fetch_and generic_atomic64_fetch_and
#define atomic64_or generic_atomic64_or
#define atomic64_fetch_or generic_atomic64_fetch_or
#define atomic64_xor generic_atomic64_xor
#define atomic64_fetch_xor generic_atomic64_fetch_xor
#define atomic64_dec_if_positive generic_atomic64_dec_if_positive
#define atomic64_cmpxchg generic_atomic64_cmpxchg
#define atomic64_xchg generic_atomic64_xchg
#define atomic64_fetch_add_unless generic_atomic64_fetch_add_unless
#endif /* CONFIG_ARCH_ATOMIC */
#endif /* _ASM_GENERIC_ATOMIC64_H */
......@@ -97,8 +97,6 @@ unsigned long __generic_xchg(unsigned long x, volatile void *ptr, int size)
__generic_cmpxchg64_local((ptr), (o), (n))
#ifdef CONFIG_ARCH_ATOMIC
#ifndef arch_xchg
#define arch_xchg generic_xchg
#endif
......@@ -114,23 +112,4 @@ unsigned long __generic_xchg(unsigned long x, volatile void *ptr, int size)
#define arch_cmpxchg arch_cmpxchg_local
#define arch_cmpxchg64 arch_cmpxchg64_local
#else /* CONFIG_ARCH_ATOMIC */
#ifndef xchg
#define xchg generic_xchg
#endif
#ifndef cmpxchg_local
#define cmpxchg_local generic_cmpxchg_local
#endif
#ifndef cmpxchg64_local
#define cmpxchg64_local generic_cmpxchg64_local
#endif
#define cmpxchg cmpxchg_local
#define cmpxchg64 cmpxchg64_local
#endif /* CONFIG_ARCH_ATOMIC */
#endif /* __ASM_GENERIC_CMPXCHG_H */
This diff is collapsed.
......@@ -77,12 +77,8 @@
__ret; \
})
#ifdef CONFIG_ARCH_ATOMIC
#include <linux/atomic-arch-fallback.h>
#include <asm-generic/atomic-instrumented.h>
#else
#include <linux/atomic-fallback.h>
#endif
#include <asm-generic/atomic-long.h>
......
......@@ -17,7 +17,6 @@ cat <<EOF |
asm-generic/atomic-instrumented.h
asm-generic/atomic-long.h
linux/atomic-arch-fallback.h
linux/atomic-fallback.h
EOF
while read header; do
OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
......
......@@ -11,7 +11,6 @@ cat <<EOF |
gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h
gen-atomic-long.sh asm-generic/atomic-long.h
gen-atomic-fallback.sh linux/atomic-arch-fallback.h arch_
gen-atomic-fallback.sh linux/atomic-fallback.h
EOF
while read script header args; do
/bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} ${args} > ${LINUXDIR}/include/${header}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment