ia64/xen-unstable

changeset 16059:c632def5f69b

svm: Enable nested paging only on x86/64.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Thu Oct 04 09:36:18 2007 +0100 (2007-10-04)
parents ca1085e8ab82
children d24787ece0e0
files xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Wed Oct 03 16:33:23 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Thu Oct 04 09:36:18 2007 +0100
     1.3 @@ -885,16 +885,6 @@ static struct hvm_function_table svm_fun
     1.4      .event_pending        = svm_event_pending
     1.5  };
     1.6  
     1.7 -static int svm_npt_detect(void)
     1.8 -{
     1.9 -    u32 eax, ebx, ecx, edx;
    1.10 -
    1.11 -    /* Check CPUID for nested paging support. */
    1.12 -    cpuid(0x8000000A, &eax, &ebx, &ecx, &edx);
    1.13 -
    1.14 -    return (edx & 1);
    1.15 -}
    1.16 -
    1.17  int start_svm(struct cpuinfo_x86 *c)
    1.18  {
    1.19      u32 eax, ecx, edx;
    1.20 @@ -937,7 +927,14 @@ int start_svm(struct cpuinfo_x86 *c)
    1.21  
    1.22      setup_vmcb_dump();
    1.23  
    1.24 -    svm_function_table.hap_supported = svm_npt_detect();
    1.25 +#ifdef __x86_64__
    1.26 +    /*
    1.27 +     * Check CPUID for nested paging support. We support NPT only on 64-bit
    1.28 +     * hosts since the phys-to-machine table is in host format. Hence 32-bit
    1.29 +     * Xen could only support guests using NPT with up to a 4GB memory map.
    1.30 +     */
    1.31 +    svm_function_table.hap_supported = (cpuid_edx(0x8000000A) & 1);
    1.32 +#endif
    1.33  
    1.34      hvm_enable(&svm_function_table);
    1.35