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 yield functionality
[palacios.git] / palacios / src / palacios / vmm_config.c
index f226ea5..5bfe537 100644 (file)
@@ -25,7 +25,7 @@
 #include <palacios/vmm_profiler.h>
 #include <palacios/vmm_mem.h>
 #include <palacios/vmm_hypercall.h>
-
+#include <palacios/vmm_dev_mgr.h>
 
 
 #include <devices/generic.h>
@@ -104,6 +104,14 @@ int v3_pre_config_guest(struct guest_info * info, struct v3_vm_config * config_p
        info->enable_profiler = 0;
     }
 
+    if (config_ptr->schedule_freq == 0) {
+       // set the schedule frequency to 100 HZ
+       config_ptr->schedule_freq = 100;
+    }
+
+    PrintDebug("CPU_KHZ = %d, schedule_freq=%p\n", V3_CPU_KHZ(), (void *)config_ptr->schedule_freq);
+
+    info->yield_cycle_period = (V3_CPU_KHZ() * 1000) / config_ptr->schedule_freq;
     
     // Initial CPU operating mode
     info->cpu_mode = REAL;
@@ -161,7 +169,7 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf
        }
     } else {
        v3_hook_write_mem(info, 0xa0000, 0xc0000, 0xa0000,  passthrough_mem_write, NULL);
-    }  
+    }
 
 #define VGABIOS_START 0x000c0000
 #define ROMBIOS_START 0x000f0000
@@ -188,7 +196,7 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf
            return -1;
        }
     }
-#endif    
+#endif
 
     print_shadow_map(info);
 
@@ -199,7 +207,6 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf
 
 static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ptr) {
 
-
     v3_create_device(info, "8259A", NULL);
     v3_create_device(info, "KEYBOARD", NULL);
     v3_create_device(info, "8254_PIT", NULL); 
@@ -207,28 +214,28 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_
     v3_create_device(info, "OS_DEBUG", NULL);
     v3_create_device(info, "LAPIC", NULL);
     v3_create_device(info, "IOAPIC", "LAPIC");
-    v3_create_device(info, "PARANET", NULL);
+    v3_create_device(info, "VMNET", NULL);
     
     int use_generic = USE_GENERIC;
 
-
     if (config_ptr->enable_pci == 1) {
-       struct ide_cfg ide_config = {"PCI", "PIIX3"};   
+       struct ide_cfg ide_config = {"PCI", "PIIX3"};
        
        v3_create_device(info, "PCI", NULL);
        v3_create_device(info, "i440FX", "PCI");
        v3_create_device(info, "PIIX3", "PCI");
        
+
+       v3_create_device(info, "LNX_VIRTIO_BLK", "PCI");
+       v3_create_device(info, "LNX_VIRTIO_BALLOON", "PCI");
+       v3_create_device(info, "SYM_SWAP", "LNX_VIRTIO_BLK");
+
        v3_create_device(info, "IDE", &ide_config);
     } else {
        v3_create_device(info, "IDE", NULL);
-
     }
 
 
-
-
-
     if (config_ptr->pri_disk_type != NONE) {
        if (config_ptr->pri_disk_type == CDROM) {
            if (config_ptr->pri_disk_con == RAM) {
@@ -246,7 +253,7 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_
                                         config_ptr->pri_disk_info.net.disk_name};
                PrintDebug("Creating NET CD\n");
 
-               v3_create_device(info, "NET-CD", &cfg);    
+               v3_create_device(info, "NET-CD", &cfg);
            }
        } else if (config_ptr->pri_disk_type == HARDDRIVE) {
            if (config_ptr->pri_disk_con == RAM) {
@@ -434,10 +441,7 @@ static int configure_generic(struct guest_info * info, struct v3_vm_config * con
     v3_generic_add_port_range(generic, 0xc100, 0xc1ff, GENERIC_PRINT_AND_PASSTHROUGH);
 #endif
 
-
-
     //  v3_generic_add_port_range(generic, 0x378, 0x400, GENERIC_PRINT_AND_IGNORE);
     
-
     return 0;
 }