mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-27 13:45:07 +00:00
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. Backports commit 2e1ae44a4f4a6149fbb9dc812243522f07284700 from qemu
This commit is contained in:
parent
30845ae475
commit
62aa0abd02
|
@ -1237,12 +1237,6 @@ static void tb_link_page(struct uc_struct *uc,
|
|||
uint32_t h;
|
||||
TranslationBlock **ptb;
|
||||
|
||||
/* add in the hash table */
|
||||
h = tb_hash_func(phys_pc, tb->pc, tb->flags);
|
||||
ptb = &tcg_ctx->tb_ctx.tb_phys_hash[h];
|
||||
tb->phys_hash_next = *ptb;
|
||||
*ptb = tb;
|
||||
|
||||
/* add in the page list */
|
||||
tb_alloc_page(uc, tb, 0, phys_pc & TARGET_PAGE_MASK);
|
||||
if (phys_page2 != -1) {
|
||||
|
@ -1251,6 +1245,12 @@ static void tb_link_page(struct uc_struct *uc,
|
|||
tb->page_addr[1] = -1;
|
||||
}
|
||||
|
||||
/* add in the hash table */
|
||||
h = tb_hash_func(phys_pc, tb->pc, tb->flags);
|
||||
ptb = &tcg_ctx->tb_ctx.tb_phys_hash[h];
|
||||
tb->phys_hash_next = *ptb;
|
||||
*ptb = tb;
|
||||
|
||||
#ifdef DEBUG_TB_CHECK
|
||||
tb_page_check();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue