aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2011-04-04 16:32:10 +0200
committerAurelien Jarno <aurelien@aurel32.net>2011-04-10 22:25:41 +0200
commit8f16753fd6b584f34d47e102d290dbf4d5c94d46 (patch)
tree7ed397c8ae6899d250e84745a9e984a0a0e790d3 /hw
parent7b3da903041eae8e756d5dd29c492e5f043c9954 (diff)
s390x: fix virtio feature bitmap
The feature bitmap in the s390 virtio machine is little endian. To address for that, we need to bswap the values after reading them out. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/s390-virtio-bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 58af164880..60e0135ed8 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -223,7 +223,7 @@ void s390_virtio_device_sync(VirtIOS390Device *dev)
cur_offs += num_vq * VIRTIO_VQCONFIG_LEN;
/* Sync feature bitmap */
- stl_phys(cur_offs, dev->host_features);
+ stl_phys(cur_offs, bswap32(dev->host_features));
dev->feat_offs = cur_offs + dev->feat_len;
cur_offs += dev->feat_len * 2;
@@ -246,7 +246,7 @@ void s390_virtio_device_update_status(VirtIOS390Device *dev)
/* Update guest supported feature bitmap */
- features = ldl_phys(dev->feat_offs);
+ features = bswap32(ldl_phys(dev->feat_offs));
if (vdev->set_features) {
vdev->set_features(vdev, features);
}