Skip to contentSkip to conversation

ia64: populate the cmpxchg header with appropriate code

PATCH In review Paul Gortmaker 3 participants 7 messages Apr 3, 2012 – Apr 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64: populate the cmpxchg header with appropriate code

commit 93f378883cecb9dcb2cf5b51d9d24175906659da

"Fix ia64 build errors (fallout from system.h disintegration)"

introduced arch/ia64/include/asm/cmpxchg.h as a temporary build fix and stated:

"... leave the migration of xchg() and cmpxchg() to this new
header file for a future patch."

Migrate the appropriate chunks from asm/intrinsics.h and fix the whitespace issues in the migrated chunk.

Cc Tony Luck <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc David Howells <[email protected]>
arch/ia64/include/asm/cmpxchg.h +147 -1
index 4c96187..4f37dbb 100644
@@ -1 +1,147 @@
-#include <asm/intrinsics.h>
+#ifndef _ASM_IA64_CMPXCHG_H
+#define _ASM_IA64_CMPXCHG_H
+
+/*
+ * Compare/Exchange, forked from asm/intrinsics.h
+ * which was:
+ *
+ *	Copyright (C) 2002-2003 Hewlett-Packard Co
+ *	David Mosberger-Tang <[email protected]>
+ */
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+/* include compiler specific intrinsics */
+#include <asm/ia64regs.h>
+#ifdef __INTEL_COMPILER
+# include <asm/intel_intrin.h>
+#else
+# include <asm/gcc_intrin.h>
+#endif
+
+/*
+ * This function doesn't exist, so you'll get a linker error if
+ * something tries to do an invalid xchg().
+ */
+extern void ia64_xchg_called_with_bad_pointer(void);
+
+#define __xchg(x, ptr, size)						\
+({									\
+	unsigned long __xchg_result;					\
+									\
+	switch (size) {							\
+	case 1:								\
+		__xchg_result = ia64_xchg1((__u8 *)ptr, x);		\
+		break;							\
+									\
+	case 2:								\
+		__xchg_result = ia64_xchg2((__u16 *)ptr, x);		\
+		break;							\
+									\
+	case 4:								\
+		__xchg_result = ia64_xchg4((__u32 *)ptr, x);		\
+		break;							\
+									\
+	case 8:								\
+		__xchg_result = ia64_xchg8((__u64 *)ptr, x);		\
+		break;							\
+	default:							\
+		ia64_xchg_called_with_bad_pointer();			\
+	}								\
+	__xchg_result;							\
+})
+
+#define xchg(ptr, x)							\
+((__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr))))
+
+/*
+ * Atomic compare and exchange.  Compare OLD with MEM, if identical,
+ * store NEW in MEM.  Return the initial value in MEM.  Success is
+ * indicated by comparing RETURN with OLD.
+ */
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+/*
+ * This function doesn't exist, so you'll get a linker error
+ * if something tries to do an invalid cmpxchg().
+ */
+extern long ia64_cmpxchg_called_with_bad_pointer(void);
+
+#define ia64_cmpxchg(sem, ptr, old, new, size)				\
+({									\
+	__u64 _o_, _r_;							\
+									\
+	switch (size) {							\
+	case 1:								\
+		_o_ = (__u8) (long) (old);				\
+		break;							\
+	case 2:								\
+		_o_ = (__u16) (long) (old);				\
+		break;							\
+	case 4:								\
+		_o_ = (__u32) (long) (old);				\
+		break;							\
+	case 8:								\
+		_o_ = (__u64) (long) (old);				\
+		break;							\
+	default:							\
+		break;							\
+	}								\
+	switch (size) {							\
+	case 1:								\
+		_r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_);	\
+		break;							\
+									\
+	case 2:								\
+		_r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_);	\
+		break;							\
+									\
+	case 4:								\
+		_r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_);	\
+		break;							\
+									\
+	case 8:								\
+		_r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_);	\
+		break;							\
+									\
+	default:							\
+		_r_ = ia64_cmpxchg_called_with_bad_pointer();		\
+		break;							\
+	}								\
+	(__typeof__(old)) _r_;						\
+})
+
+#define cmpxchg_acq(ptr, o, n)	\
+	ia64_cmpxchg(acq, (ptr), (o), (n), sizeof(*(ptr)))
+#define cmpxchg_rel(ptr, o, n)	\
+	ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr)))
+
+/* for compatibility with other platforms: */
+#define cmpxchg(ptr, o, n)	cmpxchg_acq((ptr), (o), (n))
+#define cmpxchg64(ptr, o, n)	cmpxchg_acq((ptr), (o), (n))
+
+#define cmpxchg_local		cmpxchg
+#define cmpxchg64_local		cmpxchg64
+
+#ifdef CONFIG_IA64_DEBUG_CMPXCHG
+# define CMPXCHG_BUGCHECK_DECL	int _cmpxchg_bugcheck_count = 128;
+# define CMPXCHG_BUGCHECK(v)						\
+do {									\
+	if (_cmpxchg_bugcheck_count-- <= 0) {				\
+		void *ip;						\
+		extern int printk(const char *fmt, ...);		\
+		ip = (void *) ia64_getreg(_IA64_REG_IP);		\
+		printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v));\
+		break;							\
+	}								\
+} while (0)
+#else /* !CONFIG_IA64_DEBUG_CMPXCHG */
+# define CMPXCHG_BUGCHECK_DECL
+# define CMPXCHG_BUGCHECK(v)
+#endif /* !CONFIG_IA64_DEBUG_CMPXCHG */
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* _ASM_IA64_CMPXCHG_H */
arch/ia64/include/asm/intrinsics.h +1 -113

126 lines not on this page · raw message

Signature · 1 line
1.7.9.1
#1 lore raw

