From 2128e01efc81404fecfcdfe1c7bb282ebd3e87d3 Mon Sep 17 00:00:00 2001 From: mio Date: Tue, 25 Feb 2025 13:52:26 +0800 Subject: [PATCH] Init tcg region buffer --- qemu/tcg/tcg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qemu/tcg/tcg.c b/qemu/tcg/tcg.c index 65703a3a..25d17968 100644 --- a/qemu/tcg/tcg.c +++ b/qemu/tcg/tcg.c @@ -538,7 +538,14 @@ void tcg_region_init(TCGContext *tcg_ctx) } tcg_ctx->tree = g_tree_new(tb_tc_cmp); + // Unicorn: Though this code is taken from CONFIG_USER_ONLY, it is crucial or + // tcg_ctx->region.current is 0 and we will miss a tb_flush when the + // buffer gets full. + { + bool err = tcg_region_initial_alloc__locked(tcg_ctx); + g_assert(!err); + } } /*