From 301e40ed8005306c009978be295ed9a4b725178b Mon Sep 17 00:00:00 2001 From: Alex Bennée Date: Thu, 27 Oct 2016 16:10:00 +0100 Subject: translate-all: add DEBUG_LOCKING asserts This adds asserts to check the locking on the various translation engines structures. There are two sets of structures that are protected by locks. The first the l1map and PageDesc structures used to track which translation blocks are associated with which physical addresses. In user-mode this is covered by the mmap_lock. The second case are TB context related structures which are protected by tb_lock which is also user-mode only. Currently the asserts do nothing in SoftMMU mode but this will change for MTTCG. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20161027151030.20863-4-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini --- bsd-user/mmap.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bsd-user') diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 610f91b285..ee5907330f 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -42,6 +42,11 @@ void mmap_unlock(void) } } +bool have_mmap_lock(void) +{ + return mmap_lock_count > 0 ? true : false; +} + /* Grab lock to make sure things are in a consistent state after fork(). */ void mmap_fork_start(void) { -- cgit v1.2.3-55-g7522