X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=44dbd50b6bc1d878ae65f650390683e3b8a64e78;hb=ed8feff1d5dd6bf028cd5ba0960ec125505d7597;hp=1cadad751a2ccc3214376eff3ca23b913eeb97fe;hpb=b54cbe1dbbe15ed228de7472ea284df96ecce909;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 1cadad7..44dbd50 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -26,12 +26,13 @@ #include #include #include +#include +#include #ifdef CONFIG_SYMBIOTIC_SWAP #include #endif - #include #include #include @@ -40,6 +41,7 @@ #include #include +#include @@ -70,11 +72,13 @@ 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 */ @@ -88,29 +92,16 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p } #endif - v3_init_time(info); + v3_init_hypercall_map(info); v3_init_io_map(info); v3_init_msr_map(info); - v3_init_interrupt_state(info); - v3_init_exception_state(info); - v3_init_dev_mgr(info); + v3_init_cpuid_map(info); v3_init_host_events(info); - - v3_init_decoder(info); - - v3_init_hypercall_map(info); - -#ifdef CONFIG_SYMBIOTIC_SWAP - v3_init_sym_swap(info); -#endif - - - // 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; @@ -120,6 +111,18 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p info->shdw_pg_mode = SHADOW_PAGING; } + v3_init_sym_iface(info); + + v3_init_time(info); + v3_init_interrupt_state(info); + v3_init_exception_state(info); + v3_init_dev_mgr(info); + v3_init_decoder(info); + +#ifdef CONFIG_SYMBIOTIC_SWAP + PrintDebug("initializing symbiotic swap\n"); + v3_init_sym_swap(info); +#endif if (config_ptr->schedule_freq == 0) { @@ -154,6 +157,9 @@ int v3_post_config_guest(struct guest_info * info, struct v3_vm_config * config_ return -1; } + // v3_print_io_map(info); + v3_print_msr_map(info); + info->run_state = VM_STOPPED; info->vm_regs.rdi = 0; @@ -225,7 +231,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; } @@ -252,6 +258,8 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ if (config_ptr->enable_pci == 1) { struct ide_cfg ide_config = {"PCI", "PIIX3"}; + struct pci_passthrough_cfg pci_qemu_pt_cfg = {"PCI", "E1000", 0x8086, 0x100e}; + struct pci_passthrough_cfg pci_hw_pt_cfg = {"PCI", "E1000", 0x8086, 0x107c}; v3_create_device(info, "PCI", NULL); v3_create_device(info, "i440FX", "PCI"); @@ -264,6 +272,11 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_create_device(info, "SYM_SWAP", "LNX_VIRTIO_BLK"); v3_create_device(info, "IDE", &ide_config); + + v3_create_device(info, "PCI_PASSTHROUGH", &pci_qemu_pt_cfg); + v3_create_device(info, "PCI_PASSTHROUGH", &pci_hw_pt_cfg); + + } else { v3_create_device(info, "IDE", NULL); }