-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Notdirty write #2031
Merged
Merged
Optimize Notdirty write #2031
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PhilippTakacs
force-pushed
the
notdirty_write
branch
2 times, most recently
from
October 22, 2024 13:25
443e28d
to
2717b79
Compare
Is it ready? |
Not yet, I have to adjust the check for tlb_reset_dirty_by_vaddr() in tb_gen_code() |
Snapshots only happens when the priority of the memory region is smaller then the snapshot_level. After a snapshot notdirty can be set.
When SMC access the memory region more then once the tb must be rebuild multible times. fixes unicorn-engine#2029
Check all relevant memory hooks before enabling notdirty write. This also checks if the memory hook is registered for the affected region. So it is possible to use notdirty write and have some hooks on different addresses.
when self modifying code does unaligned memory accese sometimes uc->size_recur_mem is changed but for notdirty write not changed back. This causes mem_hooks to be missed. To fix this uc->size_recur_mem is set to 0 before each cpu_exec() call.
PhilippTakacs
force-pushed
the
notdirty_write
branch
from
October 31, 2024 12:51
71f8bf0
to
9bec0ef
Compare
@wtdcode now it's ready |
Cool, look pretty good to me and thanks a lot for adding tests. Would you like to amend your commit history? |
The comment history is already in the way I would like it. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables
notdirty_write
when used with snapshots. To do this the tlb is cleared on a snapshot and the priority of the mr is compared with the snapshot level.It also fixes a bug when the mmu doesn't map 1:1. Before this the memory region was looked up with the vaddr, but memory regions are mapped at the paddr.
It's currently a draft because I also want to improve the
MEM_HOOK
check. As you already noticed in #2029 there are some hooks missing in the check. I would also include a range check for the hooks so only skip the optimization when there is a hook on this address.