Re: [virtio] [PATCH v5] virtio-blk: restore VIRTIO_BLK_F_FLUSH and VIRTIO_BLK_F_CONFIG_WCE

From
Paolo Bonzini <>
Date
2015-08-11T16:52:45+00:00
ID
Thread
Re: [virtio] [PATCH v5] virtio-blk: restore VIRTIO_BLK_F_FLUSH and VIRTIO_BLK_F_CONFIG_WCE
On 11/08/2015 16:02, Cornelia Huck wrote:
> > > Do we need to mandate that the device MUST assume the driver is operating
> > > in legacy mode in that case?
> > 
> > Not sure I understand - in what case?
> 
> If it reads writeback without FEATURES_OK having been set.

No, I don't think it's a problem.  For a transitional device:

- the driver MAY read or write writeback before setting the DRIVER or
DRIVER_OK status bit.  So the device simply has to let the driver do
that.  It's okay if it also lets a (buggy) modern driver do that.

- the device MUST NOT modify \field{writeback} as a result of a driver's
write to the status register.  Even a non-transitional device only has
to modify \field{writeback} when it sees FEATURES_OK, so at this point
your device knows that the driver is not operating through the legacy
interface.  So if it sees DRIVER or DRIVER_OK the device can simply do
nothing---if it hurts don't do it.

- the device MUST NOT modify \field{writeback} as a result of a driver's
write to the guest features registers.  Same as the previous buller, if
it hurts don't do it.

v6 will come tomorrow.

Paolo