[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/11] translate-all: exit cpu_restore_state earl
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v2 05/11] translate-all: exit cpu_restore_state early if translating |
Date: |
Thu, 2 Mar 2017 19:53:31 +0000 |
The translation code uses cpu_ld*_code which can trigger a tlb_fill
which if it fails will attempt a fault resolution. This never works
during translation as the TB being generated hasn't been added yet.
However with the new locking regime we end up double locking the
tb_lock(). As the tcg_ctx.cpu is only set during translation we use
this to short circuit the restore code and return with a fail.
Most front-ends seem to ignore the pass/fail result anyway but
tolerate not having the cpu environment updated. This is arguably ugly
but will do for now.
Signed-off-by: Alex Bennée <address@hidden>
---
translate-all.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/translate-all.c b/translate-all.c
index 7ee273410d..956d54b882 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -333,6 +333,13 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
TranslationBlock *tb;
bool r = false;
+ /* Don't attempt to restore state if we are translating already */
+ if (tcg_ctx.cpu == cpu) {
+ qemu_log_mask(LOG_UNIMP, "Attempt to resolve CPU state @ 0x%" PRIxPTR
+ " while translating\n", retaddr);
+ return r;
+ }
+
tb_lock();
tb = tb_find_pc(retaddr);
if (tb) {
--
2.11.0
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, (continued)
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Peter Maydell, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Alex Bennée, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Peter Maydell, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Richard Henderson, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Eric Blake, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Eric Blake, 2017/03/03
- Re: [Qemu-devel] [PATCH v2 04/11] translate: downgrade IRQ BQL asserts to tcg_debug_assert, Paolo Bonzini, 2017/03/03
[Qemu-devel] [PATCH v2 02/11] target/i386/cpu.h: declare TCG_GUEST_DEFAULT_MO, Alex Bennée, 2017/03/02
[Qemu-devel] [PATCH v2 03/11] cpus.c: add additional error_report when !TARGET_SUPPORT_MTTCG, Alex Bennée, 2017/03/02
[Qemu-devel] [PATCH v2 05/11] translate-all: exit cpu_restore_state early if translating,
Alex Bennée <=
[Qemu-devel] [PATCH v2 06/11] sparc/sparc64: grab BQL before calling cpu_check_irqs, Alex Bennée, 2017/03/02
[Qemu-devel] [PATCH v2 07/11] s390x/misc_helper.c: wrap IO instructions in BQL, Alex Bennée, 2017/03/02
[Qemu-devel] [PATCH v2 08/11] target/xtensa: hold BQL for interrupt processing, Alex Bennée, 2017/03/02