xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes.
@ 2013-03-18 12:18 Alex Bligh
  2013-03-18 13:03 ` [Qemu-devel] " Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 74+ messages in thread
From: Alex Bligh @ 2013-03-18 12:18 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel, Stefano Stabellini
  Cc: George Dunlap, Ian Jackson, Ian Campbell, Alex Bligh, xen-devel

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 <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alex Bligh <alex@alex.org.uk>
---
 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 {
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread
* Re: [PATCH] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes.
@ 2013-03-08 11:18 George Dunlap
  2013-03-08 11:40 ` [PATCHv3] " Alex Bligh
  0 siblings, 1 reply; 74+ messages in thread
From: George Dunlap @ 2013-03-08 11:18 UTC (permalink / raw)
  To: Alex Bligh
  Cc: Ian Campbell, Stefano Stabellini, Konrad Rzeszutek Wilk,
	Ian Jackson, xen-devel, Jan Beulich

On 08/03/13 10:50, Alex Bligh wrote:
>
> --On 8 March 2013 10:35:43 +0000 George Dunlap <George.Dunlap@eu.citrix.com> wrote:
>
>> If you can verify that it's always safe to use qemu without O_DIRECT
>> (or that it's not any safer to use it), then you should just remove
>> it; no point in having options which have no practical effect.  But in
>> that case you should make sure to mention in the commit message why
>> O_DIRECT isn't actually needed.
> How about me adding the following:
>
> This brings PV devices in line with emulated devices. Removing O_DIRECT
> is safe as barrier operations are now correctly passed through.

That sounds good to me -- thanks, Alex.

  -George

^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2013-04-05 15:43 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18 12:18 [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes Alex Bligh
2013-03-18 13:03 ` [Qemu-devel] " Stefan Hajnoczi
     [not found] ` <20130318130349.GB13065@stefanha-thinkpad.redhat.com>
2013-03-18 13:19   ` Alex Bligh
2013-03-18 13:32 ` Paolo Bonzini
     [not found] ` <51471767.8030604@redhat.com>
2013-03-18 13:49   ` [Qemu-devel] " Alex Bligh
     [not found]   ` <7AC8953FE45335FB794B6DFE@Ximines.local>
2013-03-18 14:05     ` Paolo Bonzini
     [not found]     ` <51471F14.7030209@redhat.com>
2013-03-18 14:30       ` Alex Bligh
     [not found]       ` <6D0F4ACDA3B7FCF1A50F8B52@Ximines.local>
2013-03-18 14:49         ` Paolo Bonzini
     [not found]         ` <5147298C.8080900@redhat.com>
2013-03-18 15:40           ` Alex Bligh
     [not found]           ` <A2FA46AE3DD746AD97DC3137@Ximines.local>
2013-03-18 16:19             ` Paolo Bonzini
     [not found]             ` <51473E82.1020806@redhat.com>
2013-03-18 16:53               ` Alex Bligh
2013-03-18 17:38                 ` George Dunlap
2013-03-18 17:47                   ` Alex Bligh
2013-03-18 18:00                   ` Paolo Bonzini
     [not found]                   ` <5147562E.1090203@redhat.com>
2013-03-19 10:06                     ` George Dunlap
     [not found]                     ` <CAFLBxZbL4JC9SBgHzehtfpcjtR5OQN90SPFSTsXRLrpTWUSBsQ@mail.gmail.com>
2013-03-19 10:43                       ` Paolo Bonzini
     [not found]                       ` <5148414C.7060303@redhat.com>
2013-03-19 10:51                         ` George Dunlap
     [not found]                         ` <51484328.4030301@eu.citrix.com>
2013-03-19 11:14                           ` Paolo Bonzini
     [not found]                           ` <5148489C.70808@redhat.com>
2013-03-19 11:21                             ` George Dunlap
2013-03-19 15:12                               ` George Dunlap
     [not found]                               ` <CAFLBxZYGfKJaNZQaZW0kmTdRxDqAbURtHD1kxsY76qQVh_xrkQ@mail.gmail.com>
2013-03-19 15:29                                 ` George Dunlap
     [not found]                                 ` <CAFLBxZbR8RugaTS82OxTTMQgzi+w-4hkooYZ=x_HNFWchg2yiQ@mail.gmail.com>
2013-03-19 19:15                                   ` [Qemu-devel] " Alex Bligh
     [not found]                                   ` <0E09404F0675BA19C550B743@nimrod.local>
2013-03-20 10:24                                     ` Stefano Stabellini
     [not found]                                     ` <alpine.DEB.2.02.1303201020170.17662@kaball.uk.xensource.com>
2013-03-20 10:37                                       ` George Dunlap
     [not found]                                       ` <51499157.2060202@eu.citrix.com>
2013-03-20 11:08                                         ` Paolo Bonzini
     [not found]                                         ` <514998A3.9090903@redhat.com>
2013-03-20 11:20                                           ` Alex Bligh
2013-03-20 11:57                                       ` [Qemu-devel] " David Scott
2013-03-19 11:44                             ` Alex Bligh
     [not found]                             ` <45EC1ED73B198669B314A507@nimrod.local>
2013-03-19 11:49                               ` Paolo Bonzini
2013-03-19 15:13                         ` Stefano Stabellini
     [not found]                         ` <alpine.DEB.2.02.1303191454170.4716@kaball.uk.xensource.com>
2013-03-19 16:53                           ` Paolo Bonzini
     [not found]                           ` <51489818.9040709@redhat.com>
2013-03-19 17:03                             ` Stefano Stabellini
2013-03-20  8:33                           ` Alex Bligh
2013-03-20  9:26                             ` Paolo Bonzini
     [not found]                             ` <514980BD.7010005@redhat.com>
2013-03-29 17:19                               ` Stefano Stabellini
2013-03-31 19:53                                 ` Alex Bligh
     [not found]                                 ` <66DB172ECC6AABDC49D0E5A4@Ximines.local>
2013-04-01 15:32                                   ` [PATCH] [RFC] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-01 15:44                                     ` Stefano Stabellini
     [not found]                                     ` <alpine.DEB.2.02.1304011640460.5078@kaball.uk.xensource.com>
2013-04-01 20:56                                       ` Alex Bligh
     [not found]                                       ` <358184A5C86D79E1A4CD05CA@nimrod.local>
2013-04-02 11:08                                         ` Stefano Stabellini
     [not found]                                         ` <alpine.DEB.2.02.1304021208110.5078@kaball.uk.xensource.com>
2013-04-05 10:31                                           ` [PATCHv2 1/2] " Alex Bligh
     [not found]                                           ` <1365157905-22987-1-git-send-email-alex@alex.org.uk>
2013-04-05 10:31                                             ` [PATCHv2 2/2] Xen PV backend: Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 14:22                                             ` [PATCHv2 1/2] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Stefano Stabellini
     [not found]                                             ` <alpine.DEB.2.02.1304051516460.5078@kaball.uk.xensource.com>
2013-04-05 15:42                                               ` [PATCHv3 " Alex Bligh
     [not found]                                               ` <1365176538-36833-1-git-send-email-alex@alex.org.uk>
2013-04-05 15:42                                                 ` [PATCHv3 2/2] Xen PV backend: Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 15:43                                               ` [Qemu-devel] [PATCHv2 1/2] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-05 10:32                                           ` [PATCHv2 1/2] Xen PV backend (for qemu-upstream-4.2-testing): " Alex Bligh
     [not found]                                           ` <1365157969-23172-1-git-send-email-alex@alex.org.uk>
2013-04-05 10:32                                             ` [PATCHv2 2/2] Xen PV backend (for qemu-upstream-4.2-testing): Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 10:34                                           ` [PATCH] [RFC] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-01 16:35                                   ` [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes Alex Bligh
  -- strict thread matches above, loose matches on Subject: below --
2013-03-08 11:18 [PATCH] " George Dunlap
2013-03-08 11:40 ` [PATCHv3] " Alex Bligh
2013-03-08 12:54   ` George Dunlap
2013-03-11 14:02     ` Alex Bligh
2013-03-11 14:42       ` George Dunlap
2013-03-11 17:48         ` Konrad Rzeszutek Wilk
2013-03-11 17:55           ` Ian Jackson
2013-03-14 17:06             ` Alex Bligh
2013-03-14 18:26               ` Ian Jackson
2013-03-12 12:08         ` Ian Campbell
2013-03-14 18:37   ` Stefano Stabellini
2013-03-14 19:30     ` Ian Jackson
2013-03-14 19:56       ` Alex Bligh
2013-03-15  9:28       ` Ian Campbell
2013-03-15 10:43         ` Stefano Stabellini
2013-03-15 11:21           ` Ian Jackson
2013-03-15 11:28             ` Stefano Stabellini
2013-03-15 11:37               ` Ian Jackson
2013-03-15 11:43                 ` Stefano Stabellini
2013-03-15 12:43                   ` Alex Bligh
2013-03-15 12:50                     ` Ian Campbell
2013-03-15 18:31                   ` Ian Jackson
2013-03-18 10:29                   ` Alex Bligh
2013-03-18 11:47                     ` Stefano Stabellini
2013-03-18 12:21                       ` Alex Bligh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).