ia64/xen-unstable

changeset 18696:10f0e1bb8e5e

[IA64] Fix HVM VGA abnormal.

Conversion from p2m entry to physical address, it needs to use
_PAGE_PPN_MASK to mask out some bits which are used by other
purposes by p2m entry.

Sign-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Tue Nov 04 12:07:22 2008 +0900 (2008-11-04)
parents 4a5acf020c0f
children e75cb35c798b
files xen/arch/ia64/vmx/vtlb.c xen/arch/ia64/xen/mm.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vtlb.c	Thu Oct 30 11:51:55 2008 +0900
     1.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Tue Nov 04 12:07:22 2008 +0900
     1.3 @@ -522,7 +522,8 @@ static u64 translate_phy_pte(VCPU *v, u6
     1.4       * which is required by vga acceleration since qemu maps shared
     1.5       * vram buffer with WB.
     1.6       */
     1.7 -    if (mfn_valid(maddr >> PAGE_SHIFT) && phy_pte.ma != VA_MATTR_NATPAGE)
     1.8 +    if (mfn_valid((maddr & _PAGE_PPN_MASK) >> PAGE_SHIFT)
     1.9 +				&& phy_pte.ma != VA_MATTR_NATPAGE)
    1.10          phy_pte.ma = VA_MATTR_WB;
    1.11  
    1.12      maddr = ((maddr & _PAGE_PPN_MASK) & PAGE_MASK) | (paddr & ~PAGE_MASK);
     2.1 --- a/xen/arch/ia64/xen/mm.c	Thu Oct 30 11:51:55 2008 +0900
     2.2 +++ b/xen/arch/ia64/xen/mm.c	Tue Nov 04 12:07:22 2008 +0900
     2.3 @@ -926,7 +926,8 @@ int
     2.4      /* in HVM guest, when VTD is enabled,
     2.5       * P2M entry may change from _PAGE_IO type to real MMIO page 
     2.6       */
     2.7 -    if(VMX_DOMAIN(d->vcpu[0]) && (pte_val(ret_pte) & _PAGE_IO)) {
     2.8 +    if(is_hvm_domain(d) && (pte_val(ret_pte) & _PAGE_IO) &&
     2.9 +       !mfn_valid(physaddr >> PAGE_SHIFT)) {
    2.10          old_pte = ret_pte;
    2.11          goto again_hvm_page_io;
    2.12      }