From: Paul Brook <paul@codesourcery.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio
Date: Tue, 22 Dec 2009 16:25:32 +0000 [thread overview]
Message-ID: <200912221625.33126.paul@codesourcery.com> (raw)
In-Reply-To: <4B30DCFF.8050305@codemonkey.ws>
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.
> >> This is still under test ... meanwhile: any early feedback/flames?
> >
> > Any comments on this one?
> > The patch works fine in my testing, and even though
> > it did not fix a crash that I hoped it will fix,
> > it seems required for correctness... Right?
>
> It's definitely better than what we have. Rusty mentioned something to
> me a bit ago about the barriers for virtio in the kernel needing some
> work. I've been meaning to ask him about it in the context of this patch.
Given this is supposed to be portable code, I wonder if we should have atomic
ordered memory accessors instead.
Paul
next prev parent reply other threads:[~2009-12-22 16:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 16:18 [Qemu-devel] [PATCH-RFC 0/3] qemu: memory barriers in virtio Michael S. Tsirkin
2009-12-22 11:26 ` [Qemu-devel] " Michael S. Tsirkin
2009-12-22 14:51 ` Anthony Liguori
2009-12-22 16:25 ` Paul Brook [this message]
2009-12-22 16:34 ` Michael S. Tsirkin
2009-12-22 22:58 ` Paul Brook
2009-12-22 17:28 ` Avi Kivity
[not found] ` <200912231704.19449.rusty@rustcorp.com.au>
[not found] ` <20091223163600.GD6588@redhat.com>
2010-01-04 2:07 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912221625.33126.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=anthony@codemonkey.ws \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.