aboutsummaryrefslogtreecommitdiff
path: root/translate-all.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2016-07-15 20:58:48 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-13 19:08:43 +0200
commit2e1ae44a4f4a6149fbb9dc812243522f07284700 (patch)
tree7a51473dc23f697f4ea292ea7523d90958228300 /translate-all.c
parent6d21e4208f382dd8ca1f7995a6dd9ea7ca281163 (diff)
tcg: set up tb->page_addr before insertion
This ensures that if we find the TB on the slow path that tb->page_addr is correctly set before being tested. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <20160715175852.30749-9-sergey.fedorov@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'translate-all.c')
-rw-r--r--translate-all.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/translate-all.c b/translate-all.c
index 5a5499ffb6..b6663dc91d 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1131,10 +1131,6 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
{
uint32_t h;
- /* add in the hash table */
- h = tb_hash_func(phys_pc, tb->pc, tb->flags);
- qht_insert(&tcg_ctx.tb_ctx.htable, tb, h);
-
/* add in the page list */
tb_alloc_page(tb, 0, phys_pc & TARGET_PAGE_MASK);
if (phys_page2 != -1) {
@@ -1143,6 +1139,10 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
tb->page_addr[1] = -1;
}
+ /* add in the hash table */
+ h = tb_hash_func(phys_pc, tb->pc, tb->flags);
+ qht_insert(&tcg_ctx.tb_ctx.htable, tb, h);
+
#ifdef DEBUG_TB_CHECK
tb_page_check();
#endif