Skip to contentSkip to conversation

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

PATCH Applied Philippe Mathieu-Daudé 2 participants 6 messages May 23, 2021 – Jul 9, 2021

lore
Share & tools
lore
#0 lore raw

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

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..130e3568409 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
Reviewed-by on v2 1/1
#1 lore raw

Le 23/05/2021 à 11:40, Philippe Mathieu-Daudé a écrit :

Quoted 23 lines

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +1 -0
index e02544b2df7..130e3568409 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;
#2 lore raw
In reply to Philippe Mathieu-Daudé

Hi Michael,

Quoted 5 lines · Philippe Mathieu-Daudé

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

Are you OK if this patch is queued via trivial@?

Quoted 25 lines
---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..130e3568409 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;
#3 lore raw
In reply to Philippe Mathieu-Daudé

ping?

Quoted 30 lines · Philippe Mathieu-Daudé

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..130e3568409 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;
#4 lore raw

Hi Michael, since I asked a modification on v1, I suppose this patch is somehow worth in documentation, so I'm pinging again. It could go via qemu-trival if you ack it.

Quoted 34 lines · Philippe Mathieu-Daudé

ping?

Quoted 30 lines · Philippe Mathieu-Daudé

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..130e3568409 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;
#5 lore raw

Le 06/07/2021 à 12:04, Philippe Mathieu-Daudé a écrit :

Quoted 6 lines

Hi Michael, since I asked a modification on v1, I suppose this patch is somehow worth in documentation, so I'm pinging again. It could go via qemu-trival if you ack it.

Quoted 1 line · Philippe Mathieu-Daudé

ping?

Applied to my trivial-patches branch.

Thanks,
Laurent

Quoted 34 lines
Quoted 32 lines · Philippe Mathieu-Daudé
Quoted 30 lines

Such comments make reviewing this file somehow easier.

---
v2: only one space before end of comment (mst)

---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/virtio.c +2 -0
index e02544b2df7..130e3568409 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;