From: Peter Dinda Date: Sat, 19 Jul 2008 01:02:11 +0000 (+0000) Subject: svm_handler now handles pause exits and correctly does exception injects with X-Git-Tag: boots-puppy-iso-to-command-prompt~9 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=d8e510143aa094363d5bf21d6cb7e31a29a6e826 svm_handler now handles pause exits and correctly does exception injects with errors that can be zero. --- diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index e67a702..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 @@ -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); diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index abb190b..770bb14 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -375,7 +375,7 @@ int handle_shadow_pte32_fault(struct guest_info * info, info->ctrl_regs.cr2 = fault_addr; raise_exception_with_error(info, PF_EXCEPTION, *(uint_t *)&error_code); - PrintDebug("Access error injecting pf to guest (guest access error=%d) (pf error code=%d)\n", guest_pte_access, error_code); + PrintDebug("Access error injecting pf to guest (guest access error=%d) (pf error code=%d)\n", guest_pte_access, *(uint_t*)&error_code); return 0; }