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

Philippe Mathieu-Daudé posted 1 patch 2 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/next-importer-push tags/patchew/20210523094040.3516968-1-philmd@redhat.com
hw/virtio/virtio.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Philippe Mathieu-Daudé 2 years, 11 months ago
Such comments make reviewing this file somehow easier.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: only one space before end of comment (mst)
---
 hw/virtio/virtio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index e02544b2df7..130e3568409 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -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;
-- 
2.26.3


Re: [PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Laurent Vivier 2 years, 10 months ago
Le 23/05/2021 à 11:40, Philippe Mathieu-Daudé a écrit :
> Such comments make reviewing this file somehow easier.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: only one space before end of comment (mst)
> ---
>  hw/virtio/virtio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index e02544b2df7..130e3568409 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -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;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Re: [PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Philippe Mathieu-Daudé 2 years, 10 months ago
Hi Michael,

On 5/23/21 11:40 AM, Philippe Mathieu-Daudé wrote:
> Such comments make reviewing this file somehow easier.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: only one space before end of comment (mst)

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

> ---
>  hw/virtio/virtio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index e02544b2df7..130e3568409 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -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;
> 


Re: [PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Philippe Mathieu-Daudé 2 years, 10 months ago
ping?

On 5/23/21 11:40 AM, Philippe Mathieu-Daudé wrote:
> Such comments make reviewing this file somehow easier.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: only one space before end of comment (mst)
> ---
>  hw/virtio/virtio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index e02544b2df7..130e3568409 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -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;
> 


Re: [PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Philippe Mathieu-Daudé 2 years, 9 months ago
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.

On 6/21/21 12:06 PM, Philippe Mathieu-Daudé wrote:
> ping?
> 
> On 5/23/21 11:40 AM, Philippe Mathieu-Daudé wrote:
>> Such comments make reviewing this file somehow easier.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> v2: only one space before end of comment (mst)
>> ---
>>  hw/virtio/virtio.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
>> index e02544b2df7..130e3568409 100644
>> --- a/hw/virtio/virtio.c
>> +++ b/hw/virtio/virtio.c
>> @@ -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;
>>
> 


Re: [PATCH v2] hw/virtio: Document *_should_notify() are called within rcu_read_lock()
Posted by Laurent Vivier 2 years, 9 months ago
Le 06/07/2021 à 12:04, Philippe Mathieu-Daudé a écrit :
> 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.
> 
> On 6/21/21 12:06 PM, Philippe Mathieu-Daudé wrote:
>> ping?

Applied to my trivial-patches branch.

Thanks,
Laurent


>> On 5/23/21 11:40 AM, Philippe Mathieu-Daudé wrote:
>>> Such comments make reviewing this file somehow easier.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>> v2: only one space before end of comment (mst)
>>> ---
>>>  hw/virtio/virtio.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
>>> index e02544b2df7..130e3568409 100644
>>> --- a/hw/virtio/virtio.c
>>> +++ b/hw/virtio/virtio.c
>>> @@ -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;
>>>
>>
> 
>