[PATCH] memory: remove incorrect RCU comment for address_space_read()

Stefan Hajnoczi posted 1 patch 2 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210909141031.958393-1-stefanha@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>
include/exec/memory.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] memory: remove incorrect RCU comment for address_space_read()
Posted by Stefan Hajnoczi 2 years, 7 months ago
Although the doc comment says "Called within RCU critical section" the
address_space_read() function takes the RCU read lock itself. There is
no need for the caller to hold an RCU read lock.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Fixes: b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index c3d417d317..60508a1e19 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -2768,7 +2768,7 @@ static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
  *
  * Return a MemTxResult indicating whether the operation succeeded
  * or failed (eg unassigned memory, device rejected the transaction,
- * IOMMU fault).  Called within RCU critical section.
+ * IOMMU fault).
  *
  * @as: #AddressSpace to be accessed
  * @addr: address within that address space
-- 
2.31.1


Re: [PATCH] memory: remove incorrect RCU comment for address_space_read()
Posted by Philippe Mathieu-Daudé 2 years, 7 months ago
On 9/9/21 4:10 PM, Stefan Hajnoczi wrote:
> Although the doc comment says "Called within RCU critical section" the
> address_space_read() function takes the RCU read lock itself. There is
> no need for the caller to hold an RCU read lock.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Fixes: b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  include/exec/memory.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


Re: [PATCH] memory: remove incorrect RCU comment for address_space_read()
Posted by David Hildenbrand 2 years, 7 months ago
On 09.09.21 16:10, Stefan Hajnoczi wrote:
> Although the doc comment says "Called within RCU critical section" the
> address_space_read() function takes the RCU read lock itself. There is
> no need for the caller to hold an RCU read lock.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Fixes: b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   include/exec/memory.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index c3d417d317..60508a1e19 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -2768,7 +2768,7 @@ static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
>    *
>    * Return a MemTxResult indicating whether the operation succeeded
>    * or failed (eg unassigned memory, device rejected the transaction,
> - * IOMMU fault).  Called within RCU critical section.
> + * IOMMU fault).
>    *
>    * @as: #AddressSpace to be accessed
>    * @addr: address within that address space
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


Re: [PATCH] memory: remove incorrect RCU comment for address_space_read()
Posted by Paolo Bonzini 2 years, 7 months ago
On 09/09/21 16:10, Stefan Hajnoczi wrote:
> Although the doc comment says "Called within RCU critical section" the
> address_space_read() function takes the RCU read lock itself. There is
> no need for the caller to hold an RCU read lock.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Fixes: b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   include/exec/memory.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index c3d417d317..60508a1e19 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -2768,7 +2768,7 @@ static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
>    *
>    * Return a MemTxResult indicating whether the operation succeeded
>    * or failed (eg unassigned memory, device rejected the transaction,
> - * IOMMU fault).  Called within RCU critical section.
> + * IOMMU fault).
>    *
>    * @as: #AddressSpace to be accessed
>    * @addr: address within that address space
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>