X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_config.c;h=01fcaf7b4d389679940c6b9669152f361409a9b7;hb=c535b3199977444c3aa2c44b852cc82ce659c5ff;hp=db9aa8b8dfed44dcc9abe7bf91299388745c16e4;hpb=5bce09a95e6cfe1a2c84bfe5825b2b456d6ff4a5;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index db9aa8b..01fcaf7 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -33,13 +33,15 @@ #include #include #include -#include -#include +#include +#include +#include #include #include #include #include #include +#include @@ -87,10 +89,12 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) v3_init_hypercall_map(info); - - if (v3_cpu_type == V3_SVM_REV3_CPU) { + if ((v3_cpu_type == V3_SVM_REV3_CPU) && + (config_ptr->enable_nested_paging == 1)) { + PrintDebug("Guest Page Mode: NESTED_PAGING\n"); info->shdw_pg_mode = NESTED_PAGING; } else { + PrintDebug("Guest Page Mode: SHADOW_PAGING\n"); v3_init_shadow_page_state(info); info->shdw_pg_mode = SHADOW_PAGING; } @@ -276,8 +280,10 @@ 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) { - struct vm_device * ramdisk = NULL; - struct vm_device * cdrom = NULL; + struct vm_device * ide = NULL; + //struct vm_device * ram_cd = NULL; + struct vm_device * ram_hd = NULL; + struct vm_device * pci = v3_create_pci(); struct vm_device * nvram = v3_create_nvram(); //struct vm_device * timer = v3_create_timer(); struct vm_device * pic = v3_create_pic(); @@ -295,11 +301,16 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ int use_ramdisk = config_ptr->use_ramdisk; int use_generic = USE_GENERIC; + ide = v3_create_ide(pci); if (use_ramdisk) { PrintDebug("Creating Ramdisk\n"); - ramdisk = v3_create_ramdisk(); - cdrom = v3_create_cdrom(ramdisk, config_ptr->ramdisk, config_ptr->ramdisk_size); + //ram_cd = v3_create_ram_cd(ide, 0, 0, + // (addr_t)(config_ptr->ramdisk), + // config_ptr->ramdisk_size); + ram_hd = v3_create_ram_hd(ide, 0, 0, + (addr_t)(config_ptr->ramdisk), + config_ptr->ramdisk_size); } @@ -308,6 +319,8 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ } + v3_attach_device(info, pci); + v3_attach_device(info, nvram); //v3_attach_device(info, timer); v3_attach_device(info, pic); @@ -322,9 +335,11 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_attach_device(info, para_net); + v3_attach_device(info, ide); + if (use_ramdisk) { - v3_attach_device(info, ramdisk); - v3_attach_device(info, cdrom); + // v3_attach_device(info, ram_cd); + v3_attach_device(info, ram_hd); } if (use_generic) {