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.


added pci passthrough and a few other things
[palacios.git] / palacios / src / palacios / vmm_config.c
index 1cadad7..ed54ab5 100644 (file)
@@ -31,7 +31,6 @@
 #include <palacios/vmm_sym_swap.h>
 #endif
 
-
 #include <devices/generic.h>
 #include <devices/ide.h>
 #include <devices/ram_cd.h>
@@ -40,6 +39,7 @@
 #include <devices/net_hd.h>
 
 #include <devices/telnet_cons.h>
+#include <devices/pci_passthrough.h>
 
 
 
@@ -70,11 +70,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
      */
@@ -110,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;
@@ -225,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;
 }
@@ -252,6 +254,7 @@ 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_pt_cfg = {"PCI", "E1000", 0x8086, 0x100e};
        
        v3_create_device(info, "PCI", NULL);
        v3_create_device(info, "i440FX", "PCI");
@@ -264,6 +267,9 @@ 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_pt_cfg);
+
     } else {
        v3_create_device(info, "IDE", NULL);
     }