* [PATCH] ia64: populate the cmpxchg header with appropriate code
@ 2012-04-03 19:00 Paul Gortmaker
2012-04-10 22:35 ` Paul Gortmaker
0 siblings, 1 reply; 7+ messages in thread
From: Paul Gortmaker @ 2012-04-03 19:00 UTC (permalink / raw)
To: linux-ia64
Cc: linux-kernel, Paul Gortmaker, Tony Luck, Fenghua Yu, David Howells
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 <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/arch/ia64/include/asm/cmpxchg.h b/arch/ia64/include/asm/cmpxchg.h
index 4c96187..4f37dbb 100644
--- a/arch/ia64/include/asm/cmpxchg.h
+++ b/arch/ia64/include/asm/cmpxchg.h
@@ -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 <davidm@hpl.hp.com>
+ */
+
+#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 */
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
index e4076b5..d129e36 100644
--- a/arch/ia64/include/asm/intrinsics.h
+++ b/arch/ia64/include/asm/intrinsics.h
@@ -18,6 +18,7 @@
#else
# include <asm/gcc_intrin.h>
#endif
+#include <asm/cmpxchg.h>
#define ia64_native_get_psr_i() (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I)
@@ -81,119 +82,6 @@ extern unsigned long __bad_increment_for_ia64_fetch_and_add (void);
#define ia64_fetch_and_add(i,v) (ia64_fetchadd(i, v, rel) + (i)) /* return new value */
-/*
- * 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
#ifdef __KERNEL__
--
1.7.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-03 19:00 [PATCH] ia64: populate the cmpxchg header with appropriate code Paul Gortmaker
@ 2012-04-10 22:35 ` Paul Gortmaker
2012-04-11 23:13 ` Tony Luck
0 siblings, 1 reply; 7+ messages in thread
From: Paul Gortmaker @ 2012-04-10 22:35 UTC (permalink / raw)
To: linux-ia64, Tony Luck
Cc: linux-kernel, Paul Gortmaker, Fenghua Yu, David Howells
On Tue, Apr 3, 2012 at 3:00 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> 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 <tony.luck@intel.com>
Hi Tony,
Just wondering if you had a chance to look at this, and
whether it was OK and in your queue.
It has been in linux-next for > 1wk. 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.
Thanks,
Paul.
--
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: David Howells <dhowells@redhat.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>
> diff --git a/arch/ia64/include/asm/cmpxchg.h b/arch/ia64/include/asm/cmpxchg.h
> index 4c96187..4f37dbb 100644
> --- a/arch/ia64/include/asm/cmpxchg.h
> +++ b/arch/ia64/include/asm/cmpxchg.h
> @@ -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 <davidm@hpl.hp.com>
> + */
> +
> +#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 */
> diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
> index e4076b5..d129e36 100644
> --- a/arch/ia64/include/asm/intrinsics.h
> +++ b/arch/ia64/include/asm/intrinsics.h
> @@ -18,6 +18,7 @@
> #else
> # include <asm/gcc_intrin.h>
> #endif
> +#include <asm/cmpxchg.h>
>
> #define ia64_native_get_psr_i() (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I)
>
> @@ -81,119 +82,6 @@ extern unsigned long __bad_increment_for_ia64_fetch_and_add (void);
>
> #define ia64_fetch_and_add(i,v) (ia64_fetchadd(i, v, rel) + (i)) /* return new value */
>
> -/*
> - * 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
>
> #ifdef __KERNEL__
> --
> 1.7.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-10 22:35 ` Paul Gortmaker
@ 2012-04-11 23:13 ` Tony Luck
2012-04-12 0:15 ` Émeric Maschino
0 siblings, 1 reply; 7+ messages in thread
From: Tony Luck @ 2012-04-11 23:13 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linux-ia64, linux-kernel, Fenghua Yu, David Howells
On Tue, Apr 10, 2012 at 3:35 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> 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>
> 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 :-(
> 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
Acked-by: Tony Luck <tony.luck@intel.com>
-Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-11 23:13 ` Tony Luck
@ 2012-04-12 0:15 ` Émeric Maschino
2012-04-12 2:09 ` Tony Luck
2012-04-12 21:52 ` Tony Luck
0 siblings, 2 replies; 7+ messages in thread
From: Émeric Maschino @ 2012-04-12 0:15 UTC (permalink / raw)
To: Tony Luck
Cc: Paul Gortmaker, linux-ia64, linux-kernel, Fenghua Yu, David Howells
Hello,
Will this improve anything w.r.t.
https://bugzilla.kernel.org/show_bug.cgi?id=42757
Emeric
Le 12 avril 2012 01:13, Tony Luck <tony.luck@intel.com> a écrit :
> On Tue, Apr 10, 2012 at 3:35 PM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
>> 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>
>
>> 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 :-(
>
>> 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
>
> Acked-by: Tony Luck <tony.luck@intel.com>
>
> -Tony
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-12 0:15 ` Émeric Maschino
@ 2012-04-12 2:09 ` Tony Luck
2012-04-12 21:52 ` Tony Luck
1 sibling, 0 replies; 7+ messages in thread
From: Tony Luck @ 2012-04-12 2:09 UTC (permalink / raw)
To: Émeric Maschino
Cc: Paul Gortmaker, linux-ia64, linux-kernel, Fenghua Yu, David Howells
On Wed, Apr 11, 2012 at 5:15 PM, Émeric Maschino
<emeric.maschino@gmail.com> wrote:
> Will this improve anything w.r.t.
> https://bugzilla.kernel.org/show_bug.cgi?id=42757
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-12 0:15 ` Émeric Maschino
2012-04-12 2:09 ` Tony Luck
@ 2012-04-12 21:52 ` Tony Luck
2012-04-13 16:07 ` Tony Luck
1 sibling, 1 reply; 7+ messages in thread
From: Tony Luck @ 2012-04-12 21:52 UTC (permalink / raw)
To: Émeric Maschino
Cc: Paul Gortmaker, linux-ia64, linux-kernel, Fenghua Yu,
David Howells, Michel Lespinasse
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:
diff --git a/kernel/futex.c b/kernel/futex.c
index e2b0fb9..9a00bf8 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ia64: populate the cmpxchg header with appropriate code
2012-04-12 21:52 ` Tony Luck
@ 2012-04-13 16:07 ` Tony Luck
0 siblings, 0 replies; 7+ messages in thread
From: Tony Luck @ 2012-04-13 16:07 UTC (permalink / raw)
To: Émeric Maschino
Cc: Paul Gortmaker, linux-ia64, linux-kernel, Fenghua Yu,
David Howells, Michel Lespinasse
On Thu, Apr 12, 2012 at 2:52 PM, Tony Luck <tony.luck@intel.com> wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-13 16:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 19:00 [PATCH] ia64: populate the cmpxchg header with appropriate code Paul Gortmaker
2012-04-10 22:35 ` Paul Gortmaker
2012-04-11 23:13 ` Tony Luck
2012-04-12 0:15 ` Émeric Maschino
2012-04-12 2:09 ` Tony Luck
2012-04-12 21:52 ` Tony Luck
2012-04-13 16:07 ` Tony Luck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®