From: Jack Lange Date: Fri, 15 Jan 2010 00:27:21 +0000 (-0600) Subject: fixes for single core guest on multicore capable systeM X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=7650d345982514b32fc0f116b8a6512ec243b267;p=palacios-OLD.git fixes for single core guest on multicore capable systeM --- diff --git a/palacios/include/palacios/vmm_mem.h b/palacios/include/palacios/vmm_mem.h index 153c04c..f64f648 100644 --- a/palacios/include/palacios/vmm_mem.h +++ b/palacios/include/palacios/vmm_mem.h @@ -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); diff --git a/palacios/include/palacios/vmm_time.h b/palacios/include/palacios/vmm_time.h index be23fb2..ff4946a 100644 --- a/palacios/include/palacios/vmm_time.h +++ b/palacios/include/palacios/vmm_time.h @@ -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 { diff --git a/palacios/src/devices/8254.c b/palacios/src/devices/8254.c index f330a8b..291101e 100644 --- a/palacios/src/devices/8254.c +++ b/palacios/src/devices/8254.c @@ -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, }; diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index cc3e431..3b712f5 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -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); diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c index 0acf777..87b6802 100644 --- a/palacios/src/palacios/vmm_intr.c +++ b/palacios/src/palacios/vmm_intr.c @@ -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)); } diff --git a/palacios/src/palacios/vmm_mem.c b/palacios/src/palacios/vmm_mem.c index 1fa39ff..b59ace0 100644 --- a/palacios/src/palacios/vmm_mem.c +++ b/palacios/src/palacios/vmm_mem.c @@ -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; diff --git a/palacios/src/palacios/vmm_time.c b/palacios/src/palacios/vmm_time.c index 85c671e..44d5d02 100644 --- a/palacios/src/palacios/vmm_time.c +++ b/palacios/src/palacios/vmm_time.c @@ -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); + } + + + +}