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.


Commented test code for exec hooking, etc
[palacios.git] / palacios / src / palacios / vmm_symmod.c
index 3b45c23..5f14566 100644 (file)
@@ -106,6 +106,7 @@ int V3_init_symmod() {
            PrintError("Could not insert module %s to master list\n", tmp_def->name);
            return -1;
        }
+
        list_add(&(capsule->node), &capsule_list);
 
        tmp_def = &(__start__v3_capsules[++i]);
@@ -114,6 +115,12 @@ int V3_init_symmod() {
     return 0;
 }
 
+int V3_deinit_symmod() {
+    v3_free_htable(capsule_table, 1, 0);    
+
+    return 0;
+}
+
 /* ***************** */
 /* Linkage functions */
 /* ***************** */
@@ -159,12 +166,12 @@ static int symbol_hcall_handler(struct guest_info * core, hcall_id_t hcall_id, v
        addr_t sym_gva = sym_start_gva + (sizeof(struct v3_symbol_def32) * i);
 
 
-       if (guest_va_to_host_va(core, sym_gva, (addr_t *)&(tmp_symbol)) == -1) {
+       if (v3_gva_to_hva(core, sym_gva, (addr_t *)&(tmp_symbol)) == -1) {
            PrintError("Could not locate symbiotic symbol definition\n");
            continue;
        }
        
-       if (guest_va_to_host_va(core, tmp_symbol->name_gva, (addr_t *)&(sym_name)) == -1) {
+       if (v3_gva_to_hva(core, tmp_symbol->name_gva, (addr_t *)&(sym_name)) == -1) {
            PrintError("Could not locate symbiotic symbol name\n");
            continue;
        }
@@ -215,6 +222,22 @@ int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     return 0;
 }
 
+int v3_deinit_symmod_vm(struct v3_vm_info * vm) {
+    struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
+    struct v3_symbol * sym = NULL;
+    struct v3_symbol * tmp_sym = NULL;
+
+    v3_remove_hypercall(vm, SYMMOD_SYMS_HCALL);
+
+    v3_free_htable(symmod_state->capsule_table, 0, 0);
+
+    list_for_each_entry_safe(sym, tmp_sym, &(symmod_state->v3_sym_list), sym_node) {
+       list_del(&(sym->sym_node));
+       V3_Free(sym);
+    }
+
+    return 0;
+}
 
 
 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data) {