qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Missing barriers in hw/virtio.c


From: Rusty Russell
Subject: Re: [Qemu-devel] Missing barriers in hw/virtio.c
Date: Mon, 29 Aug 2011 12:13:47 +0930
User-agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.2.1 (i686-pc-linux-gnu)

On Fri, 26 Aug 2011 15:40:08 +1000, David Gibson <address@hidden> wrote:
> Near the top of hw/virtio.c we have this:
> 
> /* QEMU doesn't strictly need write barriers since everything runs in
>  * lock-step.  We'll leave the calls to wmb() in though to make it
>  obvious for
>  * KVM or if kqemu gets SMP support.
>  * In any case, we must prevent the compiler from reordering the code.
>  * TODO: we likely need some rmb()/mb() as well.
>  */
> 
> #define wmb() __asm__ __volatile__("": : :"memory")
> 
> 
> However, as far as I can tell when using both kvm and io-thread, the
> assertion that barriers aren't necessary just isn't true.  Although it
> probably works on x86 with its strongly ordered model.

That looks very much like it's cribbed from the original lguest code.

Very wrong, please fix!

Thanks,
Rusty.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]