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.


Minor fix to the halt handler
Lei Xia [Wed, 28 Apr 2010 21:25:14 +0000 (16:25 -0500)]
palacios/src/palacios/vmm_halt.c

index bb28ebc..ef796e4 100644 (file)
@@ -45,32 +45,35 @@ int v3_handle_halt(struct guest_info * info) {
        
        PrintDebug("CPU Yield\n");
 
-again:
-       
-       rdtscll(yield_start);
-       v3_yield(info);
-       rdtscll(yield_stop);
-    
-    
-       //v3_update_time(info, yield_stop - yield_start);
-       gap = yield_stop - yield_start;
-        /*
-           If we got here, either an interrupt has occured or
-           sufficient time has passed that we may need to inject 
-           a timer interrupt.  
-           First, we will update time, which may or may not inject an
-           interrupt 
-        */
-       v3_update_time(info, gap);
-       info->time_state.cached_hlt_tsc += gap;
+       while(1){
+               if (v3_intr_pending(info)) {
+              /* if there is pending interrupt, just return */
+                   break;
+               }
 
-       /* At this point, we either have some combination of 
-           interrupts, including perhaps a timer interrupt, or 
-           no interrupt.
-        */
-       if (!v3_intr_pending(info)) {
-       /* if no interrupt, then we yield again */
-           goto again;
+               rdtscll(yield_start);
+               v3_yield(info);
+               rdtscll(yield_stop);
+
+               gap = yield_stop - yield_start;
+                /*
+                  If we got here, either an interrupt has occured or
+                  sufficient time has passed that we may need to inject 
+                  a timer interrupt.  
+                  First, we will update time, which may or may not inject an
+                  interrupt 
+               */
+               v3_update_time(info, gap);
+               info->time_state.cached_hlt_tsc += gap;
+
+               /* At this point, we either have some combination of 
+                  interrupts, including perhaps a timer interrupt, or 
+                  no interrupt.
+               */
+               if (!v3_intr_pending(info)) {
+              /* if no interrupt, then we do halt*/
+                   asm("hlt");
+               }
        }
 
 #if 0