From patchwork Sun Nov 1 10:41:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Rozenfeld X-Patchwork-Id: 56837 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA1AfI3n004574 for ; Sun, 1 Nov 2009 10:41:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbZKAKlL (ORCPT ); Sun, 1 Nov 2009 05:41:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751361AbZKAKlL (ORCPT ); Sun, 1 Nov 2009 05:41:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21157 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbZKAKlK (ORCPT ); Sun, 1 Nov 2009 05:41:10 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA1AfGQH010339 for ; Sun, 1 Nov 2009 05:41:16 -0500 Received: from localhost.localdomain (vpn-6-131.tlv.redhat.com [10.35.6.131]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA1AfEp4007552 for ; Sun, 1 Nov 2009 05:41:15 -0500 Message-ID: <4AED65C9.70602@redhat.com> Date: Sun, 01 Nov 2009 12:41:13 +0200 From: Vadim Rozenfeld User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: kvm@vger.kernel.org Subject: [PATCH] viostor driver.Add memory barrier - synch with fix for Linux guests by Michael S. Tsirkin X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/viostor/virtio_ring.c b/viostor/virtio_ring.c index d099bb8..2911cef 100644 --- a/viostor/virtio_ring.c +++ b/viostor/virtio_ring.c @@ -237,6 +237,8 @@ vring_get_buf( return NULL; } + rmb(); + i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id; *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;