T24gVHVlLCBBcHIgMywgMjAxMiBhdCAzOjAwIFBNLCBQYXVsIEdvcnRtYWtlcgo8cGF1bC5nb3J0 bWFrZXJAd2luZHJpdmVyLmNvbT4gd3JvdGU6Cj4gY29tbWl0IDkzZjM3ODg4M2NlY2I5ZGNiMmNm NWI1MWQ5ZDI0MTc1OTA2NjU5ZGEKPgo+IKAgoCJGaXggaWE2NCBidWlsZCBlcnJvcnMgKGZhbGxv dXQgZnJvbSBzeXN0ZW0uaCBkaXNpbnRlZ3JhdGlvbikiCj4KPiBpbnRyb2R1Y2VkIGFyY2gvaWE2 NC9pbmNsdWRlL2FzbS9jbXB4Y2hnLmggYXMgYSB0ZW1wb3JhcnkKPiBidWlsZCBmaXggYW5kIHN0 YXRlZDoKPgo+IKA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SEcgKi8KPiAtIyBkZWZpbmUgQ01QWENIR19CVUdDSEVDS19ERUNMCj4gLSMg ZGVmaW5lIENNUFhDSEdfQlVHQ0hFQ0sodikKPiAtI2VuZGlmIC8qICFDT05GSUdfSUE2NF9ERUJV R19DTVBYQ0hHICovCj4gLQo+IKAjZW5kaWYKPgo+IKAjaWZkZWYgX19LRVJORUxfXwo+IC0tCj4g MS43LjkuMQo+Cj4gLS0KPiBUbyB1bnN1YnNjcmliZSBmcm9tIHRoaXMgbGlzdDogc2VuZCB0aGUg bGluZSAidW5zdWJzY3JpYmUgbGludXgta2VybmVsIiBpbgo+IHRoZSBib2R5IG9mIGEgbWVzc2Fn ZSB0byBtYWpvcmRvbW9Admdlci5rZXJuZWwub3JnCj4gTW9yZSBtYWpvcmRvbW8gaW5mbyBhdCCg aHR0cDovL3ZnZXIua2VybmVsLm9yZy9tYWpvcmRvbW8taW5mby5odG1sCj4gUGxlYXNlIHJlYWQg dGhlIEZBUSBhdCCgaHR0cDovL3d3dy50dXgub3JnL2xrbWwvCg=

Acked-by
#2 lore raw
Quoted 2 lines · Paul Gortmaker

Just wondering if you had a chance to look at this, and whether it was OK and in your queue.

My only concern is whether there are users who just include <asm/intrinsics.h> to get xchg/cmpxchg ... but I guess it should be easy enough for anyone who has breakage in this area to add <asm/cmpxchg.h>

Quoted 1 line

It has been in linux-next for > 1wk.

Sadly there are few testers for ia64 building linux-next ... so this doesn't mean as much as it does for an x86 patch :-(

Quoted 3 lines

 I've got a fix for
arch/alpha and I can bundle this along with it in a pull request if you don't have it in your queue already.

I don't have it queued. If you want to handle it, that is fine. Add an

-Tony

#3 lore raw

Hello,

Will this improve anything w.r.t.
https://bugzilla.kernel.org/show_bug.cgi?idB757

Emeric

Quoted 27 lines · Tony Luck
Quoted 2 lines · Paul Gortmaker

Just wondering if you had a chance to look at this, and whether it was OK and in your queue.

My only concern is whether there are users who just include <asm/intrinsics.h> to get xchg/cmpxchg ... but I guess it should be easy enough for anyone who has breakage in this area to add <asm/cmpxchg.h>

Quoted 1 line

It has been in linux-next for > 1wk.

Sadly there are few testers for ia64 building linux-next ... so this doesn't mean as much as it does for an x86 patch :-(

Quoted 3 lines

 I've got a fix for
arch/alpha and I can bundle this along with it in a pull request if you don't have it in your queue already.

I don't have it queued. If you want to handle it, that is fine. Add an

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 2 lines · Émeric Maschino

Will this improve anything w.r.t.
https://bugzilla.kernel.org/show_bug.cgi?idB757

I'd be amazed if it did ,,, these patches are just moving the same code from one header file to a new one (<asm/cmpxchg.h>) - so I don't expect to see any functional changes.

-Tony

#5 lore raw
In reply to Émeric Maschino

I think that problem with the futex change is not with the ia64 inline parts ... but
with the code that decides whether to enable them. Try this (white-space damaged,
but not intended for prime-time) patch:

kernel/futex.c +2 -0
index e2b0fb9..9a00bf8 100644
@@ -2722,7 +2722,9 @@ static int __init futex_init(void)
         * implementation, the non-functional ones will return
         * -ENOSYS.
         */
+#ifndef CONFIG_IA64
        if (cmpxchg_futex_value_locked(&curval, NULL, 0, 0) = -EFAULT)
+#endif
                futex_cmpxchg_enabled = 1;
 
        for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {

IA64 doesn't return a -EFAULT when we poke at the supposedly invalid user address of "NULL" because we map a special page to catch prefetch references so that loops like "for (p = something; p != NULL; p = p->next) { use p->field }" don't
do unpleasant thinks when the pre-fetcher dereferences the NULL "p".

This patch enables the futexttest suite to run ... perhaps it will help with the other problems too?

-Tony

#6 lore raw
Quoted 2 lines · Tony Luck

IA64 doesn't return a -EFAULT when we poke at the supposedly invalid user address of "NULL" because we map a special page to catch prefetch references

Leaping to conclusions ... fail :-(

If I change the address from NULL to something that isn't mapped ... I still don't
get -EFAULT.

Looking more closely at futex_atomic_cmpxchg_inatomic() for the error case.

-Tony