]> Git Repo - qemu.git/commitdiff
tcg: set up tb->page_addr before insertion
authorAlex Bennée <[email protected]>
Fri, 15 Jul 2016 17:58:48 +0000 (20:58 +0300)
committerPaolo Bonzini <[email protected]>
Tue, 13 Sep 2016 17:08:43 +0000 (19:08 +0200)
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: <20160715175852[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
translate-all.c

index 5a5499ffb679e608cc6ae71c46603c466103d63e..b6663dc91d66570aa0558a103b44cbfa0bd6e7cf 100644 (file)
@@ -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
This page took 0.027756 seconds and 4 git commands to generate.