ia64/xen-unstable

changeset 9062:933d0d70378f

Fix SVM PAE support.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Feb 28 10:14:10 2006 +0100 (2006-02-28)
parents 0820df08a996
children 79a93530121b
files xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Tue Feb 28 10:13:26 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Tue Feb 28 10:14:10 2006 +0100
     1.3 @@ -982,17 +982,23 @@ static void svm_vmexit_do_cpuid(struct v
     1.4                  !vlapic_global_enabled((VLAPIC(v))) )
     1.5              clear_bit(X86_FEATURE_APIC, &edx);
     1.6  	    
     1.7 -#ifdef __x86_64__
     1.8 +#if CONFIG_PAGING_LEVELS < 3
     1.9 +        clear_bit(X86_FEATURE_PAE, &edx);
    1.10 +        clear_bit(X86_FEATURE_PSE, &edx);
    1.11 +        clear_bit(X86_FEATURE_PSE36, &edx);
    1.12 +#else
    1.13          if ( v->domain->arch.ops->guest_paging_levels == PAGING_L2 )
    1.14 -#endif
    1.15          {
    1.16 +            if ( !v->domain->arch.hvm_domain.pae_enabled )
    1.17 +                clear_bit(X86_FEATURE_PAE, &edx);
    1.18              clear_bit(X86_FEATURE_PSE, &edx);
    1.19 -            clear_bit(X86_FEATURE_PAE, &edx);
    1.20              clear_bit(X86_FEATURE_PSE36, &edx);
    1.21          }
    1.22 +#endif
    1.23  	
    1.24          /* Clear out reserved bits. */
    1.25          ecx &= ~SVM_VCPU_CPUID_L1_RESERVED; /* mask off reserved bits */
    1.26 +        clear_bit(X86_FEATURE_MWAIT & 31, &ecx);
    1.27      }
    1.28  #ifdef __i386__
    1.29      else if ( input == 0x80000001 )
    1.30 @@ -1462,7 +1468,7 @@ static int svm_set_cr0(unsigned long val
    1.31  #endif
    1.32  
    1.33          /* Now arch.guest_table points to machine physical. */
    1.34 -        v->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
    1.35 +        v->arch.guest_table = mk_pagetable((u64)mfn << PAGE_SHIFT);
    1.36          update_pagetables(v);
    1.37  
    1.38          HVM_DBG_LOG(DBG_LEVEL_VMMU, "New arch.guest_table = %lx", 
    1.39 @@ -1601,7 +1607,7 @@ static int mov_to_cr(int gpreg, int cr, 
    1.40              }
    1.41  
    1.42              old_base_mfn = pagetable_get_pfn(v->arch.guest_table);
    1.43 -            v->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
    1.44 +            v->arch.guest_table = mk_pagetable((u64)mfn << PAGE_SHIFT);
    1.45  
    1.46              if (old_base_mfn)
    1.47                  put_page(mfn_to_page(old_base_mfn));