Skip to contentSkip to conversation

hw/virtio: Document *_should_notify() are called within rcu_read_lock()

PATCH Superseded Philippe Mathieu-Daudé 2 participants 2 messages May 20, 2021 – May 23, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/virtio: Document *_should_notify() are called within rcu_read_lock()

Such comments make reviewing this file somehow easier.

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..2b4c6c4b875 100644
@@ -2449,6 +2449,7 @@ static void virtio_set_isr(VirtIODevice *vdev, int value)
     }
 }
 
+/* Called within rcu_read_lock().  */
 static bool virtio_split_should_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
     uint16_t old, new;
@@ -2485,6 +2486,7 @@ static bool vring_packed_need_event(VirtQueue *vq, bool wrap,
     return vring_need_event(off, new, old);
 }
 
+/* Called within rcu_read_lock().  */
 static bool virtio_packed_should_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
     VRingPackedDescEvent e;
Signature · 1 line
2.26.3
#1 lore raw
Quoted 3 lines · Philippe Mathieu-Daudé

Such comments make reviewing this file somehow easier.

ok but

Quoted 17 lines
---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +1 -0
index e02544b2df7..2b4c6c4b875 100644
@@ -2449,6 +2449,7 @@ static void virtio_set_isr(VirtIODevice *vdev, int value)
     }
 }
 
+/* Called within rcu_read_lock().  */
 static bool virtio_split_should_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
     uint16_t old, new;

hw/virtio/virtio.c static bool vring_packed_need_event(VirtQueue *vq, bool wrap, · line 2492

Quoted 7 lines
hw/virtio/virtio.c +1 -0
@@ -2485,6 +2486,7 @@ static bool vring_packed_need_event(VirtQueue *vq, bool wrap,
     return vring_need_event(off, new, old);
 }
 
+/* Called within rcu_read_lock().  */
 static bool virtio_packed_should_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
     VRingPackedDescEvent e;

one space before */ please, not two.

Quoted 2 lines
Signature · 1 line
2.26.3