X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_sym_swap.c;h=0fbb853f1fc2426da5fcdde409730388ef0b9f87;hp=5c8cad8248aeaae704099117c22891e81dc9277d;hb=075786ef94c92a5ca5e3fae1ee60e6ec996566c4;hpb=3cab540e9e47ce3562dae4c03b20d84b24d8f1f7 diff --git a/palacios/src/palacios/vmm_sym_swap.c b/palacios/src/palacios/vmm_sym_swap.c index 5c8cad8..0fbb853 100644 --- a/palacios/src/palacios/vmm_sym_swap.c +++ b/palacios/src/palacios/vmm_sym_swap.c @@ -155,6 +155,10 @@ int v3_swap_flush(struct guest_info * info) { swap_state->flushes++; #endif + if (!ht_iter) { + PrintError("NULL iterator in swap flush!! Probably will crash soon...\n"); + } + while (ht_iter->entry) { struct shadow_pointer * tmp_shdw_ptr = NULL; struct shadow_pointer * shdw_ptr = NULL; @@ -164,12 +168,16 @@ int v3_swap_flush(struct guest_info * info) { // we can leave the list_head structures and reuse them for the next round list_for_each_entry_safe(shdw_ptr, tmp_shdw_ptr, shdw_ptr_list, node) { + if (shadw_ptr == NULL) { + PrintError("Null shadow pointer in swap flush!! Probably crashing soon...\n"); + } + // Trigger faults for next shadow access shdw_ptr->shadow_pte->present = 0; // Delete entry from list list_del(&(shdw_ptr->node)); - V3_Free(shdw_ptr); + V3_Free(shdw_ptr); } v3_htable_iter_advance(ht_iter);