X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm_handler.c;h=21523f9606a61d0f9cd237a4ae4c7216106d7365;hb=20885b915c6caf47c8bd78d7b5b492fef388ac2d;hp=9a994d2173b9a7345cb9253d4ab14e4f204981b0;hpb=8ee31494ea28d1756689574fb69791746daac3f3;p=palacios-OLD.git diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 9a994d2..21523f9 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -44,7 +45,7 @@ int handle_svm_exit(struct guest_info * info) { PrintDebug("SVM Returned: Exit Code: 0x%x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc); - if (exit_code < 0x40) { + if (exit_code < 0x4f) { char instr[32]; int ret; // Dump out the instr stream @@ -65,11 +66,11 @@ int handle_svm_exit(struct guest_info * info) { if (ret != 32) { // I think we should inject a GPF into the guest PrintDebug("Could not read instruction (ret=%d)\n", ret); - return -1; - } + } else { - PrintDebug("Instr Stream:\n"); - PrintTraceMemDump(instr, 32); + PrintDebug("Instr Stream:\n"); + PrintTraceMemDump(instr, 32); + } } @@ -177,6 +178,11 @@ int handle_svm_exit(struct guest_info * info) { if (handle_svm_halt(info) == -1) { return -1; } + } else if (exit_code == VMEXIT_PAUSE) { + PrintDebug("Guest paused\n"); + if (handle_svm_pause(info) == -1) { + return -1; + } } else { addr_t rip_addr; char buf[15]; @@ -230,7 +236,7 @@ int handle_svm_exit(struct guest_info * info) { PrintTraceMemDump(buf, 15); - while(1); + return -1; } @@ -269,7 +275,7 @@ int handle_svm_exit(struct guest_info * info) { guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION; - if (info->intr_state.excp_error_code) { + if (info->intr_state.excp_error_code_valid) { //PAD guest_ctrl->EVENTINJ.error_code = info->intr_state.excp_error_code; guest_ctrl->EVENTINJ.ev = 1; PrintDebug("Injecting error code %x\n", guest_ctrl->EVENTINJ.error_code);