Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
Jack Lange [Wed, 30 Apr 2008 21:35:35 +0000 (21:35 +0000)]
palacios/include/palacios/vmm.h
palacios/src/devices/8259a.c
palacios/src/geekos/vm.c
palacios/src/geekos/vmm_stubs.c
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_intr.c

index df22134..47bd00b 100644 (file)
 
 /* ** */
 
+#define V3_ASSERT(x)                                                   \
+  do {                                                                 \
+    if (!(x)) {                                                                \
+      PrintDebug("Failed assertion in %s: %s at %s, line %d, RA=%lx\n",        \
+                __func__, #x, __FILE__, __LINE__,                      \
+                (ulong_t) __builtin_return_address(0));                \
+      while(1);                                                                \
+    }                                                                  \
+  } while(0)                                                           \
+    
 
 #define VMM_INVALID_CPU 0
 #define VMM_VMX_CPU 1
index c674d74..52d84e9 100644 (file)
@@ -129,11 +129,14 @@ static int pic_raise_intr(void * private_data, int irq, int error_code) {
     irq = 9;
   }
 
+  PrintDebug("Raising irq %d in the PIC\n", irq);
+
   if (irq <= 7) {
     state->master_irr |= 0x01 << irq;
   } else if ((irq > 7) && (irq < 16)) {
     state->slave_irr |= 0x01 << (irq - 7);
   } else {
+    PrintDebug("Invalid IRQ raised (%d)\n", irq);
     return -1;
   }
 
index 6ceda0a..e6beb43 100644 (file)
@@ -314,7 +314,6 @@ int RunVMM(struct Boot_Info * bootInfo) {
        PrintDebugDevMgr(&(vm_info.dev_mgr));
       }
 
-
       hook_irq(&vm_info, 6);
 
       vm_info.rip = 0xfff0;
index b2b66be..25f300b 100644 (file)
@@ -47,16 +47,16 @@ void VMM_Free(void * addr) {
 
 
 
-
 struct guest_info * irq_map[256];
 
-
 static void pic_intr_handler(struct Interrupt_State * state) {
   Begin_IRQ(state);
   struct guest_info * info =   irq_map[state->intNum - 32];
+  SerialPrint("Interrupt %d\n", state->intNum);
 
   if (info) {
-    info->vm_ops.raise_irq(irq_map[state->intNum], state->intNum, state->errorCode);
+    SerialPrint("Calling handler(info=%x)->%x\n", info, info->vm_ops.raise_irq);
+    info->vm_ops.raise_irq(info, state->intNum - 32, state->errorCode);
   } else {
     SerialPrint("Interrupt handler error: NULL pointer found, no action taken\n");
     End_IRQ(state);
@@ -88,5 +88,4 @@ int ack_irq(int irq) {
   
 void Init_Stubs() {
   memset(irq_map, 0, sizeof(struct guest_info *) * 256);
-
 }
index ff61e57..3d98ec6 100644 (file)
@@ -145,7 +145,7 @@ int start_svm_guest(struct guest_info *info) {
     //PrintDebug("Launching to RIP: %x\n", info->rip);
     safe_svm_launch((vmcb_t*)(info->vmm_data), &(info->vm_regs));
     //launch_svm((vmcb_t*)(info->vmm_data));
-    // PrintDebug("SVM Returned\n");
+    //PrintDebug("SVM Returned\n");
 
     STGI();
     
index 1e59299..801e414 100644 (file)
@@ -36,8 +36,17 @@ int raise_exception(struct guest_info * info, uint_t excp) {
 
 int raise_irq(struct guest_info * info, int irq, int error_code) {
   // Look up PIC and resend
-  info->intr_state.controller->raise_intr(info->intr_state.controller_state, irq, error_code);
-
+  V3_ASSERT(info);
+  V3_ASSERT(info->intr_state.controller);
+  V3_ASSERT(info->intr_state.controller->raise_intr);
+
+  //  if ((info->intr_state.controller) && 
+  //  (info->intr_state.controller->raise_intr)) {
+    info->intr_state.controller->raise_intr(info->intr_state.controller_state, irq, error_code);
+    //} else {
+    // PrintDebug("There is no registered Interrupt Controller... (NULL POINTER)\n");
+    // return -1;
+    //}
   return 0;
 }