[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/19] translate-all: call qemu_spin_destroy for PageDesc
From: |
Robert Foley |
Subject: |
[PATCH 07/19] translate-all: call qemu_spin_destroy for PageDesc |
Date: |
Fri, 22 May 2020 12:07:43 -0400 |
From: "Emilio G. Cota" <address@hidden>
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 <address@hidden>
Signed-off-by: Robert Foley <address@hidden>
---
accel/tcg/translate-all.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 3708aab36b..3fb71a1503 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -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;
}
--
2.17.1
- [PATCH 00/19] Add Thread Sanitizer support to QEMU, Robert Foley, 2020/05/22
- [PATCH 01/19] configure: add --enable-tsan flag + fiber annotations for coroutine-ucontext, Robert Foley, 2020/05/22
- [PATCH 02/19] cpu: convert queued work to a QSIMPLEQ, Robert Foley, 2020/05/22
- [PATCH 03/19] thread: add qemu_spin_destroy, Robert Foley, 2020/05/22
- [PATCH 04/19] cputlb: destroy CPUTLB with tlb_destroy, Robert Foley, 2020/05/22
- [PATCH 06/19] tcg: call qemu_spin_destroy for tb->jmp_lock, Robert Foley, 2020/05/22
- [PATCH 07/19] translate-all: call qemu_spin_destroy for PageDesc,
Robert Foley <=
- [PATCH 08/19] thread: add tsan annotations to QemuSpin, Robert Foley, 2020/05/22
- [PATCH 09/19] tests/docker: Added docker build support for TSan., Robert Foley, 2020/05/22
- [PATCH 11/19] accel/tcg: Fixed tsan warnings related to parallel_cpus, Robert Foley, 2020/05/22
- [PATCH 10/19] include/qemu: Added tsan.h for annotations., Robert Foley, 2020/05/22
- [PATCH 12/19] configure: added tsan support for blacklist., Robert Foley, 2020/05/22