From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHaBL-00061C-43 for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHaBB-0007kz-Gc for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:32:55 -0400 Received: from mail-ve0-f175.google.com ([209.85.128.175]:61338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHaBB-0007kt-Cf for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:32:45 -0400 Received: by mail-ve0-f175.google.com with SMTP id cy12so4296265veb.20 for ; Mon, 18 Mar 2013 06:32:45 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51471767.8030604@redhat.com> Date: Mon, 18 Mar 2013 14:32:23 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363609123-20748-1-git-send-email-alex@alex.org.uk> In-Reply-To: <1363609123-20748-1-git-send-email-alex@alex.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , qemu-devel@nongnu.org, xen-devel , Anthony Liguori Il 18/03/2013 13:18, Alex Bligh ha scritto: > Due to what is almost certainly a kernel bug, writes with > O_DIRECT may continue to reference the page after the write > has been marked as completed, particularly in the case of > TCP retransmit. In other scenarios, this "merely" risks > data corruption on the write, but with Xen pages from domU > are only transiently mapped into dom0's memory, resulting > in kernel panics when they are subsequently accessed. > > This brings PV devices in line with emulated devices. Removing > O_DIRECT is safe as barrier operations are now correctly passed > through. > > See: > http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html > for more details. > > This patch has already been applied to the xenbits.org > qemu-upstream repository. > http://xenbits.xen.org/gitweb/?p=qemu-upstream-unstable.git;a=commit;h=f3903bbac78a81fcbce1350cdce860764a62783a > Clearly it should go into qemu's own repository. > > Acked-by: Stefano Stabellini > Signed-off-by: Alex Bligh > --- > hw/xen_disk.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/xen_disk.c b/hw/xen_disk.c > index a402ac8..14f8723 100644 > --- a/hw/xen_disk.c > +++ b/hw/xen_disk.c > @@ -603,7 +603,7 @@ static int blk_init(struct XenDevice *xendev) > } > > /* read-only ? */ > - qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; > + qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO; > if (strcmp(blkdev->mode, "w") == 0) { > qflags |= BDRV_O_RDWR; > } else { > How does migration work with this change? The target may read stale data from the page cache. Fix the kernel bug please. Paolo Paolo