[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ipe4w6hf.fsf@rustcorp.com.au>
Date: Wed, 04 Jul 2012 12:57:40 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Rafael Aquini <aquini@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org,
virtualization <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH RFC] virtio-balloon: fix add/get API use
On Mon, 2 Jul 2012 10:33:08 +0300, "Michael S. Tsirkin" <mst@...hat.com> wrote:
> In virtio balloon virtqueue_get_buf might now run concurrently with
> virtqueue_kick. I audited both and this seems safe in practice but
> this is not guaranteed by the API.
> Additionally, a spurious interrupt might in theory make
> virtqueue_get_buf run in parallel with virtqueue_add_buf, which is racy.
>
> While we might try to protect against spurious callbacks it's
> easier to fix the driver: balloon seems to be the only one
> (mis)using the API like this, so let's just fix balloon.
>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
I was thinking of a spinlock, but this is far more elegant.
And I added an explicit reference to the 'virtio: expose added
descriptors immediately.' commit in your commit msg.
Kudos!
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists