Skip to content

Commit 6cc7e1d

Browse files
committed
Also only reset if hooks are installed
1 parent 8816883 commit 6cc7e1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

qemu/accel/tcg/translate-all.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1845,8 +1845,10 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
18451845
}
18461846

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

18511853
/*
18521854
* No explicit memory barrier is required -- tb_link_page() makes the

0 commit comments

Comments
 (0)