Sure. I hit this with a generic vhost-vdpa virtio-blk device when
changing the write cache mode.

For virtio-blk, the guest updates virtio_blk_config.wce when switching
between write through and write back. Without this patch, QEMU still
passes the old s->config buffer to VHOST_VDPA_SET_CONFIG, so the backend
does not see the new wce value.

I reproduced it with vdpa_sim_blk. After writing wce=1 and then wce=0,
the byte corresponding to virtio_blk_config.wce in the buffer passed to
VHOST_VDPA_SET_CONFIG remained unchanged without this patch:

guest writes wce=1:
0x0020: 00 00 01 00 ...
guest writes wce=0:
0x0020: 00 00 01 00 ...

With this patch, the same writes are passed down correctly:

guest writes wce=1:
0x0020: 01 00 00 00 ...
guest writes wce=0:
0x0020: 00 00 00 00 ...

So from the guest's perspective the write cache mode change appears to
succeed, but the updated value never reaches the vDPA backend because
VHOST_VDPA_SET_CONFIG receives stale configuration data.

Reply via email to