Comment 1 for bug 1950144

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2021-11-08 06:34 EDT-------
[Impact]
* unable to read partitions on virtio-block dasd (Regression)

* the problem is that verify is called before virtio_finalize_features() , so a
transitional s390 virtio device still serves native endian
(i.e. big endian) config space, while the driver knows that it
is going to accept VERSION_1, so when reading the config space,
it assumes it got little endian, and byteswaps.

* as a solution for QEMU, we can work around the issue by writing out the
feature bits with VIRTIO_F_VERSION_1 bit set. We (ab)use the
finalize_features config op for this. This isn't enough to
address all vhost devices since these do not get the features
until FEATURES_OK, however it looks like the affected devices
actually never handled the endianness for legacy mode correctly,
so at least that's not a regression.

[Test Plan]
Short: try to read/write virtio-dasd partition table in a kvm guest
Long:
- get access to a dasd device (for this test it is best to pick a dasd that has already been formatted and partitioned in the past,
but can format and partition dasd new if needed).
- configure guest with the full dasd block device as a virtio block device
- boot this guest
- verify whether or not the guest is seeing the pre-created partition on device.

[Fix]

apply kernel upstream commit: 2f9a174f918e (virtio: write back F_VERSION_1 before validate)