From a4390647f7af6b8a539571b44ab537478f0ae548 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 6 Jul 2021 20:54:56 -0700 Subject: tcg: Move tb_phys_invalidate_count to tb_ctx We can call do_tb_phys_invalidate from an iocontext, which has no per-thread tcg_ctx. Move this to tb_ctx, which is global. The actual update still takes place with a lock held, so only an atomic set is required, not an atomic increment. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/457 Tested-by: Viktor Ashirov Signed-off-by: Richard Henderson --- tcg/region.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'tcg/region.c') diff --git a/tcg/region.c b/tcg/region.c index d3a3658..e64c3ea 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -980,17 +980,3 @@ size_t tcg_code_capacity(void) return capacity; } - -size_t tcg_tb_phys_invalidate_count(void) -{ - unsigned int n_ctxs = qatomic_read(&tcg_cur_ctxs); - unsigned int i; - size_t total = 0; - - for (i = 0; i < n_ctxs; i++) { - const TCGContext *s = qatomic_read(&tcg_ctxs[i]); - - total += qatomic_read(&s->tb_phys_invalidate_count); - } - return total; -} -- cgit v1.1