X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=ed54ab5b1dc61aba1d4ef491f4366d76343308aa;hb=3a4e54ec208ea3589963b410d2d73292bbc4a8fe;hp=b6e5587ab33db71d54f54c5f3760085459dfa8d1;hpb=6fe9fe338ec19b212b43bb2c25322dce3cdbb490;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index b6e5587..ed54ab5 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,6 @@ #include #endif - #include #include #include @@ -39,7 +38,8 @@ #include #include -#include +#include +#include @@ -57,7 +57,7 @@ static int configure_generic(struct guest_info * info, struct v3_vm_config * con -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASSTHROUGH_VIDEO static int passthrough_mem_write(addr_t guest_addr, void * src, uint_t length, void * priv_data) { return length; @@ -70,13 +70,26 @@ static int passthrough_mem_write(addr_t guest_addr, void * src, uint_t length, v #endif int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) { - extern v3_cpu_arch_t v3_cpu_type; + extern v3_cpu_arch_t v3_cpu_types[]; // Amount of ram the Guest will have, rounded to a 4K page boundary info->mem_size = config_ptr->mem_size & ~(addr_t)0xfff; + info->cpu_id = config_ptr->guest_cpu; + + /* + * Initialize the subsystem data strutures + */ +#ifdef CONFIG_TELEMETRY + // This should go first, because other subsystems will depend on the guest_info flag + if (config_ptr->enable_telemetry) { + info->enable_telemetry = 1; + v3_init_telemetry(info); + } else { + info->enable_telemetry = 0; + } +#endif - // Initialize the subsystem data strutures v3_init_time(info); v3_init_io_map(info); v3_init_msr_map(info); @@ -99,7 +112,7 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p // Initialize the memory map v3_init_shadow_map(info); - if ((v3_cpu_type == V3_SVM_REV3_CPU) && + if ((v3_cpu_types[info->cpu_id] == V3_SVM_REV3_CPU) && (config_ptr->enable_nested_paging == 1)) { PrintDebug("Guest Page Mode: NESTED_PAGING\n"); info->shdw_pg_mode = NESTED_PAGING; @@ -109,14 +122,7 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p info->shdw_pg_mode = SHADOW_PAGING; } -#ifdef CONFIG_PROFILE_VMM - if (config_ptr->enable_profiling) { - info->enable_profiler = 1; - v3_init_profiler(info); - } else { - info->enable_profiler = 0; - } -#endif + if (config_ptr->schedule_freq == 0) { // set the schedule frequency to 100 HZ @@ -174,7 +180,7 @@ int v3_post_config_guest(struct guest_info * info, struct v3_vm_config * config_ */ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * config_ptr) { -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASSTHROUGH_VIDEO PrintDebug("Setting up memory map (memory size=%dMB)\n", (uint_t)(info->mem_size / (1024 * 1024))); // VGA frame buffer @@ -221,7 +227,7 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf } #endif - print_shadow_map(info); + v3_print_mem_map(info); return 0; } @@ -240,9 +246,15 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_create_device(info, "VMNET", NULL); + v3_create_device(info, "CGA_VIDEO", (void *)1); + { + struct telnet_cons_cfg cons_cfg = {"CGA_VIDEO", 19997}; + v3_create_device(info, "TELNET_CONSOLE", &cons_cfg); + } if (config_ptr->enable_pci == 1) { struct ide_cfg ide_config = {"PCI", "PIIX3"}; + struct pci_passthrough_cfg pci_pt_cfg = {"PCI", "E1000", 0x8086, 0x100e}; v3_create_device(info, "PCI", NULL); v3_create_device(info, "i440FX", "PCI"); @@ -254,9 +266,10 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_create_device(info, "LNX_VIRTIO_BALLOON", "PCI"); v3_create_device(info, "SYM_SWAP", "LNX_VIRTIO_BLK"); - v3_create_device(info, "VIDEO", "PCI"); - v3_create_device(info, "IDE", &ide_config); + + v3_create_device(info, "PCI_PASSTHROUGH", &pci_pt_cfg); + } else { v3_create_device(info, "IDE", NULL); } @@ -443,7 +456,7 @@ static int configure_generic(struct guest_info * info, struct v3_vm_config * con #endif -#ifndef CONFIG_VIDEO +#ifdef CONFIG_PASTHROUGH_VIDEO // Monitor graphics card operations