Skip to content

Commit

Permalink
Also only reset if hooks are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Sep 21, 2024
1 parent 8816883 commit 6cc7e1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qemu/accel/tcg/translate-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,10 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
}

/* Undoes tlb_set_dirty in notdirty_write. */
tlb_reset_dirty_by_vaddr(cpu, pc & TARGET_PAGE_MASK,
(pc & ~TARGET_PAGE_MASK) + tb->size);
if (!(HOOK_EXISTS(cpu->uc, UC_HOOK_MEM_READ) || HOOK_EXISTS(cpu->uc, UC_HOOK_MEM_WRITE))) {
tlb_reset_dirty_by_vaddr(cpu, pc & TARGET_PAGE_MASK,
(pc & ~TARGET_PAGE_MASK) + tb->size);
}

/*
* No explicit memory barrier is required -- tb_link_page() makes the
Expand Down

0 comments on commit 6cc7e1d

Please sign in to comment.