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.


Fixed merge conflict in vmm_halt.c
Patrick G. Bridges [Wed, 25 Apr 2012 14:57:29 +0000 (08:57 -0600)]
1  2 
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_halt.c

@@@ -155,7 -155,7 +155,7 @@@ static void Init_VMCB_BIOS(vmcb_t * vmc
      ctrl_area->instrs.NMI = 1;
      ctrl_area->instrs.SMI = 0; // allow SMIs to run in guest
      ctrl_area->instrs.INIT = 1;
-     ctrl_area->instrs.PAUSE = 1;
+     //    ctrl_area->instrs.PAUSE = 1;
      ctrl_area->instrs.shutdown_evts = 1;
  
  
@@@ -521,7 -521,7 +521,7 @@@ in
  v3_svm_config_tsc_virtualization(struct guest_info * info) {
      vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data));
  
 -    if (info->time_state.time_flags & V3_TIME_TRAP_RDTSC) {
 +    if (info->time_state.flags & VM_TIME_TRAP_RDTSC) {
        ctrl_area->instrs.RDTSC = 1;
        ctrl_area->svm_instrs.RDTSCP = 1;
      } else {
@@@ -549,15 -549,15 +549,15 @@@ int v3_svm_enter(struct guest_info * in
      // Conditionally yield the CPU if the timeslice has expired
      v3_yield_cond(info);
  
 +    // Update timer devices after being in the VM before doing 
 +    // IRQ updates, so that any interrupts they raise get seen 
 +    // immediately.
 +    v3_advance_time(info, NULL);
 +    v3_update_timers(info);
 +
      // disable global interrupts for vm state transition
      v3_clgi();
  
 -    // Update timer devices after being in the VM, with interupts
 -    // disabled, but before doing IRQ updates, so that any interrupts they 
 -    //raise get seen immediately.
 -    v3_advance_time(info);
 -    v3_update_timers(info);
 -
      // Synchronize the guest state to the VMCB
      guest_state->cr0 = info->ctrl_regs.cr0;
      guest_state->cr2 = info->ctrl_regs.cr2;
      }
  #endif
  
 -    v3_time_enter_vm(info);
      v3_svm_config_tsc_virtualization(info);
  
      //V3_Print("Calling v3_svm_launch\n");
  
      v3_last_exit = (uint32_t)(guest_ctrl->exit_code);
  
 -    // Immediate exit from VM time bookkeeping
 -    v3_time_exit_vm(info, &guest_cycles);
 +    v3_advance_time(info, &guest_cycles);
  
      info->num_exits++;
  
      // Conditionally yield the CPU if the timeslice has expired
      v3_yield_cond(info);
  
 +    // This update timers is for time-dependent handlers
 +    // if we're slaved to host time
 +    v3_advance_time(info, NULL);
 +    v3_update_timers(info);
 +
      {
        int ret = v3_handle_svm_exit(info, exit_code, exit_info1, exit_info2);
        
@@@ -40,15 -40,14 +40,15 @@@ int v3_handle_halt(struct guest_info * 
      } else {
        PrintDebug("CPU Yield\n");
  
-       while (!v3_intr_pending(info)) {
+       while (!v3_intr_pending(info) && (info->vm_info->run_state == VM_RUNNING)) {
 +            uint64_t t, cycles;
            /* Yield, allowing time to pass while yielded */
 +          t = v3_get_host_time(&info->time_state);
            v3_yield(info);
 -          v3_advance_time(info);
 +          cycles = v3_get_host_time(&info->time_state) - t;
 +          v3_advance_time(info, &cycles);
  
 -          v3_disable_ints();
            v3_update_timers(info);
 -          v3_enable_ints();
            
            /* At this point, we either have some combination of 
               interrupts, including perhaps a timer interrupt, or