[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/21] virtio: rng: Check notifier helpers for VIRTIO_CONFIG_IRQ_I
From: |
Michael S. Tsirkin |
Subject: |
[PULL 01/21] virtio: rng: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX |
Date: |
Tue, 26 Dec 2023 04:24:01 -0500 |
From: Mathieu Poirier <mathieu.poirier@linaro.org>
Since the driver doesn't support interrupts, we must return early when
index is set to VIRTIO_CONFIG_IRQ_IDX. Basically the same thing Viresh
did for "91208dd297f2 virtio: i2c: Check notifier helpers for
VIRTIO_CONFIG_IRQ_IDX".
Fixes: 544f0278afca ("virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX")
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Message-Id: <20231025171841.3379663-1-mathieu.poirier@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-user-rng.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/hw/virtio/vhost-user-rng.c b/hw/virtio/vhost-user-rng.c
index efc54cd3fb..24ac1a22c8 100644
--- a/hw/virtio/vhost-user-rng.c
+++ b/hw/virtio/vhost-user-rng.c
@@ -129,6 +129,14 @@ static void vu_rng_guest_notifier_mask(VirtIODevice *vdev,
int idx, bool mask)
{
VHostUserRNG *rng = VHOST_USER_RNG(vdev);
+ /*
+ * We don't support interrupts, return early if index is set to
+ * VIRTIO_CONFIG_IRQ_IDX.
+ */
+ if (idx == VIRTIO_CONFIG_IRQ_IDX) {
+ return;
+ }
+
vhost_virtqueue_mask(&rng->vhost_dev, vdev, idx, mask);
}
@@ -136,6 +144,14 @@ static bool vu_rng_guest_notifier_pending(VirtIODevice
*vdev, int idx)
{
VHostUserRNG *rng = VHOST_USER_RNG(vdev);
+ /*
+ * We don't support interrupts, return early if index is set to
+ * VIRTIO_CONFIG_IRQ_IDX.
+ */
+ if (idx == VIRTIO_CONFIG_IRQ_IDX) {
+ return false;
+ }
+
return vhost_virtqueue_pending(&rng->vhost_dev, idx);
}
--
MST
- [PULL 00/21] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2023/12/26
- [PULL 01/21] virtio: rng: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX,
Michael S. Tsirkin <=
- [PULL 02/21] tests: bios-tables-test: Rename smbios type 4 related test functions, Michael S. Tsirkin, 2023/12/26
- [PULL 03/21] vhost: Add worker backend callouts, Michael S. Tsirkin, 2023/12/26
- [PULL 04/21] vhost-scsi: Add support for a worker thread per virtqueue, Michael S. Tsirkin, 2023/12/26
- [PULL 05/21] hw/acpi: propagate vcpu hotplug after switch to modern interface, Michael S. Tsirkin, 2023/12/26
- [PULL 07/21] Fix bugs when VM shutdown with virtio-gpu unplugged, Michael S. Tsirkin, 2023/12/26
- [PULL 08/21] vdpa: do not set virtio status bits if unneeded, Michael S. Tsirkin, 2023/12/26
- [PULL 09/21] vdpa: add VhostVDPAShared, Michael S. Tsirkin, 2023/12/26
- [PULL 10/21] vdpa: move iova tree to the shared struct, Michael S. Tsirkin, 2023/12/26
- [PULL 11/21] vdpa: move iova_range to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 12/21] vdpa: move shadow_data to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26