Skip to contentSkip to conversation

memory: remove incorrect RCU comment for address_space_read()

PATCH In review Stefan Hajnoczi 4 participants 4 messages Sep 9, 2021 – Sep 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: remove incorrect RCU comment for address_space_read()

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 <[email protected]>
Fixes b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +1 -1
index c3d417d317..60508a1e19 100644
@@ -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
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Stefan Hajnoczi

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 <[email protected]>
Fixes b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 17 lines · Stefan Hajnoczi

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 <[email protected]>
Fixes b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
---
  include/exec/memory.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +0 -0
index c3d417d317..60508a1e19 100644

include/exec/memory.h static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) · line 2774

Quoted 8 lines
include/exec/memory.h +1 -1
@@ -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
Signature · 3 lines
Thanks,

David / dhildenb
Acked-by on v1 1/1
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 17 lines · Stefan Hajnoczi

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 <[email protected]>
Fixes b2a44fcad74f1cc7a6786d38eba7db12ab2352ba ("address_space_read: address_space_to_flatview needs RCU lock")
---
  include/exec/memory.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +0 -0
index c3d417d317..60508a1e19 100644

include/exec/memory.h static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) · line 2774

Quoted 8 lines
include/exec/memory.h +1 -1
@@ -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