Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Expose swapping and pinning to host + add visibility to linux module
[palacios.git] / palacios / src / palacios / vmm.c
index ac91873..e16e2fa 100644 (file)
@@ -31,6 +31,7 @@
 #include <palacios/vmm_cpu_mapper.h>
 #include <palacios/vmm_direct_paging.h>
 #include <interfaces/vmm_numa.h>
+#include <interfaces/vmm_file.h>
 
 #ifdef V3_CONFIG_SVM
 #include <palacios/svm.h>
@@ -162,6 +163,10 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpu_mask, int num_cpus, char *op
     // Register all shadow paging handlers
     V3_init_shdw_paging();
 
+#ifdef V3_CONFIG_SWAPPING
+    v3_init_swapping();
+#endif
+
     // Initialize the cpu_mapper framework (must be before extensions)
     V3_init_cpu_mapper();
 
@@ -239,6 +244,10 @@ void Shutdown_V3() {
     V3_deinit_scheduling();
     
     V3_deinit_cpu_mapper();
+
+#ifdef V3_CONFIG_SWAPPING
+    v3_deinit_swapping();
+#endif
     
     V3_deinit_shdw_paging();
     
@@ -853,6 +862,14 @@ int v3_get_state_vm(struct v3_vm_info        *vm,
     for (i=0;i<vm->mem_map.num_base_regions;i++) {
        mem->region[i].host_paddr =  (void*)(vm->mem_map.base_regions[i].host_addr);
        mem->region[i].size = v3_mem_block_size;
+#ifdef V3_CONFIG_SWAPPING
+       mem->region[i].swapped = vm->mem_map.base_regions[i].flags.swapped;
+       mem->region[i].pinned = vm->mem_map.base_regions[i].flags.pinned;
+#else
+       mem->region[i].swapped = 0;
+       mem->region[i].pinned = 0;
+#endif
+
     }
 
     mem->num_regions=numregions;