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.


More init checks to allow graceful fail out when VM cannot be created
[palacios.git] / palacios / include / palacios / vmm_mem_hook.h
index cd87518..21d0eef 100644 (file)
 
 #ifdef __V3VEE__ 
 
+struct hashtable;
+
 
 struct v3_mem_hooks {
 
-    void * hook_hvas; // this is an array of pages, equal to the number of cores
+    /* Scratch memory pages for full hooks (1 per core) */
+    void * hook_hvas_1; 
+
+    /* A second set of scratch memory pages */
+    /* The ONLY reason this exists is because of 'rep cmps'... */
+    void * hook_hvas_2; 
+
 
     struct list_head hook_list;
+
+    /* We track memory hooks via a hash table */
+    /* keyed to the memory region pointer */
+    struct hashtable * reg_table; 
+
+    int inited; // structure needs to be deinited
 };
 
 
@@ -42,6 +56,16 @@ int v3_hook_full_mem(struct v3_vm_info * vm, uint16_t core_id,
                     int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
                     void * priv_data);
 
+int v3_hook_access_mem(struct v3_vm_info * vm, uint16_t core_id,
+                      addr_t guest_addr_start, addr_t guest_addr_end,
+                      int (*access)(struct guest_info * core, 
+                                    addr_t guest_va, 
+                                    addr_t guest_pa, 
+                                    struct v3_mem_region *reg, 
+                                    pf_error_t access_info, 
+                                    void *priv_data),
+                      void * priv_data);
+
 int v3_hook_write_mem(struct v3_vm_info * vm, uint16_t core_id, 
                      addr_t guest_addr_start, addr_t guest_addr_end, addr_t host_addr,
                      int (*write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
@@ -50,11 +74,7 @@ int v3_hook_write_mem(struct v3_vm_info * vm, uint16_t core_id,
 
 int v3_unhook_mem(struct v3_vm_info * vm, uint16_t core_id, addr_t guest_addr_start);
 
-int v3_find_mem_hook(struct v3_vm_info *vm, uint16_t core_id, addr_t guest_addr,
-                    int (**read)(struct guest_info * core, addr_t guest_addr, void * dst, uint_t length, void * priv_data),
-                    void **read_priv_data,
-                    int (**write)(struct guest_info * core, addr_t guest_addr, void * src, uint_t length, void * priv_data),
-                    void **write_priv_data);
+