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=38d72108f881010929c53988d6ec8a6ffa8f1d8f;hpb=bb102eef875adf3e667e4e3ffe7e6412b167b14e;p=palacios.git diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 38d7210..01fcaf7 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -34,7 +34,8 @@ #include #include #include -//#include +#include +#include #include #include #include @@ -88,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; } @@ -278,10 +281,9 @@ 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 * ide = NULL; - // struct vm_device * cdrom = NULL; -#ifdef DEBUG_PCI + //struct vm_device * ram_cd = NULL; + struct vm_device * ram_hd = NULL; struct vm_device * pci = v3_create_pci(); -#endif struct vm_device * nvram = v3_create_nvram(); //struct vm_device * timer = v3_create_timer(); struct vm_device * pic = v3_create_pic(); @@ -299,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(); + ide = v3_create_ide(pci); if (use_ramdisk) { PrintDebug("Creating Ramdisk\n"); - // 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); } @@ -311,9 +318,8 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ generic = configure_generic(info, config_ptr); } -#ifdef DEBUG_PCI + v3_attach_device(info, pci); -#endif v3_attach_device(info, nvram); //v3_attach_device(info, timer); @@ -332,8 +338,8 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ v3_attach_device(info, ide); if (use_ramdisk) { - - // v3_attach_device(info, cdrom); + // v3_attach_device(info, ram_cd); + v3_attach_device(info, ram_hd); } if (use_generic) {