linux/arch
Huang Ying df013ffb81 Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG
cmpxchg() is widely used by lockless code, including NMI-safe lockless
code.  But on some architectures, the cmpxchg() implementation is not
NMI-safe, on these architectures the lockless code may need a
spin_trylock_irqsave() based implementation.

This patch adds a Kconfig option: ARCH_HAVE_NMI_SAFE_CMPXCHG, so that
NMI-safe lockless code can depend on it or provide different
implementation according to it.

On many architectures, cmpxchg is only NMI-safe for several specific
operand sizes. So, ARCH_HAVE_NMI_SAFE_CMPXCHG define in this patch
only guarantees cmpxchg is NMI-safe for sizeof(unsigned long).

Signed-off-by: Huang Ying <ying.huang@intel.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Richard Henderson <rth@twiddle.net>
CC: Mikael Starvik <starvik@axis.com>
Acked-by: David Howells <dhowells@redhat.com>
CC: Yoshinori Sato <ysato@users.sourceforge.jp>
CC: Tony Luck <tony.luck@intel.com>
CC: Hirokazu Takata <takata@linux-m32r.org>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Michal Simek <monstr@monstr.eu>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
CC: Kyle McMartin <kyle@mcmartin.ca>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
CC: Chen Liqin <liqin.chen@sunplusct.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Ingo Molnar <mingo@redhat.com>
CC: Chris Zankel <chris@zankel.net>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-08-03 11:12:37 -04:00
..
alpha Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
arm Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-12 14:19:51 -07:00
avr32 Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
blackfin rtc: fix build warnings in defconfigs 2011-06-15 20:04:02 -07:00
cris Merge branch 'setns' 2011-05-28 10:51:01 -07:00
frv Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
h8300 Merge branch 'setns' 2011-05-28 10:51:01 -07:00
ia64 Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
m32r Fix node_start/end_pfn() definition for mm/page_cgroup.c 2011-06-27 14:13:09 -07:00
m68k Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
microblaze Merge branch 'setns' 2011-05-28 10:51:01 -07:00
mips rtc: fix build warnings in defconfigs 2011-06-15 20:04:02 -07:00
mn10300 MN10300: asm/uaccess.h needs to #include linux/kernel.h for might_sleep() 2011-06-21 18:31:44 -07:00
parisc Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
powerpc Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
s390 Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
score arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} 2011-05-26 17:12:38 -07:00
sh Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
sparc Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
tile Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
um um: add asm/percpu.h 2011-06-27 18:00:12 -07:00
unicore32 unicore32: using generic-y format for one line asm-generic files 2011-06-09 16:29:52 +08:00
x86 Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00
xtensa Merge branch 'setns' 2011-05-28 10:51:01 -07:00
.gitignore
Kconfig Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00