ufrisk / MemProcFS

MemProcFS
GNU Affero General Public License v3.0
3k stars 371 forks source link

VMMDLL_OPT_PROCESS_DTB #231

Closed pipiw33 closed 11 months ago

pipiw33 commented 11 months ago

delete

ufrisk commented 11 months ago

It quite doesn't work that way. The memory cache is located on the physical memory layer so it will have to be completely cleared anyway. In essence MemProcFS does not know which memory belongs to which process and which memory are shared between multiple processes.

Also some kernel-level structures have to be updated. Slow may be a bit overkill though in some scenarios so it may be possible to speed it up a tiny bit.

But is the half a second really an issue if you're changing DTBs?

ufrisk commented 11 months ago

I've looked into this some more.

It should be possible to greatly speed up this process if doing it on normal processes, (not the system pid 4 process).

pipiw33 commented 11 months ago

that would be really cool.I just set the DTB on the user process

ufrisk commented 11 months ago

I did an update in 5.8.15 just published in the C/C++ API.

I added a new option VMMDLL_OPT_PROCESS_DTB_FAST_LOWINTEGRITY that should do the same thing but pretty much instantly.

Note that it will also clear internal data which will have to be re-generated at first access. Examples of this is the list of modules and VADs. This may still take some time.

But the actual call to set the DTB should now at least be much faster.

Please let me know how it goes, or if you're using some other API than the C/C++ one.

pipiw33 commented 11 months ago

I'll check it quickly

ufrisk commented 11 months ago

Awesome to see the issue was resolved and that it now works well :)

This one was a bit hard for me to test so many thanks for confirming it works fine.