From 616becc2dc4c06b9c32906e363902c4b8cf850e6 Mon Sep 17 00:00:00 2001 From: Pranith Kumar Date: Fri, 2 Mar 2018 09:00:48 -0500 Subject: [PATCH] mttcg: translate-all: Enable locking debug in a debug build Enable tcg lock debug asserts in a debug build by default instead of relying on DEBUG_LOCKING. None of the other DEBUG_* macros have asserts, so this patch removes DEBUG_LOCKING and enable these asserts in a debug build. Backports commit 6ac3d7e845549f08473f020c1c70f14b8911a67e from qemu --- qemu/translate-all.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/qemu/translate-all.c b/qemu/translate-all.c index 2ad43bc5..bef5a154 100644 --- a/qemu/translate-all.c +++ b/qemu/translate-all.c @@ -63,7 +63,6 @@ /* #define DEBUG_TB_INVALIDATE */ /* #define DEBUG_TB_FLUSH */ -/* #define DEBUG_LOCKING */ /* make various TB consistency checks */ /* #define DEBUG_TB_CHECK */ @@ -78,20 +77,10 @@ * access to the memory related structures are protected with the * mmap_lock. */ -#ifdef DEBUG_LOCKING -#define DEBUG_MEM_LOCKS 1 -#else -#define DEBUG_MEM_LOCKS 0 -#endif - #ifdef CONFIG_SOFTMMU #define assert_memory_lock() do { /* nothing */ } while (0) #else -#define assert_memory_lock() do { \ - if (DEBUG_MEM_LOCKS) { \ - g_assert(have_mmap_lock()); \ - } \ - } while (0) +#define assert_memory_lock() tcg_debug_assert(have_mmap_lock()) #endif #define SMC_BITMAP_USE_THRESHOLD 10 @@ -132,22 +121,6 @@ typedef struct PageDesc { #define V_L1_MAX_BITS (V_L2_BITS + 3) #define V_L1_MAX_SIZE (1 << V_L1_MAX_BITS) -#ifdef DEBUG_LOCKING -#define DEBUG_TB_LOCKS 1 -#else -#define DEBUG_TB_LOCKS 0 -#endif - -#ifdef CONFIG_SOFTMMU -#define assert_tb_lock() do { /* nothing */ } while (0) -#else -#define assert_tb_lock() do { \ - if (DEBUG_TB_LOCKS) { \ - g_assert(have_tb_lock); \ - } \ - } while (0) -#endif - static TranslationBlock *tb_find_pc(struct uc_struct *uc, uintptr_t tc_ptr); // Unicorn: for cleaning up memory later.