qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio


From: Avi Kivity
Subject: Re: [Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio
Date: Tue, 22 Dec 2009 19:28:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0

On 12/22/2009 06:25 PM, Paul Brook wrote:
On Tuesday 22 December 2009, Anthony Liguori wrote:
On 12/22/2009 05:26 AM, Michael S. Tsirkin wrote:
On Tue, Dec 08, 2009 at 06:18:18PM +0200, Michael S. Tsirkin wrote:
The following fixes a class of long-standing bugs in qemu:
when kvm is enabled, guest might access device structures
in memory while they are updated by qemu on another CPU.
In this scenario, memory barriers are necessary to prevent
host CPU from reordering memory accesses, which might confuse
the guest.

This patch only fixes virtio, but other emulated devices
might have a similar bug. They'll need to be discovered
and addressed case by case.
Real devices generally aren't cache coherent, so I'd expect problems to be
rare. I guess theoretically you may need barriers around the MMIO/IO port
handlers, though in practice the KVM context switch probably provides this
anyway.

We're not guaranteed to have a context switch. One thread can update the ring while another consumes it.

--
error compiling committee.c: too many arguments to function





reply via email to

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