提交 6fad459c 编写于 作者: P Paolo Bonzini 提交者: Richard Henderson

tcg: code_bitmap and code_write_count are not used by user-mode emulation

Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
[Sergey Fedorov: eliminate the field entirely in user-mode]
Signed-off-by: NSergey Fedorov <sergey.fedorov@linaro.org>
Reviewed-by: NRichard Henderson  <rth@twiddle.net>
Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
[rth: merged followup fixup]
Message-Id: <1462982777-4513-1-git-send-email-sergey.fedorov@linaro.org>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 90aa39a1
...@@ -72,11 +72,12 @@ ...@@ -72,11 +72,12 @@
typedef struct PageDesc { typedef struct PageDesc {
/* list of TBs intersecting this ram page */ /* list of TBs intersecting this ram page */
TranslationBlock *first_tb; TranslationBlock *first_tb;
#ifdef CONFIG_SOFTMMU
/* in order to optimize self modifying code, we count the number /* in order to optimize self modifying code, we count the number
of lookups we do to a given page to use a bitmap */ of lookups we do to a given page to use a bitmap */
unsigned int code_write_count; unsigned int code_write_count;
unsigned long *code_bitmap; unsigned long *code_bitmap;
#if defined(CONFIG_USER_ONLY) #else
unsigned long flags; unsigned long flags;
#endif #endif
} PageDesc; } PageDesc;
...@@ -783,9 +784,11 @@ void tb_free(TranslationBlock *tb) ...@@ -783,9 +784,11 @@ void tb_free(TranslationBlock *tb)
static inline void invalidate_page_bitmap(PageDesc *p) static inline void invalidate_page_bitmap(PageDesc *p)
{ {
#ifdef CONFIG_SOFTMMU
g_free(p->code_bitmap); g_free(p->code_bitmap);
p->code_bitmap = NULL; p->code_bitmap = NULL;
p->code_write_count = 0; p->code_write_count = 0;
#endif
} }
/* Set to NULL all the 'first_tb' fields in all PageDescs. */ /* Set to NULL all the 'first_tb' fields in all PageDescs. */
...@@ -1028,6 +1031,7 @@ void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr) ...@@ -1028,6 +1031,7 @@ void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr)
tcg_ctx.tb_ctx.tb_phys_invalidate_count++; tcg_ctx.tb_ctx.tb_phys_invalidate_count++;
} }
#ifdef CONFIG_SOFTMMU
static void build_page_bitmap(PageDesc *p) static void build_page_bitmap(PageDesc *p)
{ {
int n, tb_start, tb_end; int n, tb_start, tb_end;
...@@ -1056,6 +1060,7 @@ static void build_page_bitmap(PageDesc *p) ...@@ -1056,6 +1060,7 @@ static void build_page_bitmap(PageDesc *p)
tb = tb->page_next[n]; tb = tb->page_next[n];
} }
} }
#endif
/* add the tb in the target page and protect it if necessary /* add the tb in the target page and protect it if necessary
* *
...@@ -1412,6 +1417,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end, ...@@ -1412,6 +1417,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
#endif #endif
} }
#ifdef CONFIG_SOFTMMU
/* len must be <= 8 and start must be a multiple of len */ /* 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) void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
{ {
...@@ -1449,8 +1455,7 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len) ...@@ -1449,8 +1455,7 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
tb_invalidate_phys_page_range(start, start + len, 1); tb_invalidate_phys_page_range(start, start + len, 1);
} }
} }
#else
#if !defined(CONFIG_SOFTMMU)
/* Called with mmap_lock held. */ /* Called with mmap_lock held. */
static void tb_invalidate_phys_page(tb_page_addr_t addr, static void tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc, void *puc, uintptr_t pc, void *puc,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册