From: Keir Fraser Date: Thu, 4 Oct 2007 08:36:18 +0000 (+0100) Subject: svm: Enable nested paging only on x86/64. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14922 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=84daf5fe4f55e78b2bbc44ea81998ae749b02a0b;p=xen.git svm: Enable nested paging only on x86/64. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index d6dd66192f..a679593d0d 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -885,16 +885,6 @@ static struct hvm_function_table svm_function_table = { .event_pending = svm_event_pending }; -static int svm_npt_detect(void) -{ - u32 eax, ebx, ecx, edx; - - /* Check CPUID for nested paging support. */ - cpuid(0x8000000A, &eax, &ebx, &ecx, &edx); - - return (edx & 1); -} - int start_svm(struct cpuinfo_x86 *c) { u32 eax, ecx, edx; @@ -937,7 +927,14 @@ int start_svm(struct cpuinfo_x86 *c) setup_vmcb_dump(); - svm_function_table.hap_supported = svm_npt_detect(); +#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 = (cpuid_edx(0x8000000A) & 1); +#endif hvm_enable(&svm_function_table);