[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-7.2 13/21] accel/tcg: Unlock mmap_lock after longjmp
From: |
Richard Henderson |
Subject: |
[PATCH for-7.2 13/21] accel/tcg: Unlock mmap_lock after longjmp |
Date: |
Fri, 12 Aug 2022 11:07:58 -0700 |
The mmap_lock is held around tb_gen_code. While the comment
is correct that the lock is dropped when tb_gen_code runs out
of memory, the lock is *not* dropped when an exception is
raised reading code for translation.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cpu-exec.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index f6c0c0aff6..a9b7053274 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -517,13 +517,11 @@ void cpu_exec_step_atomic(CPUState *cpu)
cpu_tb_exec(cpu, tb, &tb_exit);
cpu_exec_exit(cpu);
} else {
- /*
- * The mmap_lock is dropped by tb_gen_code if it runs out of
- * memory.
- */
#ifndef CONFIG_SOFTMMU
clear_helper_retaddr();
- tcg_debug_assert(!have_mmap_lock());
+ if (have_mmap_lock()) {
+ mmap_unlock();
+ }
#endif
if (qemu_mutex_iothread_locked()) {
qemu_mutex_unlock_iothread();
@@ -930,7 +928,9 @@ int cpu_exec(CPUState *cpu)
#ifndef CONFIG_SOFTMMU
clear_helper_retaddr();
- tcg_debug_assert(!have_mmap_lock());
+ if (have_mmap_lock()) {
+ mmap_unlock();
+ }
#endif
if (qemu_mutex_iothread_locked()) {
qemu_mutex_unlock_iothread();
--
2.34.1
- [PATCH for-7.2 02/21] linux-user/hppa: Allocate page zero as a commpage, (continued)
- [PATCH for-7.2 02/21] linux-user/hppa: Allocate page zero as a commpage, Richard Henderson, 2022/08/12
- [PATCH for-7.2 04/21] linux-user: Honor PT_GNU_STACK, Richard Henderson, 2022/08/12
- [PATCH for-7.2 05/21] tests/tcg/i386: Move smc_code2 to an executable section, Richard Henderson, 2022/08/12
- [PATCH for-7.2 08/21] accel/tcg: Merge tb_htable_lookup into caller, Richard Henderson, 2022/08/12
- [PATCH for-7.2 07/21] accel/tcg: Use bool for page_find_alloc, Richard Henderson, 2022/08/12
- [PATCH for-7.2 10/21] accel/tcg: Properly implement get_page_addr_code for user-only, Richard Henderson, 2022/08/12
- [PATCH for-7.2 11/21] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, Richard Henderson, 2022/08/12
- [PATCH for-7.2 03/21] linux-user/x86_64: Allocate vsyscall page as a commpage, Richard Henderson, 2022/08/12
- [PATCH for-7.2 06/21] accel/tcg: Remove PageDesc code_bitmap, Richard Henderson, 2022/08/12
- [PATCH for-7.2 09/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c, Richard Henderson, 2022/08/12
- [PATCH for-7.2 13/21] accel/tcg: Unlock mmap_lock after longjmp,
Richard Henderson <=
- [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/12
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Ilya Leoshkevich, 2022/08/16
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/16
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Ilya Leoshkevich, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Ilya Leoshkevich, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Ilya Leoshkevich, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/17
- Re: [PATCH for-7.2 14/21] accel/tcg: Hoist get_page_addr_code out of tb_lookup, Richard Henderson, 2022/08/17