Re: [PATCH 1/2] x86: add user_atomic_cmpxchg_inatomic at uaccess.h

From: H. Peter Anvin
Date: Mon Dec 16 2013 - 11:55:58 EST


On 12/13/2013 10:25 PM, Qiaowei Ren wrote:
> +#ifdef CONFIG_X86_64 \
> + case 8: \
> + { \
> + asm volatile("\t" ASM_STAC "\n" \
> + "1:\t" LOCK_PREFIX "cmpxchgq %4, %2\n" \
> + "2:\t" ASM_CLAC "\n" \
> + "\t.section .fixup, \"ax\"\n" \
> + "3:\tmov %3, %0\n" \
> + "\tjmp 2b\n" \
> + "\t.previous\n" \
> + _ASM_EXTABLE(1b, 3b) \
> + : "+r" (__ret), "=a" (__old), "+m" (*(ptr)) \
> + : "i" (-EFAULT), "r" (__new), "1" (__old) \
> + : "memory" \
> + ); \
> + break; \
> + } \
> +#endif \

This, of course, doesn't work because this is embedded in a macro. I
realize I requested it, but you should still have tested it.

Anyway, I'll fix it up.

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/