Also only reset if hooks are installed

This commit is contained in:
mio 2024-09-21 21:52:38 +08:00
parent 8816883bb3
commit 6cc7e1d431
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -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