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.


fixes for single core guest on multicore capable systeM
Jack Lange [Fri, 15 Jan 2010 00:27:21 +0000 (18:27 -0600)]
palacios/include/palacios/vmm_mem.h
palacios/include/palacios/vmm_time.h
palacios/src/devices/8254.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_intr.c
palacios/src/palacios/vmm_mem.c
palacios/src/palacios/vmm_time.c

index 153c04c..f64f648 100644 (file)
@@ -77,8 +77,8 @@ struct v3_mem_map {
 }; 
 
 
-int v3_init_mem_map(struct guest_info * info);
-void v3_delete_mem_map(struct guest_info * info);
+int v3_init_mem_map(struct v3_vm_info * vm);
+void v3_delete_mem_map(struct v3_vm_info * vm);
 
 
 
index be23fb2..ff4946a 100644 (file)
@@ -49,7 +49,7 @@ struct vm_time {
 
 struct vm_timer_ops {
     void (*update_time)(struct guest_info * info, ullong_t cpu_cycles, ullong_t cpu_freq, void * priv_data);
-    void (*advance_timer)(struct guest_info * info);
+    void (*advance_timer)(struct guest_info * info, void * private_data);
 };
 
 struct vm_timer {
index f330a8b..291101e 100644 (file)
@@ -311,6 +311,12 @@ static void pit_update_time(struct guest_info * info, ullong_t cpu_cycles, ullon
 }
 
 
+static void pit_advance_time(struct guest_info * core, void * private_data) {
+
+    v3_raise_irq(core->vm_info, 0);
+}
+
+
 
 /* This should call out to handle_SQR_WAVE_write, etc...
  */
@@ -593,6 +599,7 @@ static int pit_write_command(struct guest_info * core, ushort_t port, void * src
 
 static struct vm_timer_ops timer_ops = {
     .update_time = pit_update_time,
+    .advance_timer = pit_advance_time,
 };
 
 
index cc3e431..3b712f5 100644 (file)
@@ -232,7 +232,7 @@ static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) {
     v3_init_intr_routers(vm);
 
     // Initialize the memory map
-    if (v3_init_mem_map(&(vm->cores[0])) == -1) {
+    if (v3_init_mem_map(vm) == -1) {
        PrintError("Could not initialize shadow map\n");
        return -1;
     }
@@ -403,8 +403,18 @@ struct v3_vm_info * v3_config_guest(void * cfg_blob) {
 
     cores_cfg = v3_cfg_subtree(cfg_data->cfg, "cores");
 
+    if (!cores_cfg) {
+       PrintError("Could not find core configuration (new config format required)\n");
+       return NULL;
+    }
+
     num_cores = atoi(v3_cfg_val(cores_cfg, "count"));
 
+    if (num_cores == 0) {
+       PrintError("No cores specified in configuration\n");
+       return NULL;
+    }
+
     V3_Print("Configuring %d cores\n", num_cores);
 
     vm = allocate_guest(num_cores);    
index 0acf777..87b6802 100644 (file)
@@ -57,6 +57,8 @@ void v3_init_intr_controllers(struct guest_info * info) {
     intr_state->irq_started = 0;
     intr_state->irq_vector = 0;
 
+    v3_lock_init(&(intr_state->irq_lock));
+
     INIT_LIST_HEAD(&(intr_state->controller_list));
 }
 
index 1fa39ff..b59ace0 100644 (file)
@@ -44,7 +44,7 @@ static int mem_offset_hypercall(struct guest_info * info, uint_t hcall_id, void
 }
 
 
-int v3_init_shadow_map(struct v3_vm_info * vm) {
+int v3_init_mem_map(struct v3_vm_info * vm) {
     struct v3_mem_map * map = &(vm->mem_map);
     addr_t mem_pages = vm->mem_size >> 12;
 
index 85c671e..44d5d02 100644 (file)
@@ -77,3 +77,15 @@ void v3_update_time(struct guest_info * info, uint64_t cycles) {
 
     //info->time_state.pending_cycles = 0;
 }
+
+void v3_advance_time(struct guest_info * core) {
+    struct vm_timer * tmp_timer;
+
+
+    list_for_each_entry(tmp_timer, &(core->time_state.timers), timer_link) {
+       tmp_timer->ops->advance_timer(core, tmp_timer->private_data);
+    }
+  
+
+
+}