ia64/xen-unstable

changeset 17069:29faad225cbb

[IA64] Make translate_phy_pte() static

Second argument pte doesn't need to be a pointer.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Thu Feb 14 12:37:15 2008 -0700 (2008-02-14)
parents d8fbfd8ef184
children 2c9d0eb5a855
files xen/arch/ia64/vmx/vtlb.c xen/include/asm-ia64/vmmu.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/vtlb.c	Thu Feb 14 12:20:11 2008 -0700
     1.2 +++ b/xen/arch/ia64/vmx/vtlb.c	Thu Feb 14 12:37:15 2008 -0700
     1.3 @@ -24,6 +24,7 @@
     1.4  #include <asm/vmx_phy_mode.h>
     1.5  #include <asm/shadow.h>
     1.6  
     1.7 +static u64 translate_phy_pte(VCPU *v, u64 pte, u64 itir, u64 va);
     1.8  static thash_data_t *__alloc_chain(thash_cb_t *);
     1.9  
    1.10  static inline void cch_mem_init(thash_cb_t *hcb)
    1.11 @@ -183,7 +184,7 @@ void thash_vhpt_insert(VCPU *v, u64 pte,
    1.12      u64 phy_pte, psr;
    1.13      ia64_rr mrr;
    1.14  
    1.15 -    phy_pte = translate_phy_pte(v, &pte, itir, va);
    1.16 +    phy_pte = translate_phy_pte(v, pte, itir, va);
    1.17      mrr.rrval = ia64_get_rr(va);
    1.18  
    1.19      if (itir_ps(itir) >= mrr.ps && VMX_MMU_MODE(v) != VMX_MMU_PHY_D) {
    1.20 @@ -510,23 +511,20 @@ void thash_purge_entries_remote(VCPU *v,
    1.21      vhpt_purge(v, va, ps);
    1.22  }
    1.23  
    1.24 -u64 translate_phy_pte(VCPU *v, u64 *pte, u64 itir, u64 va)
    1.25 +static u64 translate_phy_pte(VCPU *v, u64 pte, u64 itir, u64 va)
    1.26  {
    1.27      u64 ps, ps_mask, paddr, maddr;
    1.28 -//    ia64_rr rr;
    1.29      union pte_flags phy_pte;
    1.30      struct domain *d = v->domain;
    1.31  
    1.32      ps = itir_ps(itir);
    1.33      ps_mask = ~((1UL << ps) - 1);
    1.34 -    phy_pte.val = *pte;
    1.35 -    paddr = *pte;
    1.36 -    paddr = ((paddr & _PAGE_PPN_MASK) & ps_mask) | (va & ~ps_mask);
    1.37 +    phy_pte.val = pte;
    1.38 +    paddr = ((pte & _PAGE_PPN_MASK) & ps_mask) | (va & ~ps_mask);
    1.39      maddr = lookup_domain_mpa(d, paddr, NULL);
    1.40 -    if (maddr & GPFN_IO_MASK) {
    1.41 -        *pte |= VTLB_PTE_IO;
    1.42 +    if (maddr & GPFN_IO_MASK)
    1.43          return -1;
    1.44 -    }
    1.45 +
    1.46      /* Ensure WB attribute if pte is related to a normal mem page,
    1.47       * which is required by vga acceleration since qemu maps shared
    1.48       * vram buffer with WB.
    1.49 @@ -534,8 +532,6 @@ u64 translate_phy_pte(VCPU *v, u64 *pte,
    1.50      if (phy_pte.ma != VA_MATTR_NATPAGE)
    1.51          phy_pte.ma = VA_MATTR_WB;
    1.52  
    1.53 -//    rr.rrval = ia64_get_rr(va);
    1.54 -//    ps = rr.ps;
    1.55      maddr = ((maddr & _PAGE_PPN_MASK) & PAGE_MASK) | (paddr & ~PAGE_MASK);
    1.56      phy_pte.ppn = maddr >> ARCH_PAGE_SHIFT;
    1.57  
    1.58 @@ -567,12 +563,12 @@ int thash_purge_and_insert(VCPU *v, u64 
    1.59      ps = itir_ps(itir);
    1.60      mrr.rrval = ia64_get_rr(ifa);
    1.61  
    1.62 -    phy_pte = translate_phy_pte(v, &pte, itir, ifa);
    1.63 +    phy_pte = translate_phy_pte(v, pte, itir, ifa);
    1.64  
    1.65      vtlb_purge(v, ifa, ps);
    1.66      vhpt_purge(v, ifa, ps);
    1.67  
    1.68 -    if (pte & VTLB_PTE_IO) {
    1.69 +    if (phy_pte == -1) {
    1.70          vtlb_insert(v, pte, itir, ifa);
    1.71          return 1;
    1.72      }
     2.1 --- a/xen/include/asm-ia64/vmmu.h	Thu Feb 14 12:20:11 2008 -0700
     2.2 +++ b/xen/include/asm-ia64/vmmu.h	Thu Feb 14 12:37:15 2008 -0700
     2.3 @@ -198,7 +198,6 @@ extern thash_data_t * vhpt_lookup(u64 va
     2.4  extern unsigned long fetch_code(struct vcpu *vcpu, u64 gip, IA64_BUNDLE *pbundle);
     2.5  extern void emulate_io_inst(struct vcpu *vcpu, u64 padr, u64 ma);
     2.6  extern int vhpt_enabled(struct vcpu *vcpu, uint64_t vadr, vhpt_ref_t ref);
     2.7 -extern u64 translate_phy_pte(struct vcpu *v, u64 *pte, u64 itir, u64 va);
     2.8  extern void thash_vhpt_insert(struct vcpu *v, u64 pte, u64 itir, u64 ifa,
     2.9                                int type);
    2.10  extern u64 guest_vhpt_lookup(u64 iha, u64 *pte);