X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_shadow_paging.c;h=444af7dc81fe5978c02c46b7fae5108a8e0691a5;hb=ffc83679ff6580fe325f505a91bf568660d663f7;hp=d87ee112f198076ea78799ff1480eab202f65a7d;hpb=acaadd79c597c8d5180fbfbec79c01fef3dff003;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index d87ee11..444af7d 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -191,9 +191,27 @@ int v3_init_shdw_impl(struct v3_vm_info * vm) { struct v3_shdw_pg_impl * impl = NULL; PrintDebug(vm, VCORE_NONE, "Checking if shadow paging requested.\n"); - if ((pg_mode != NULL) && (strcasecmp(pg_mode, "nested") == 0)) { - PrintDebug(vm, VCORE_NONE, "Nested paging specified - not initializing shadow paging.\n"); - return 0; + if (pg_mode == NULL) { + V3_Print(vm, VCORE_NONE, "No paging mode specified, assuming shadow with defaults\n"); + pg_mode = "shadow"; + } else { + if (strcasecmp(pg_mode, "nested") == 0) { + // this check is repeated here (compare to vmm_config's determine paging mode) since + // shadow paging initialization *precedes* per-core pre-config. + extern v3_cpu_arch_t v3_mach_type; + if ((v3_mach_type == V3_SVM_REV3_CPU) || + (v3_mach_type == V3_VMX_EPT_CPU) || + (v3_mach_type == V3_VMX_EPT_UG_CPU)) { + PrintDebug(vm, VCORE_NONE, "Nested paging specified on machine that supports it - not initializing shadow paging\n"); + return 0; + } else { + V3_Print(vm, VCORE_NONE, "Nested paging specified but machine does not support it - falling back to shadow paging with defaults\n"); + pg_mode = "shadow"; + } + } else if (strcasecmp(pg_mode, "shadow") != 0) { + V3_Print(vm, VCORE_NONE, "Unknown paging mode '%s' specified - falling back to shadow paging with defaults\n",pg_mode); + pg_mode = "shadow"; + } } if (pg_strat == NULL) {