X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_mem.c;h=c43dcae3c4063ff075f0171d48fdf8c98bdaf092;hb=5ab8dd9d463c5e1aa61910d6014fe8b770e1e301;hp=56dcbbbc71b784b83881e0845e2005c0e5ec0904;hpb=ea942030159fbf603538bfd9cf4d5c5f29804131;p=palacios-OLD.git diff --git a/palacios/src/palacios/vmm_mem.c b/palacios/src/palacios/vmm_mem.c index 56dcbbb..c43dcae 100644 --- a/palacios/src/palacios/vmm_mem.c +++ b/palacios/src/palacios/vmm_mem.c @@ -411,6 +411,19 @@ void v3_delete_mem_region(struct v3_vm_info * vm, struct v3_mem_region * reg) { return; } + + v3_rb_erase(&(reg->tree_node), &(vm->mem_map.mem_regions)); + + + + // If the guest isn't running then there shouldn't be anything to invalidate. + // Page tables should __always__ be created on demand during execution + // NOTE: This is a sanity check, and can be removed if that assumption changes + if (vm->run_state != VM_RUNNING) { + V3_Free(reg); + return; + } + for (i = 0; i < vm->num_cores; i++) { struct guest_info * info = &(vm->cores[i]); @@ -444,8 +457,6 @@ void v3_delete_mem_region(struct v3_vm_info * vm, struct v3_mem_region * reg) { } } - v3_rb_erase(&(reg->tree_node), &(vm->mem_map.mem_regions)); - V3_Free(reg); // flush virtual page tables