Wenzel / libmicrovmi

A cross-platform unified Virtual Machine Introspection API library
https://wenzel.github.io/libmicrovmi/
GNU General Public License v3.0
165 stars 15 forks source link

API: remove get_page_access #168

Open Wenzel opened 3 years ago

Wenzel commented 3 years ago

get_page_access is actually not implemented by hypervisor. the library is supposed to maintain the state of page whose permissions have been modified, and return this state, via this API. So it's a higher-level than we expected.

Example in Libvmi: https://github.com/libvmi/libvmi/blob/master/libvmi/events.c#L667

rageagainsthepc commented 3 years ago

The function you have linked is used to retrieve internally stored vmi events, so that's something entirely different. We are now unable to read page permissions via kvmi. In Xen this would still be possible though (see: https://github.com/Wenzel/libmicrovmi/pull/110/files#diff-80464c41fe16049f9a2f969fe95cb68d2209a0d760f8d7adfe002e260c443d8bR325). I would argue that this is pretty basic hypervisor level functionality.

Wenzel commented 3 years ago

Indeed, good catch. Then we keep this API in the trait, and leave it unimplemented for KVM. The Libvmi Xen driver doesn't actually use the function in the driver implementation: https://github.com/libvmi/libvmi/search?q=xc_get_mem_access