Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-20 Thread liu ping fan
On Fri, Nov 16, 2012 at 8:03 AM, Richard Henderson wrote: > On 2012-11-14 23:47, liu ping fan wrote: >> Probably I made a mistake here, in vhost, log = >> __sync_fetch_and_and(from, 0) is used to fetch 64bits atomically in >> the case 32bits qemu running on 64bits linux. Right? But how can >

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-20 Thread liu ping fan
On Sun, Nov 18, 2012 at 6:04 PM, Avi Kivity wrote: > On 11/15/2012 09:47 AM, liu ping fan wrote: >> On Wed, Nov 14, 2012 at 5:47 PM, Paolo Bonzini wrote: >>> Il 14/11/2012 10:38, liu ping fan ha scritto: On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini wrote: >>> Il 05/11/2012 06:38, Liu

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-18 Thread Avi Kivity
On 11/15/2012 09:47 AM, liu ping fan wrote: > On Wed, Nov 14, 2012 at 5:47 PM, Paolo Bonzini wrote: >> Il 14/11/2012 10:38, liu ping fan ha scritto: >>> On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini wrote: >> Il 05/11/2012 06:38, Liu Ping Fan ha scritto: >>> From: Liu Ping Fan >>> >

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-15 Thread Richard Henderson
On 2012-11-14 23:47, liu ping fan wrote: > Probably I made a mistake here, in vhost, log = > __sync_fetch_and_and(from, 0) is used to fetch 64bits atomically in > the case 32bits qemu running on 64bits linux. Right? But how can > we read 32bits twice in atomic? Seem that no instruction like

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-15 Thread Paolo Bonzini
Il 15/11/2012 08:47, liu ping fan ha scritto: RCU prototype required pointer-sized access, which you cannot make type- >>> But I think that your RCU prototype should rely on atomic of CPU, not >>> gcc‘s atomic. >> >> What's the difference? gcc's atomic produces the same instructions as >> han

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-14 Thread liu ping fan
On Wed, Nov 14, 2012 at 5:47 PM, Paolo Bonzini wrote: > Il 14/11/2012 10:38, liu ping fan ha scritto: >> On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini wrote: > Il 05/11/2012 06:38, Liu Ping Fan ha scritto: >> From: Liu Ping Fan >> >> If out of global lock, we will be challenged

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-14 Thread Paolo Bonzini
Il 14/11/2012 10:38, liu ping fan ha scritto: > On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini wrote: Il 05/11/2012 06:38, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > If out of global lock, we will be challenged by SMP in low level, > so need atomic ops. > > Thi

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-14 Thread liu ping fan
On Tue, Nov 13, 2012 at 6:11 PM, Paolo Bonzini wrote: >> > Il 05/11/2012 06:38, Liu Ping Fan ha scritto: >> > > From: Liu Ping Fan >> > > >> > > If out of global lock, we will be challenged by SMP in low level, >> > > so need atomic ops. >> > > >> > > This file is a wrapper of GCC atomic builtin.

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-13 Thread Paolo Bonzini
> > Il 05/11/2012 06:38, Liu Ping Fan ha scritto: > > > From: Liu Ping Fan > > > > > > If out of global lock, we will be challenged by SMP in low level, > > > so need atomic ops. > > > > > > This file is a wrapper of GCC atomic builtin. > > > > I still object to this. > > > > I know it enforces ty

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-13 Thread Paolo Bonzini
> > Il 05/11/2012 06:38, Liu Ping Fan ha scritto: > > > From: Liu Ping Fan > > > > > > If out of global lock, we will be challenged by SMP in low level, > > > so need atomic ops. > > > > > > This file is a wrapper of GCC atomic builtin. > > > > I still object to this. > > > > I know it enforces ty

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-12 Thread liu ping fan
On Mon, Nov 12, 2012 at 5:54 PM, Paolo Bonzini wrote: > Il 05/11/2012 06:38, Liu Ping Fan ha scritto: >> From: Liu Ping Fan >> >> If out of global lock, we will be challenged by SMP in low level, >> so need atomic ops. >> >> This file is a wrapper of GCC atomic builtin. > > I still object to this

Re: [Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-12 Thread Paolo Bonzini
Il 05/11/2012 06:38, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > If out of global lock, we will be challenged by SMP in low level, > so need atomic ops. > > This file is a wrapper of GCC atomic builtin. I still object to this. I know it enforces type-safety, but it is incomplete. It doe

[Qemu-devel] [PATCH v6 1/8] atomic: introduce atomic operations

2012-11-04 Thread Liu Ping Fan
From: Liu Ping Fan If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is a wrapper of GCC atomic builtin. Signed-off-by: Liu Ping Fan --- include/qemu/atomic.h | 63 + 1 files changed, 63 insertions