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.


VM Reset Bugfixes
Peter Dinda [Mon, 29 Jun 2015 18:22:05 +0000 (13:22 -0500)]
- ROS reset does not clobber HRT
- Missing keyboard reset command added
- More debugging output

palacios/src/devices/keyboard.c
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_hvm.c

index 3609058..c5b5281 100644 (file)
@@ -821,6 +821,7 @@ static int keyboard_write_command(struct guest_info * core, ushort_t port, void
        case 0xfb:
        case 0xfc:
        case 0xfd:
+       case 0xfe:
        case 0xff:
            if (!(cmd & 0x1)) { 
                // general purpose reset
index 292e780..a007201 100644 (file)
@@ -12,6 +12,7 @@
  * All rights reserved.
  *
  * Author: Jack Lange <jarusl@cs.northwestern.edu>
+ *         Peter Dinda <jarusl@cs.northwestern.edu> (Reset)
  *
  * This is free software.  You are permitted to use,
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
@@ -463,12 +464,22 @@ static int svm_handle_standard_reset(struct guest_info *core)
     // I could be a ROS core, or I could be in a non-HVM 
     // either way, if I'm core 0, I'm the leader
     if (core->vcpu_id==0) {
+       uint64_t mem_size=core->vm_info->mem_size;
+
+#ifdef V3_CONFIG_HVM
+       // on a ROS reset, we should only 
+       // manipulate the part of the memory seen by
+       // the ROS
+       if (core->vm_info->hvm_state.is_hvm) { 
+           mem_size=v3_get_hvm_ros_memsize(core->vm_info);
+       }
+#endif
        core->vm_info->run_state = VM_RESETTING;
        // copy bioses again because some, 
        // like seabios, assume
        // this should also blow away the BDA and EBDA
        PrintDebug(core->vm_info,core,"Clear memory (%p bytes)\n",(void*)core->vm_info->mem_size);
-       if (v3_set_gpa_memory(core, 0, core->vm_info->mem_size, 0)!=core->vm_info->mem_size) { 
+       if (v3_set_gpa_memory(core, 0, mem_size, 0)!=mem_size) { 
            PrintError(core->vm_info,core,"Clear of memory failed\n");
        }
        PrintDebug(core->vm_info,core,"Copying bioses\n");
@@ -484,7 +495,7 @@ static int svm_handle_standard_reset(struct guest_info *core)
     core->cpl = 0;
     core->cpu_mode = REAL;
     core->mem_mode = PHYSICAL_MEM;
-    core->num_exits=0;
+    //core->num_exits=0;
 
     PrintDebug(core->vm_info,core,"Machine reset to REAL/PHYSICAL\n");
 
index 24ae9fd..7fb278b 100644 (file)
@@ -1166,11 +1166,19 @@ int v3_handle_hvm_reset(struct guest_info *core)
            // and recopy the .data, but for now we'll just
            // do everything
            rc |= v3_setup_hvm_vm_for_boot(core->vm_info);
+
+           if (rc) { 
+               PrintError(core->vm_info,core,"hvm: failed to setup HVM VM for boot rc=%d\n",rc);
+           }
        }
 
        // now everyone is ready to reset
        rc |= v3_setup_hvm_hrt_core_for_boot(core);
 
+       if (rc) { 
+           PrintError(core->vm_info,core,"hvm: failed to setup HVM core for boot rc=%d\n",rc);
+       }
+
        core->core_run_state = CORE_RUNNING;
 
        if (core->vcpu_id==core->vm_info->hvm_state.first_hrt_core) { 
@@ -1181,6 +1189,7 @@ int v3_handle_hvm_reset(struct guest_info *core)
        v3_counting_barrier(&core->vm_info->reset_barrier);
 
        if (rc<0) { 
+           PrintError(core->vm_info,core,"hvm: reset failed\n");
            return rc;
        } else {
            return 1;