notdirty_write: fix store-related performance problems
Every store would always cause the tb_invalidate_phys_page_fast path to be invoked, amounting to a 40x slowdown of stores compared to loads. Change this code to only worry about TB invalidation for regions marked as executable (i.e. emulated executable). Even without uc_set_native_thunks, this change fixes most of the performance issues seen with thunking to native calls. Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
This commit is contained in:
@@ -1843,6 +1843,11 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||
if ((pc & TARGET_PAGE_MASK) != virt_page2) {
|
||||
phys_page2 = get_page_addr_code(env, virt_page2);
|
||||
}
|
||||
|
||||
/* Undoes tlb_set_dirty in notdirty_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
|
||||
* TB visible in a consistent state.
|
||||
|
||||
Reference in New Issue
Block a user