diff mbox series

[RFC,4/4] memory: Use rcu traversal in memory_region_to_address_space

Message ID 20230225163141.1209368-5-peterx@redhat.com
State New
Headers show
Series memory: Fix (/ Discuss) a few rcu issues | expand

Commit Message

Peter Xu Feb. 25, 2023, 4:31 p.m. UTC
memory_region_to_address_space() is the only function that walks the
address_spaces list using RCU read lock only.  Use the RCU walker to
reflect that.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 softmmu/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 95cdcaeccf..0b652d9597 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -566,7 +566,7 @@  static AddressSpace *memory_region_to_address_space(MemoryRegion *mr)
     while (mr->container) {
         mr = mr->container;
     }
-    QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
+    QTAILQ_FOREACH_RCU(as, &address_spaces, address_spaces_link) {
         if (mr == as->root) {
             return as;
         }