-
Notifications
You must be signed in to change notification settings - Fork 408
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
Investigate a way to retrieve device physical memory ranges #19
Comments
I found a way to obtain ranges from a driver bud decided not to use the ranges and initialize all EPT entries for the ranges. How to get rangesThis Source.cpp.txt lets you get ranges of RAM, Reserved, Loader Reserved and PCI memory ranges, which seem to cover all possible physical addresses that can be accessed by the kernel and devices. This ConsiderationUsing the ranges and allocating all EPT entries would have some benefits. Primary one would be (1) taking off limitation in a number of EPT entries that can be allocated at the run-time. Currently, only However, allocating all EPT entries for all those ranges would take significantly large amount of non paged pool. For example, the largest range in the attached log equals to 454912 pages, which takes 888+ (454912 / 512 .. 512 = a number of pages that can be managed with 4096 bytes of an EPT entry) pages of non paged pool to manage. Considering the fact that current code only takes 50 pages (defined by Also, there is a limited benefit actually, I have seen neither a bug check due to (1) nor user perceived slowness due to (3), for example. While (2) is a benefit, taking off pre-allocation code could lead to a bug check when outside of the enumerated ranges is accessed for some reason (may be because the ranges do not cover all addresses, for example?). Therefore, I do not think allocating all EPT entries based on the enumerated ranges and taking off pre-allocation code is not a sensitive approach. |
Satoshi, Using 2MB and 1GB mappings you can map MMIO very efficiently using only a minimal amount of NP. This is the approach SimpleVisor takes. |
I have been forgotten those options until I saw the updates in SimpleVisor. At this time, priority of this enhancement is low since it is optimization (for readability and run-time performance) which does not provide any values directly, but it is an worthwhile idea., especially if we could achieve it with lower memory consumption. I reopen the ticket for further investigation with the idea on large EPT mappings. Thanks! |
Instead re-using the same ticket, I have created #29 since it has an different goal from what this ticket intended for originally. |
Attached code in How to hide a hook: A hypervisor for rootkits uses the below registry data to retrieve physical memory ranges.
It seems that it contains physical memory ranges for devices, which is not listed by MmGetPhysicalMemoryRanges(). If we can obtain device memory ranges, we may be able to delete EPT entries pre-allocation code because we could allocate all of them at initialization stage.
Investigate the contents of the registry data and update code if possible.
The text was updated successfully, but these errors were encountered: