qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: do not relay a previous driver'


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-blk: do not relay a previous driver's WCE configuration to the current
Date: Fri, 20 Sep 2013 11:54:24 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 19.09.2013 um 18:48 hat Paolo Bonzini geschrieben:
> The following sequence happens:
> - the SeaBIOS virtio-blk driver does not support the WCE feature, which
> causes QEMU to disable writeback caching
> 
> - the Linux virtio-blk driver resets the device, finds WCE is available
> but writeback caching is disabled; tells block layer to not send cache
> flush commands
> 
> - the Linux virtio-blk driver sets the DRIVER_OK bit, which causes
> writeback caching to be re-enabled, but the Linux virtio-blk driver does
> not know of this side effect and cache flushes remain disabled
> 
> The bug is at the third step.  If the guest does know about CONFIG_WCE,
> QEMU should ignore the WCE feature's state.  The guest will control the
> cache mode solely using configuration space.  This change makes Linux
> do flushes correctly, but Linux will keep SeaBIOS's writethrough mode.

This sounds fishy. The solutions happens to make recent Linux kernels do
the right thing, but wouldn't drivers that don't know CONFIG_WCE still
fall into the same trap? I guess making a host feature flag dynamic was
a bad idea to start with.

Perhaps we should restrict the magic to disabling WCE in case the guest
doesn't have VIRTIO_BLK_F_WCE, but never allow it to enable WCE even
though we've already advertised that the host doesn't have WCE.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]