From: Peter Dinda Date: Tue, 15 Jul 2008 19:34:22 +0000 (+0000) Subject: Added support for SMI interrupt X-Git-Tag: reaches-user-mode-on-qemu-and-both-amd-boxes-nested-paging-faults X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=8a6d2dbc1b6d593cab383bb04f3fe778949376b2 Added support for SMI interrupt --- diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 8c650ff..1d8d23b 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -85,6 +85,15 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { ctrl_area->exceptions.of = 1; ctrl_area->exceptions.nmi = 1; + // Debug of boot on physical machines - 7/14/08 + ctrl_area->instrs.NMI=1; + ctrl_area->instrs.SMI=1; + ctrl_area->instrs.INIT=1; + ctrl_area->instrs.PAUSE=1; + ctrl_area->instrs.shutdown_evts=1; + + + vm_info->vm_regs.rdx = 0x00000f00; guest_state->cr0 = 0x60000010; diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 93a366e..10d3af6 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -41,7 +41,7 @@ int handle_svm_exit(struct guest_info * info) { // Disable printing io exits due to bochs debug messages //if (!((exit_code == VMEXIT_IOIO) && ((ushort_t)(guest_ctrl->exit_info1 >> 16) == 0x402))) { - PrintDebug("SVM Returned: Exit Code: %x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc); + PrintDebug("SVM Returned: Exit Code: 0x%x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc); // } // PrintDebugVMCB((vmcb_t*)(info->vmm_data)); @@ -132,6 +132,10 @@ int handle_svm_exit(struct guest_info * info) { // handle_svm_intr(info); + } else if (exit_code == VMEXIT_SMI) { + + // handle_svm_smi(info); // ignored for now + } else if (exit_code == VMEXIT_HLT) { PrintDebug("Guest halted\n"); if (handle_svm_halt(info) == -1) { diff --git a/palacios/src/palacios/vm_guest.c b/palacios/src/palacios/vm_guest.c index 33c85ad..b831962 100644 --- a/palacios/src/palacios/vm_guest.c +++ b/palacios/src/palacios/vm_guest.c @@ -3,7 +3,9 @@ void PrintV3Segments(struct v3_segments * segs) { int i = 0; - struct v3_segment * seg_ptr = (struct v3_segment *)segs; + struct v3_segment * seg_ptr; + + seg_ptr=(struct v3_segment *)segs; char *seg_names[] = {"CS", "DS" , "ES", "FS", "GS", "SS" , "LDTR", "GDTR", "IDTR", "TR", NULL}; PrintDebug("Segments\n"); @@ -19,9 +21,11 @@ void PrintV3Segments(struct v3_segments * segs) { void PrintV3CtrlRegs(struct v3_ctrl_regs * regs) { int i = 0; - v3_reg_t * reg_ptr = (v3_reg_t *)regs; + v3_reg_t * reg_ptr; char * reg_names[] = {"CR0", "CR2", "CR3", "CR4", "CR8", "FLAGS", NULL}; + reg_ptr= (v3_reg_t *)regs; + PrintDebug("32 bit Ctrl Regs:\n"); for (i = 0; reg_names[i] != NULL; i++) {