X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm.c;h=b7f45cdd1e239cf95b759ff40b6f84c8d059a2da;hb=b58fe2254858e3ecc94be5d86f2a93f2cfe0a0d5;hp=b5740a6740d13c750c42b211a281bf376f8dc300;hpb=ed88df2e8e304ac4b391521d47c192127ad9bc5a;p=palacios.git diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index b5740a6..b7f45cd 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -154,6 +154,10 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpu_mask, int num_cpus, char *op // Parse host-os defined options into an easily-accessed format. v3_parse_options(options); +#ifdef V3_CONFIG_HVM + v3_init_hvm(); +#endif + // Memory manager initialization v3_init_mem(); @@ -255,6 +259,10 @@ void Shutdown_V3() { v3_deinit_mem(); +#ifdef V3_CONFIG_HVM + v3_deinit_hvm(); +#endif + v3_deinit_options(); @@ -298,7 +306,7 @@ static int start_core(void * p) return 0; } -struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) { +struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name, unsigned int cpu_mask) { struct v3_vm_info * vm = v3_config_guest(cfg, priv_data); int vcore_id = 0; @@ -332,7 +340,11 @@ struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name) { PrintError(vm, VCORE_NONE,"Error registering VM with scheduler\n"); } - for (vcore_id = 0; vcore_id < vm->num_cores; vcore_id++) { + if (v3_cpu_mapper_admit_vm(vm,cpu_mask) != 0){ + PrintError(vm, VCORE_NONE,"Error admitting VM %s for mapping", vm->name); + } + + for (vcore_id = 0; vcore_id < vm->num_cores; vcore_id++) { struct guest_info * core = &(vm->cores[vcore_id]); @@ -373,6 +385,12 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) { return -1; } +#if V3_CONFIG_HVM + if (v3_setup_hvm_vm_for_boot(vm)) { + PrintError(vm, VCORE_NONE, "HVM setup for boot failed\n"); + return -1; + } +#endif /// CHECK IF WE ARE MULTICORE ENABLED.... @@ -395,10 +413,6 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) { } vm->avail_cores = avail_cores; - - if (v3_cpu_mapper_admit_vm(vm,cpu_mask) != 0){ - PrintError(vm, VCORE_NONE,"Error admitting VM %s for mapping", vm->name); - } if (v3_scheduler_admit_vm(vm) != 0){ PrintError(vm, VCORE_NONE,"Error admitting VM %s for scheduling", vm->name); @@ -602,7 +616,7 @@ int v3_move_vm_mem(struct v3_vm_info * vm, void *gpa, int target_cpu) { new_hpa = V3_AllocPagesExtended(num_pages, PAGE_SIZE_4KB, new_node, - 0); // no constraints given new shadow pager impl + 0, 0); // no constraints given new shadow pager impl if (!new_hpa) { PrintError(vm, VCORE_NONE, "Cannot allocate memory for new base region...\n"); @@ -909,7 +923,7 @@ int v3_get_state_vm(struct v3_vm_info *vm, core->num_vcores=numcores; - for (i=0;imem_map.num_base_regions;i++) { + for (i=0;iregion[i].host_paddr = (void*)(vm->mem_map.base_regions[i].host_addr); mem->region[i].size = v3_mem_block_size; #ifdef V3_CONFIG_SWAPPING