[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 42/56] virtio: set low features early on load
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 42/56] virtio: set low features early on load |
Date: |
Mon, 8 Aug 2016 16:04:13 -0500 |
From: "Michael S. Tsirkin" <address@hidden>
virtio migrates the low 32 feature bits twice, the first copy is there
for compatibility but ever since
019a3edbb25f1571e876f8af1ce4c55412939e5d: ("virtio: make features 64bit
wide") it's ignored on load. This is wrong since virtio_net_load tests
self announcement and guest offloads before the second copy including
high feature bits is loaded. This means that self announcement, control
vq and guest offloads are all broken after migration.
Fix it up by loading low feature bits: somewhat ugly since high and low
bits become out of sync temporarily, but seems unavoidable for
compatibility. The right thing to do for new features is probably to
test the host features, anyway.
Fixes: 019a3edbb25f1571e876f8af1ce4c55412939e5d
("virtio: make features 64bit wide")
Cc: address@hidden
Reported-by: Robin Geuze <address@hidden>
Tested-by: Robin Geuze <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit 62cee1a28aada2cce4b0e1fb835d8fc830aed7ac)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 30ede3d..90f86cf 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1506,6 +1506,16 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int
version_id)
}
qemu_get_be32s(f, &features);
+ /*
+ * Temporarily set guest_features low bits - needed by
+ * virtio net load code testing for VIRTIO_NET_F_CTRL_GUEST_OFFLOADS
+ * VIRTIO_NET_F_GUEST_ANNOUNCE and VIRTIO_NET_F_CTRL_VQ.
+ *
+ * Note: devices should always test host features in future - don't create
+ * new dependencies like this.
+ */
+ vdev->guest_features = features;
+
config_len = qemu_get_be32(f);
/*
--
1.9.1
- [Qemu-stable] [PATCH 36/56] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c, (continued)
- [Qemu-stable] [PATCH 36/56] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 37/56] vfio/pci: Fix VGA quirks, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 38/56] nbd: Allow larger requests, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 39/56] scsi-generic: Merge block max xfer len in INQUIRY response, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 40/56] scsi: Advertise limits by blocksize, not 512, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 41/56] target-sparc: fix register corruption in ldstub if there is no write permission, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 44/56] s390x/ipl: fix reboots for migration from different bios, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 46/56] qemu-iotests: Test naming of throttling groups, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 03/56] vl: change runstate only if new state is different from current state, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 45/56] blockdev: Fix regression with the default naming of throttling groups, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 42/56] virtio: set low features early on load,
Michael Roth <=
- [Qemu-stable] [PATCH 43/56] Revert "virtio-net: unbreak self announcement and guest offloads after migration", Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 47/56] util: Fix MIN_NON_ZERO, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 48/56] block/iscsi: fix rounding in iscsi_allocationmap_set, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 50/56] nbd: More debug typo fixes, use correct formats, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 04/56] tools: kvm_stat: Powerpc related fixes, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 49/56] Fix some typos found by codespell, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 52/56] nbd: Limit nbdflags to 16 bits, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 53/56] pcie: fix link active status bit migration, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 51/56] nbd: Don't use *_to_cpup() functions, Michael Roth, 2016/08/08
- [Qemu-stable] [PATCH 55/56] virtio: error out if guest exceeds virtqueue size, Michael Roth, 2016/08/08