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
This commit is contained in:
Pranith Kumar 2018-03-02 09:00:48 -05:00 committed by Lioncash
parent 89d8e58718
commit 616becc2dc
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -63,7 +63,6 @@
/* #define DEBUG_TB_INVALIDATE */ /* #define DEBUG_TB_INVALIDATE */
/* #define DEBUG_TB_FLUSH */ /* #define DEBUG_TB_FLUSH */
/* #define DEBUG_LOCKING */
/* make various TB consistency checks */ /* make various TB consistency checks */
/* #define DEBUG_TB_CHECK */ /* #define DEBUG_TB_CHECK */
@ -78,20 +77,10 @@
* access to the memory related structures are protected with the * access to the memory related structures are protected with the
* mmap_lock. * mmap_lock.
*/ */
#ifdef DEBUG_LOCKING
#define DEBUG_MEM_LOCKS 1
#else
#define DEBUG_MEM_LOCKS 0
#endif
#ifdef CONFIG_SOFTMMU #ifdef CONFIG_SOFTMMU
#define assert_memory_lock() do { /* nothing */ } while (0) #define assert_memory_lock() do { /* nothing */ } while (0)
#else #else
#define assert_memory_lock() do { \ #define assert_memory_lock() tcg_debug_assert(have_mmap_lock())
if (DEBUG_MEM_LOCKS) { \
g_assert(have_mmap_lock()); \
} \
} while (0)
#endif #endif
#define SMC_BITMAP_USE_THRESHOLD 10 #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_BITS (V_L2_BITS + 3)
#define V_L1_MAX_SIZE (1 << V_L1_MAX_BITS) #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); static TranslationBlock *tb_find_pc(struct uc_struct *uc, uintptr_t tc_ptr);
// Unicorn: for cleaning up memory later. // Unicorn: for cleaning up memory later.