From: Thomas Gleixner Date: Sat, 16 Feb 2008 13:05:01 +0000 (+0100) Subject: x86: no robust/pi futex for real i386 CPUs X-Git-Tag: v2.6.25-rc4~159^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f18edc95a37a901ffcbe91f5e05105f916a04fae;p=linux-2.6-omap-h63xx.git x86: no robust/pi futex for real i386 CPUs Real i386 CPUs do not have cmpxchg instructions. Catch it before crashing on an invalid opcode. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/include/asm-x86/futex.h b/include/asm-x86/futex.h index cd9f894dd2d..c9952ea9f69 100644 --- a/include/asm-x86/futex.h +++ b/include/asm-x86/futex.h @@ -102,6 +102,13 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr) static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) { + +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP) + /* Real i386 machines have no cmpxchg instruction */ + if (boot_cpu_data.x86 == 3) + return -ENOSYS; +#endif + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) return -EFAULT;