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=56e0014475ad82ba5b9e607dcf8ed40d1a0a9546;hp=a4117b823602a44ea69ed45aaa9480f9f5730685;hb=cfcc5717f659b3ed2954f41cf363d3bceae8dc84;hpb=28cfe68985ef4360c9bd7428a19c222b295e9d85 diff --git a/palacios/src/palacios/vmm_sym_swap.c b/palacios/src/palacios/vmm_sym_swap.c index a4117b8..56e0014 100644 --- a/palacios/src/palacios/vmm_sym_swap.c +++ b/palacios/src/palacios/vmm_sym_swap.c @@ -21,7 +21,7 @@ #include #include - +#include #ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY #include @@ -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 (shdw_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); @@ -179,7 +187,7 @@ int v3_swap_flush(struct guest_info * info) { } int v3_get_vaddr_perms(struct guest_info * info, addr_t vaddr, pte32_t * guest_pte, pf_error_t * page_perms) { - uint32_t pte_val = *(uint32_t *)guest_pte; + uint64_t pte_val = (uint64_t)*(uint32_t *)guest_pte; // symcall to check if page is in cache or on swap disk if (v3_sym_call3(info, SYMCALL_MEM_LOOKUP, (uint64_t *)&vaddr, (uint64_t *)&pte_val, (uint64_t *)page_perms) == -1) { @@ -187,7 +195,7 @@ int v3_get_vaddr_perms(struct guest_info * info, addr_t vaddr, pte32_t * guest_p return -1; } - V3_Print("page perms = %x\n", *(uint32_t *)page_perms); + // V3_Print("page perms = %x\n", *(uint32_t *)page_perms); return 0; }