From: Jack Lange Date: Fri, 11 Apr 2008 20:17:36 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: working-cdboot-physical-but-not-qemu~23 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=1ca13097c7c85318c400c3811ccbb54ac6c619f1 *** empty log message *** --- diff --git a/palacios/include/palacios/vmm_dev.h b/palacios/include/palacios/vmm_dev.h new file mode 100644 index 0000000..29f8a24 --- /dev/null +++ b/palacios/include/palacios/vmm_dev.h @@ -0,0 +1,16 @@ +#ifndef __VMM_DEV_H +#define __VMM_DEV_H + + + +struct vm_device { + int (*init_device + + +}; + + + + + +#endif diff --git a/palacios/include/palacios/vmm_intr.h b/palacios/include/palacios/vmm_intr.h index 0b178b0..209a7a1 100644 --- a/palacios/include/palacios/vmm_intr.h +++ b/palacios/include/palacios/vmm_intr.h @@ -31,12 +31,15 @@ struct guest_info; struct vm_intr { uint_t excp_pending; uint_t excp_num; + uint_t excp_error_code; /* some way to get the [A]PIC intr */ }; +void init_interrupt_state(struct vm_intr * state); + int raise_exception(struct guest_info * info, uint_t excp); int intr_pending(struct vm_intr * intr); diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index abce2ac..7a88d3e 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -183,6 +183,7 @@ int RunVMM(struct Boot_Info * bootInfo) { vm_info.cpu_mode = REAL; init_vmm_io_map(&(vm_info.io_map)); + init_interrupt_state(&(vm_info.intr_state)); if (0) { diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 46b4fa2..d1123b6 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -120,6 +120,7 @@ int handle_svm_exit(struct guest_info * info) { break; case EXCEPTION: guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION; + guest_ctrl->EVENTINJ.excp_error_code = info->intr_state.excp_error_code; break; case SOFTWARE: guest_ctrl->EVENTINJ.type = SVM_INJECTION_SOFT_INTR; @@ -130,13 +131,14 @@ int handle_svm_exit(struct guest_info * info) { case INVALID_INTR: default: - PrintDebug("Attempted to issue and invalid interrupt\n"); + PrintDebug("Attempted to issue an invalid interrupt\n"); return -1; } // IMPORTANT TODO // We need to figure out stack parameters.... - // EVENTINJ.error_code + + //EVENTINJ.error_code } diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c index 464bc79..a326f37 100644 --- a/palacios/src/palacios/vmm_intr.c +++ b/palacios/src/palacios/vmm_intr.c @@ -1,6 +1,13 @@ #include #include + +void init_interrupt_state(struct vm_intr * state) { + state->excp_pending = 0; + state->excp_num = 0; + state->excp_error_code = 0; +} + int raise_exception(struct guest_info * info, uint_t excp) { /* We can't stack exceptions,