[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations |
Date: |
Wed, 8 Aug 2012 10:21:41 +0100 |
On 8 August 2012 07:25, Liu Ping Fan <address@hidden> wrote:
> +static inline void atomic_sub(int i, Atomic *v)
> +{
> + asm volatile("lock; subl %1,%0"
> + : "+m" (v->counter)
> + : "ir" (i));
> +}
NAK. We don't want random inline assembly implementations of locking
primitives in QEMU, they are way too hard to keep working with all the
possible host architectures we support. I spent some time a while back
getting rid of the (variously busted) versions we had previously.
If you absolutely must use atomic ops, use the gcc builtins. For
preference, stick to higher level and less error-prone abstractions.
-- PMM
- [Qemu-devel] [PATCH 0/15 v2] prepare unplug out of protection of global lock, Liu Ping Fan, 2012/08/08
- [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Liu Ping Fan, 2012/08/08
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Stefan Hajnoczi, 2012/08/08
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Paolo Bonzini, 2012/08/08
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Peter Maydell, 2012/08/08
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Paolo Bonzini, 2012/08/08
- Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations, Avi Kivity, 2012/08/08
[Qemu-devel] [PATCH 02/15] qom: using atomic ops to re-implement object_ref, Liu Ping Fan, 2012/08/08
[Qemu-devel] [PATCH 03/15] qom: introduce reclaimer to release obj, Liu Ping Fan, 2012/08/08