From: Alex Bennée <[email protected]> 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 <[email protected]> Reviewed-by: Sergey Fedorov <[email protected]> Signed-off-by: Sergey Fedorov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> --- translate-all.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translate-all.c b/translate-all.c index eaa1232..1ce05ff 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1128,10 +1128,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) { @@ -1140,6 +1136,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 -- 2.7.4
