[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line |
Date: |
Thu, 15 Nov 2018 13:48:27 -0500 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Thu, Nov 15, 2018 at 12:32:00 +0100, Richard Henderson wrote:
> On 11/14/18 2:00 AM, Emilio G. Cota wrote:
> > The following might be related: I'm seeing segfaults with -smp 8
> > and beyond when doing bootup+shutdown of an aarch64 guest on
> > an x86-64 host.
>
> I'm not seeing that. Anything else special on the command-line?
> Are the segv in the code_gen_buffer or elsewhere?
I just spent some time on this. I've noticed two issues:
- All TCG contexts end up using the same hash table, since
we only allocate one table in tcg_context_init. This leads
to memory corruption.
This fixes it (confirmed that there aren't races with helgrind):
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -763,6 +763,14 @@ void tcg_register_thread(void)
err = tcg_region_initial_alloc__locked(tcg_ctx);
g_assert(!err);
qemu_mutex_unlock(®ion.lock);
+
+#ifdef TCG_TARGET_NEED_LDST_OOL_LABELS
+ /* if n == 0, keep the hash table we allocated in tcg_context_init */
+ if (n) {
+ /* Both key and value are raw pointers. */
+ s->ldst_ool_thunks = g_hash_table_new(NULL, NULL);
+ }
+#endif
}
#endif /* !CONFIG_USER_ONLY */
- Segfault in code_gen_buffer. This one I don't have a fix for,
but it's *much* easier to reproduce when -tb-size is very small,
e.g. "-tb-size 5 -smp 2" (BTW it crashes with x86_64 guests too.)
So at first I thought the code cache flushing was the problem,
but I don't see how that could be, at least from a TCGContext
viewpoint -- I agree that clearing the hash table in
tcg_region_assign is a good place to do so.
Thanks,
Emilio
- [Qemu-devel] [PATCH for-4.0 11/17] tcg/aarch64: Use B not BL for tcg_out_goto_long, (continued)
- [Qemu-devel] [PATCH for-4.0 11/17] tcg/aarch64: Use B not BL for tcg_out_goto_long, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 13/17] tcg/arm: Parameterize the temps for tcg_out_tlb_read, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 12/17] tcg/aarch64: Use TCG_TARGET_NEED_LDST_OOL_LABELS, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 14/17] tcg/arm: Add constraints for R0-R5, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 16/17] tcg/arm: Force qemu_ld/st arguments into fixed registers, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 15/17] tcg/arm: Reduce the number of temps for tcg_out_tlb_read, Richard Henderson, 2018/11/12
- [Qemu-devel] [PATCH for-4.0 17/17] tcg/arm: Use TCG_TARGET_NEED_LDST_OOL_LABELS, Richard Henderson, 2018/11/12
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, no-reply, 2018/11/13
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Emilio G. Cota, 2018/11/13
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Richard Henderson, 2018/11/15
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line,
Emilio G. Cota <=
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Richard Henderson, 2018/11/15
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Richard Henderson, 2018/11/15
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Emilio G. Cota, 2018/11/15
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Emilio G. Cota, 2018/11/16
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Richard Henderson, 2018/11/16
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Emilio G. Cota, 2018/11/16
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Richard Henderson, 2018/11/16
- Re: [Qemu-devel] [PATCH for-4.0 00/17] tcg: Move softmmu out-of-line, Emilio G. Cota, 2018/11/16