[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 04/21] hw/virtio: log potentially buggy guest drivers
From: |
Alex Bennée |
Subject: |
[PATCH v3 04/21] hw/virtio: log potentially buggy guest drivers |
Date: |
Tue, 26 Jul 2022 20:21:33 +0100 |
If the guest driver attempts to use the UNUSED(30) bit it is
potentially buggy as 6.3 Legacy Interface: Reserved Feature Bits
states it "SHOULD NOT be negotiated". For now just log this guest
error.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
hw/virtio/virtio.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5d607aeaa0..97a6307c0f 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2980,6 +2980,13 @@ int virtio_set_features(VirtIODevice *vdev, uint64_t val)
if (vdev->status & VIRTIO_CONFIG_S_FEATURES_OK) {
return -EINVAL;
}
+
+ if (val & (1ull << VIRTIO_F_BAD_FEATURE)) {
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "%s: guest driver for %s has enabled UNUSED(30) feature
bit!\n",
+ __func__, vdev->name);
+ }
+
ret = virtio_set_features_nocheck(vdev, val);
if (virtio_vdev_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
/* VIRTIO_RING_F_EVENT_IDX changes the size of the caches. */
--
2.30.2
- [PATCH v3 for 7.2 00/21] virtio-gpio and various virtio cleanups, Alex Bennée, 2022/07/26
- [PATCH v3 01/21] include/hw/virtio: more comment for VIRTIO_F_BAD_FEATURE, Alex Bennée, 2022/07/26
- [PATCH v3 02/21] include/hw: document vhost_dev feature life-cycle, Alex Bennée, 2022/07/26
- [PATCH v3 03/21] hw/virtio: fix some coding style issues, Alex Bennée, 2022/07/26
- [PATCH v3 15/21] tests/qtest: use qos_printf instead of g_test_message, Alex Bennée, 2022/07/26
- [PATCH v3 06/21] hw/virtio: incorporate backend features in features, Alex Bennée, 2022/07/26
- [PATCH v3 20/21] tests/qtest: add a get_features op to vhost-user-test, Alex Bennée, 2022/07/26
- [PATCH v3 04/21] hw/virtio: log potentially buggy guest drivers,
Alex Bennée <=
- [PATCH v3 05/21] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES, Alex Bennée, 2022/07/26
- [PATCH v3 07/21] hw/virtio: gracefully handle unset vhost_dev vdev, Alex Bennée, 2022/07/26
- [PATCH v3 08/21] hw/virtio: handle un-configured shutdown in virtio-pci, Alex Bennée, 2022/07/26
- [PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint, Alex Bennée, 2022/07/26