-
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
add uc_mem_read_virtual #2121
base: dev
Are you sure you want to change the base?
add uc_mem_read_virtual #2121
Conversation
a977b1e
to
214c007
Compare
I have dreamed of this API for quite a while because It would be cool to even have translation API as suggested, but many QEMU MMU fill implementation has serious side effects. Why does "write_vritual" not work with snapshots? What's the current Lastly please target dev branch instead (for 2.2.0), the master branch is preparing for 2.1.3 and this change can't go into 2.1.3 obviously =). |
Sorry my bad.
It would work, it's just more code and maybe duplicated code, because of the snapshot handling. With a simple virtual to physical API it would be more simple.
In the current QEMU version is |
New api to read from a vaddr. When using the MMU it's useful to direct read from virtual addresses.
214c007
to
74ef179
Compare
CI is failing at this moment and I lack time to fix it. Will do later this week. |
There were also some bugs in my changes which causes the CI to fail.
I have added a testcase (on x86) and read the MMU implementations to verify this would work. As far as I see it works on every MMU expect for SPARC. Would it be OK to just document this issue? About the write: Would it be OK to just have a read implementation at the moment? |
Currently uc_mem_write does COW when memory snapshots are enabled. I would also expect this from a The problem is: This is quite complicated code and with the given |
I just revisited the Btw the typedef struct CPUClass {
// ...
bool (*tlb_fill)(CPUState *cpu, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr);
// ...
} |
The sparc mmu currently doesn't support probe mode which is used by uc_mem_read_virtual. So for now return UC_ERR_ARG when the sparc mmu is used.
New api to read from a vaddr. When using the MMU it's useful to direct read from virtual addresses.
Needs some tests.
I'm not sure about a write_virtual() function. Could also be useful, but is a lot more complex to implement, because of snapshots.
A virtual to physical translate function would be also nice, but currently the
tlb_fill()
function has no probe argument.