X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_symmod.c;h=5f14566d760122b146ab4bd2e049eb88599482a8;hb=94429f4b9268cf4d5f86dee5c3d929110811ac80;hp=3b45c23d83bbace68e1bbd94ce0a69fa6c06a9f8;hpb=13d9a33d365278c508b8709288f9c7c2949a50f9;p=palacios.git diff --git a/palacios/src/palacios/vmm_symmod.c b/palacios/src/palacios/vmm_symmod.c index 3b45c23..5f14566 100644 --- a/palacios/src/palacios/vmm_symmod.c +++ b/palacios/src/palacios/vmm_symmod.c @@ -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) {