# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Node ID 90071b25e9c03b8a29841618e6eb7f655c4fe4bf
# Parent  0141b3ffefef595ec3bc8732e16e257b469debc7
clean up vmx_vcpu_tpa() and mfn_to_gmfn(). don't access mpt_table directly.
use get_gpfn_from_mfn()
PATCHNAME: vmx_vcpu_tpa_use_get_gpfn_from_mfn

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 0141b3ffefef -r 90071b25e9c0 xen/arch/ia64/vmx/vmmu.c
--- a/xen/arch/ia64/vmx/vmmu.c	Thu Jun 08 18:27:05 2006 +0900
+++ b/xen/arch/ia64/vmx/vmmu.c	Thu Jun 08 18:27:06 2006 +0900
@@ -586,7 +586,7 @@ IA64FAULT vmx_vcpu_tpa(VCPU *vcpu, UINT6
             dnat_page_consumption(vcpu, vadr);
             return IA64_FAULT;
         }else{
-            *padr = ((*(mpt_table+arch_to_xen_ppn(data->ppn)))<<PAGE_SHIFT) | (vadr&(PAGE_SIZE-1));
+            *padr = (get_gpfn_from_mfn(arch_to_xen_ppn(data->ppn)) << PAGE_SHIFT) | (vadr & (PAGE_SIZE - 1));
             return IA64_NO_FAULT;
         }
     }
diff -r 0141b3ffefef -r 90071b25e9c0 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Thu Jun 08 18:27:05 2006 +0900
+++ b/xen/include/asm-ia64/mm.h	Thu Jun 08 18:27:06 2006 +0900
@@ -460,7 +460,7 @@ extern u64 translate_domain_pte(u64 ptev
 */
 
 #define mfn_to_gmfn(_d, mfn)			\
-    machine_to_phys_mapping[(mfn)]
+    get_gpfn_from_mfn(mfn)
 
 #define gmfn_to_mfn(_d, gpfn)			\
     gmfn_to_mfn_foreign((_d), (gpfn))