]> Git Repo - qemu.git/commitdiff
translate-all: call qemu_spin_destroy for PageDesc
authorEmilio G. Cota <[email protected]>
Fri, 12 Jun 2020 19:02:29 +0000 (20:02 +0100)
committerAlex Bennée <[email protected]>
Tue, 16 Jun 2020 13:49:05 +0000 (14:49 +0100)
The radix tree is append-only, but we can fail to insert
a PageDesc if the insertion races with another thread.

Signed-off-by: Emilio G. Cota <[email protected]>
Signed-off-by: Robert Foley <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20200609200738[email protected]>
Message-Id: <20200612190237[email protected]>

accel/tcg/translate-all.c

index c937210e2172913d486d5e931c3b0fcd9a9c43ee..c3d37058a17c6280f4c60710979f21458895e25a 100644 (file)
@@ -547,6 +547,15 @@ static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc)
 #endif
         existing = atomic_cmpxchg(lp, NULL, pd);
         if (unlikely(existing)) {
+#ifndef CONFIG_USER_ONLY
+            {
+                int i;
+
+                for (i = 0; i < V_L2_SIZE; i++) {
+                    qemu_spin_destroy(&pd[i].lock);
+                }
+            }
+#endif
             g_free(pd);
             pd = existing;
         }
This page took 0.024813 seconds and 4 git commands to generate.