Skip to content

Commit

Permalink
x86: no robust/pi futex for real i386 CPUs
Browse files Browse the repository at this point in the history
Real i386 CPUs do not have cmpxchg instructions. Catch it before
crashing on an invalid opcode.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 26, 2008
1 parent 12c247a commit f18edc9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/asm-x86/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f18edc9

Please sign in to comment.