ia64/xen-unstable

changeset 10377:e62685b48500

[IA64] Fix vga acceleration for VTI domain

Now guest vhpt table of VMX domain is searched to insert some
entry into vtlb on the fly. However previous guard on memory
attribute is only done for guest itc.d emulation. That breaks
VGA acceleration and this patch fixes it by moving check to
right place.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Tue Jun 13 15:05:33 2006 -0600 (2006-06-13)
parents 97226bfc659c
children db6dce7ae374
files xen/arch/ia64/vmx/vmmu.c xen/arch/ia64/vmx/vtlb.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmmu.c	Tue Jun 13 13:13:39 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Tue Jun 13 15:05:33 2006 -0600
     1.3 @@ -373,18 +373,8 @@ IA64FAULT vmx_vcpu_itc_d(VCPU *vcpu, UIN
     1.4      }
     1.5  #endif //VTLB_DEBUG
     1.6      gpfn = (pte & _PAGE_PPN_MASK)>> PAGE_SHIFT;
     1.7 -    if (VMX_DOMAIN(vcpu)) {
     1.8 -        if (__gpfn_is_io(vcpu->domain, gpfn))
     1.9 -            pte |= VTLB_PTE_IO;
    1.10 -        else{
    1.11 -	    if ((pte & _PAGE_MA_MASK)!=_PAGE_MA_NAT)
    1.12 -            /* Ensure WB attribute if pte is related to a normal mem page,
    1.13 -             * which is required by vga acceleration since qemu maps shared
    1.14 -             * vram buffer with WB.
    1.15 -             */
    1.16 -                pte &= ~_PAGE_MA_MASK;
    1.17 -	}
    1.18 -    }
    1.19 +    if (VMX_DOMAIN(vcpu) && __gpfn_is_io(vcpu->domain, gpfn))
    1.20 +        pte |= VTLB_PTE_IO;
    1.21      thash_purge_and_insert(vcpu, pte, itir, ifa);
    1.22      return IA64_NO_FAULT;
    1.23  
     2.1 --- a/xen/arch/ia64/vmx/vtlb.c	Tue Jun 13 13:13:39 2006 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Tue Jun 13 15:05:33 2006 -0600
     2.3 @@ -446,6 +446,13 @@ void thash_purge_and_insert(VCPU *v, u64
     2.4      ps = itir_ps(itir);
     2.5  
     2.6      if(VMX_DOMAIN(v)){
     2.7 +        /* Ensure WB attribute if pte is related to a normal mem page,
     2.8 +         * which is required by vga acceleration since qemu maps shared
     2.9 +         * vram buffer with WB.
    2.10 +         */
    2.11 +        if (!(pte & VTLB_PTE_IO) && ((pte & _PAGE_MA_MASK) != _PAGE_MA_NAT))
    2.12 +            pte &= ~_PAGE_MA_MASK;
    2.13 +
    2.14          phy_pte = translate_phy_pte(v, &pte, itir, ifa);
    2.15          if(ps==PAGE_SHIFT){
    2.16              if(!(pte&VTLB_PTE_IO)){