[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/10] tcg: code_bitmap is not used by user-mode emu
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 06/10] tcg: code_bitmap is not used by user-mode emulation |
Date: |
Wed, 12 Aug 2015 18:40:58 +0200 |
More #ifdefs are not nice, but this clarifies why its usage is not
protected by tb_lock.
Signed-off-by: Paolo Bonzini <address@hidden>
---
translate-all.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/translate-all.c b/translate-all.c
index a6bff72..7aa5664 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -765,11 +765,15 @@ void tb_free(TranslationBlock *tb)
static inline void invalidate_page_bitmap(PageDesc *p)
{
+#ifdef CONFIG_SOFTMMU
if (p->code_bitmap) {
g_free(p->code_bitmap);
p->code_bitmap = NULL;
}
p->code_write_count = 0;
+#else
+ assert(p->code_bitmap == NULL);
+#endif
}
/* Set to NULL all the 'first_tb' fields in all PageDescs. */
@@ -1001,6 +1005,7 @@ void tb_phys_invalidate(TranslationBlock *tb,
tb_page_addr_t page_addr)
tcg_ctx.tb_ctx.tb_phys_invalidate_count++;
}
+#ifdef CONFIG_SOFTMMU
static void build_page_bitmap(PageDesc *p)
{
int n, tb_start, tb_end;
@@ -1029,6 +1034,7 @@ static void build_page_bitmap(PageDesc *p)
tb = tb->page_next[n];
}
}
+#endif
TranslationBlock *tb_gen_code(CPUState *cpu,
target_ulong pc, target_ulong cs_base,
@@ -1202,6 +1208,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start,
tb_page_addr_t end,
#endif
}
+#ifdef CONFIG_SOFTMMU
/* len must be <= 8 and start must be a multiple of len */
void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
{
@@ -1239,8 +1246,7 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start,
int len)
tb_invalidate_phys_page_range(start, start + len, 1);
}
}
-
-#if !defined(CONFIG_SOFTMMU)
+#else
static void tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc, void *puc,
bool locked)
--
1.8.3.1