POSTS

GQueue Ported to TinyVMI

Port GQueue to TinyVMI. Ongoing LibVMI use multiple caches to temporarily store the fetched information (or reconstructed information) from the target virtual machine. This week a cache called memory_cache_lru is re-implemented in order to keep consistent with the original LibVMI code.

memory_cache_lru is conceptually similar to TLB in an operating system, which stores the virtual address to phisical address mapping in an order of latest recent unused(LRU). LibVMI uses GQueue in GLib to manage the memory cache LRU list, and TinyVMI previously used a hand-crafted double linked list to store the LRU list. However, it might be not so efficient as the GQueue implementations. Therefore, in order to find out which one is more efficient, and keep TinyVMI with optimal performance, a GQueue version of LRU list are ported.

Main work is to port the implementations of GQueue from GLib. To keep it minimal, only the functions that LibVMI uses are ported. The code includes queue.h and queue.c. Most of them are directly copied from GLib source code, while all the unused parts are commented out. Commented codes are left in the source file in case these functions could be useful in the future developments.

The code has possed compilation but encountered crash at last during vmi_destroy. More debugs effort is needed:

TODO Debug: tiny_slice_new0: allocate memory region and initialize values to 0; it seems not effective.