diff -r 0a1955ae9f9b xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Tue Oct 30 10:25:17 2007 -0600 +++ b/xen/arch/x86/hvm/hvm.c Tue Oct 30 11:04:59 2007 -0600 @@ -49,8 +49,17 @@ #include #include -/* Xen command-line option to disable hardware-assisted paging */ -static int opt_hap_disabled; +/* Xen command-line option to disable hardware-assisted paging + * + * Since phys-to-machine table of NPT is in host format, 32-bit Xen could only + * support guests using NPT with up to a 4GB memory map. Therefore we only + * enable HAP as default for 64bit. + */ +#ifdef __x86_64__ +static int opt_hap_disabled = 0; +#else +static int opt_hap_disabled = 1; +#endif invbool_param("hap", opt_hap_disabled); int hvm_enabled __read_mostly; @@ -83,9 +92,10 @@ void hvm_enable(struct hvm_function_tabl { if ( opt_hap_disabled ) hvm_funcs.hap_supported = 0; - printk("HVM: Hardware Assisted Paging %sabled\n", - hvm_funcs.hap_supported ? "en" : "dis"); - } + } + + printk("HVM: Hardware Assisted Paging %sabled\n", + hvm_funcs.hap_supported ? "en" : "dis"); } void hvm_set_guest_time(struct vcpu *v, u64 gtime) diff -r 0a1955ae9f9b xen/arch/x86/hvm/svm/svm.c --- a/xen/arch/x86/hvm/svm/svm.c Tue Oct 30 10:25:17 2007 -0600 +++ b/xen/arch/x86/hvm/svm/svm.c Tue Oct 30 10:49:33 2007 -0600 @@ -940,14 +940,7 @@ int start_svm(struct cpuinfo_x86 *c) svm_feature_flags = ((cpuid_eax(0x80000000) >= 0x8000000A) ? cpuid_edx(0x8000000A) : 0); -#ifdef __x86_64__ - /* - * Check CPUID for nested paging support. We support NPT only on 64-bit - * hosts since the phys-to-machine table is in host format. Hence 32-bit - * Xen could only support guests using NPT with up to a 4GB memory map. - */ svm_function_table.hap_supported = cpu_has_svm_npt; -#endif hvm_enable(&svm_function_table);