ia64/xen-unstable

changeset 18761:f6795589ef82

[IA64] use pte_pfn() where possible

use pte_pfn() to get mfn from pte.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Thu Nov 06 12:14:57 2008 +0900 (2008-11-06)
parents 958942c44332
children b9436a3c9f00
files xen/arch/ia64/vmx/sioemu.c xen/arch/ia64/vmx/vmmu.c xen/arch/ia64/vmx/vmx_fault.c xen/arch/ia64/vmx/vmx_init.c xen/arch/ia64/vmx/vtlb.c xen/arch/ia64/xen/dom0_ops.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/sioemu.c	Thu Nov 06 12:14:06 2008 +0900
     1.2 +++ b/xen/arch/ia64/vmx/sioemu.c	Thu Nov 06 12:14:57 2008 +0900
     1.3 @@ -148,7 +148,7 @@ sioemu_set_callback (struct vcpu *v, uns
     1.4      pte = *lookup_noalloc_domain_pte(v->domain, paddr);
     1.5      if (!pte_present(pte) || !pte_mem(pte))
     1.6          return -EINVAL;
     1.7 -    mfn = (pte_val(pte) & _PFN_MASK) >> PAGE_SHIFT;
     1.8 +    mfn = pte_pfn(pte);
     1.9      ASSERT(mfn_valid(mfn));
    1.10  
    1.11      page = mfn_to_page(mfn);
     2.1 --- a/xen/arch/ia64/vmx/vmmu.c	Thu Nov 06 12:14:06 2008 +0900
     2.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Thu Nov 06 12:14:57 2008 +0900
     2.3 @@ -312,7 +312,7 @@ IA64FAULT vmx_vcpu_itr_d(VCPU *vcpu, u64
     2.4      */   
     2.5      if (ps != _PAGE_SIZE_16M)
     2.6          thash_purge_entries(vcpu, va, ps);
     2.7 -    gpfn = (pte & _PAGE_PPN_MASK)>> PAGE_SHIFT;
     2.8 +    gpfn = pte_pfn(__pte(pte));
     2.9      vcpu_get_rr(vcpu, va, &rid);
    2.10      rid &= RR_RID_MASK;
    2.11      p_dtr = (thash_data_t *)&vcpu->arch.dtrs[slot];
     3.1 --- a/xen/arch/ia64/vmx/vmx_fault.c	Thu Nov 06 12:14:06 2008 +0900
     3.2 +++ b/xen/arch/ia64/vmx/vmx_fault.c	Thu Nov 06 12:14:57 2008 +0900
     3.3 @@ -376,7 +376,7 @@ vmx_hpw_miss(u64 vadr, u64 vec, REGS* re
     3.4                  pte = lookup_domain_mpa(v->domain, pa_clear_uc(vadr), NULL);
     3.5                  if (v->domain != dom0 && (pte & _PAGE_IO)) {
     3.6                      emulate_io_inst(v, pa_clear_uc(vadr), 4,
     3.7 -                                    (pte & _PFN_MASK) >> PAGE_SHIFT);
     3.8 +                                    pte_pfn(__pte(pte)));
     3.9                      return IA64_FAULT;
    3.10                  }
    3.11                  physical_tlb_miss(v, vadr, type);
    3.12 @@ -413,7 +413,7 @@ try_again:
    3.13                                   " pte=0x%lx\n", data->page_flags);
    3.14                  if (data->pl >= ((regs->cr_ipsr >> IA64_PSR_CPL0_BIT) & 3))
    3.15                      emulate_io_inst(v, gppa, data->ma, 
    3.16 -                                    (pte & _PFN_MASK) >> PAGE_SHIFT);
    3.17 +                                    pte_pfn(__pte(pte)));
    3.18                  else {
    3.19                      vcpu_set_isr(v, misr.val);
    3.20                      data_access_rights(v, vadr);
     4.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Thu Nov 06 12:14:06 2008 +0900
     4.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Thu Nov 06 12:14:57 2008 +0900
     4.3 @@ -457,7 +457,7 @@ int vmx_set_ioreq_page(
     4.4  	pte = *lookup_noalloc_domain_pte(d, gpfn << PAGE_SHIFT);
     4.5  	if (!pte_present(pte) || !pte_mem(pte))
     4.6  		return -EINVAL;
     4.7 -	mfn = (pte_val(pte) & _PFN_MASK) >> PAGE_SHIFT;
     4.8 +	mfn = pte_pfn(pte);
     4.9  	ASSERT(mfn_valid(mfn));
    4.10  
    4.11  	page = mfn_to_page(mfn);
     5.1 --- a/xen/arch/ia64/vmx/vtlb.c	Thu Nov 06 12:14:06 2008 +0900
     5.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Thu Nov 06 12:14:57 2008 +0900
     5.3 @@ -522,8 +522,7 @@ static u64 translate_phy_pte(VCPU *v, u6
     5.4       * which is required by vga acceleration since qemu maps shared
     5.5       * vram buffer with WB.
     5.6       */
     5.7 -    if (mfn_valid((maddr & _PAGE_PPN_MASK) >> PAGE_SHIFT)
     5.8 -				&& phy_pte.ma != VA_MATTR_NATPAGE)
     5.9 +    if (mfn_valid(pte_pfn(__pte(pte))) && phy_pte.ma != VA_MATTR_NATPAGE)
    5.10          phy_pte.ma = VA_MATTR_WB;
    5.11  
    5.12      maddr = ((maddr & _PAGE_PPN_MASK) & PAGE_MASK) | (paddr & ~PAGE_MASK);
     6.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Thu Nov 06 12:14:06 2008 +0900
     6.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Nov 06 12:14:57 2008 +0900
     6.3 @@ -800,7 +800,7 @@ do_dom0vp_op(unsigned long cmd,
     6.4              dprintk(XENLOG_INFO, "%s: INVALID_MFN ret: 0x%lx\n",
     6.5                       __func__, ret);
     6.6          } else {
     6.7 -            ret = (ret & _PFN_MASK) >> PAGE_SHIFT;//XXX pte_pfn()
     6.8 +            ret = pte_pfn(__pte(ret));
     6.9          }
    6.10          perfc_incr(dom0vp_phystomach);
    6.11          break;