From f28d0dfdce5754d80d2a5993fff2f5312b32cac1 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Fri, 22 Jun 2018 13:45:31 -0400 Subject: tcg: fix --disable-tcg build breakage Fix the --disable-tcg breakage introduced by tb_lock's removal by relying on the fact that tcg_enabled() is set to 0 at compile-time under --disable-tcg. While at it, add further asserts to fix builds that enable both --disable-tcg and --enable-debug, which were broken even before tb_lock's removal. Tested to build x86_64-softmmu and i386-softmmu targets. Reported-by: Peter Maydell Signed-off-by: Emilio G. Cota Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- exec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 28f9bdcbf9..88edb59060 100644 --- a/exec.c +++ b/exec.c @@ -1323,6 +1323,7 @@ static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length) RAMBlock *block; ram_addr_t end; + assert(tcg_enabled()); end = TARGET_PAGE_ALIGN(start + length); start &= TARGET_PAGE_MASK; @@ -2655,6 +2656,7 @@ void memory_notdirty_write_prepare(NotDirtyInfo *ndi, void memory_notdirty_write_complete(NotDirtyInfo *ndi) { if (ndi->pages) { + assert(tcg_enabled()); page_collection_unlock(ndi->pages); ndi->pages = NULL; } @@ -3046,6 +3048,7 @@ static void tcg_commit(MemoryListener *listener) CPUAddressSpace *cpuas; AddressSpaceDispatch *d; + assert(tcg_enabled()); /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener); -- cgit 1.4.1