From 658537199bd2381165bf32a6be0d24ffe844c06c Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 7 Feb 2006 23:01:33 -0800 Subject: [PATCH] Add alpha always inline __cmpxchg fix --- ...mpxchg-must-really-always-be-inlined.patch | 45 +++++++++++++++++++ queue/series | 1 + 2 files changed, 46 insertions(+) create mode 100644 queue/__cmpxchg-must-really-always-be-inlined.patch diff --git a/queue/__cmpxchg-must-really-always-be-inlined.patch b/queue/__cmpxchg-must-really-always-be-inlined.patch new file mode 100644 index 00000000000..9eadf8e1340 --- /dev/null +++ b/queue/__cmpxchg-must-really-always-be-inlined.patch @@ -0,0 +1,45 @@ +From stable-bounces@linux.kernel.org Tue Feb 7 22:31:44 2006 +Date: Wed, 8 Feb 2006 07:24:17 +0100 +From: Norbert Tretkowski +To: stable@kernel.org +Cc: +Subject: [alpha] __cmpxchg() must really always be inlined + +From: Steve Langasek + +With the latest 2.6.15 kernel builds for alpha on Debian, we ran into a +problem with undefined references to __cmpxchg_called_with_bad_pointer() in +a couple of kernel modules (xfs.ko and drm.ko; see +http://bugs.debian.org/347556). + +It looks like people have been trying to out-clever each other wrt the +definition of "inline" on this architecture :), with the result that +__cmpxchg(), which must be inlined so the compiler can see its argument is +const, is not guaranteed to be inlined. Indeed, it was not being inlined +when building with -Os. + +The attached patch fixes the issue by adding an +__attribute__((always_inline)) explicitly to the definition of __cmpxchg() +instead of relying on redefines of "inline" elsewhere to make this happen. + +Cc: Richard Henderson +Cc: Ivan Kokshaysky +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Chris Wright +--- + + include/asm-alpha/system.h | 2 +- + 1 files changed, 1 insertion(+), 1 deletion(-) + +--- linux-2.6.15.3.orig/include/asm-alpha/system.h ++++ linux-2.6.15.3/include/asm-alpha/system.h +@@ -562,7 +562,7 @@ __cmpxchg_u64(volatile long *m, unsigned + if something tries to do an invalid cmpxchg(). */ + extern void __cmpxchg_called_with_bad_pointer(void); + +-static inline unsigned long ++static __always_inline unsigned long + __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) + { + switch (size) { diff --git a/queue/series b/queue/series index 7f6d79a35b3..aecb661b5dd 100644 --- a/queue/series +++ b/queue/series @@ -20,3 +20,4 @@ bridge-netfilter-races-on-device-removal.patch bridge-fix-rcu-race-on-device-removal.patch emu10k1-fix-the-confliction-of-front-control.patch x86_64-dont-record-local-apic-ids-when-they-are-disabled-in-madt.patch +__cmpxchg-must-really-always-be-inlined.patch -- 2.47.3