[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Simplify arbitrary_virt_to_phys, and fix the x86/64 version to mask



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 69ea493e415a2e583e91097bfd0d8d5146f6cc2a
# Parent  5c954929bb0d9ecafc144c433b68e7d65a9e5453
Simplify arbitrary_virt_to_phys, and fix the x86/64 version to mask
out the NX bit.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 5c954929bb0d -r 69ea493e415a 
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h   Fri Nov 18 
15:32:04 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h   Fri Nov 18 
16:41:03 2005
@@ -438,9 +438,8 @@
 
 #define arbitrary_virt_to_machine(__va)                                        
\
 ({                                                                     \
-       pte_t *__pte = virt_to_ptep(__va);                              \
-       maddr_t __pa = (maddr_t)pte_mfn(*__pte) << PAGE_SHIFT;          \
-       __pa | ((unsigned long)(__va) & (PAGE_SIZE-1));                 \
+       maddr_t m = (maddr_t)pte_mfn(*virt_to_ptep(__va)) << PAGE_SHIFT;\
+       m | ((unsigned long)(__va) & (PAGE_SIZE-1));                    \
 })
 
 #endif /* !__ASSEMBLY__ */
diff -r 5c954929bb0d -r 69ea493e415a 
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Fri Nov 18 
15:32:04 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h Fri Nov 18 
16:41:03 2005
@@ -29,9 +29,8 @@
 
 #define arbitrary_virt_to_machine(__va)                                        
\
 ({                                                                     \
-       pte_t *__pte = virt_to_ptep(__va);                              \
-       unsigned long __pa = (*(unsigned long *)__pte) & PAGE_MASK;     \
-       __pa | ((unsigned long)(__va) & (PAGE_SIZE-1));                 \
+       maddr_t m = (maddr_t)pte_mfn(*virt_to_ptep(__va)) << PAGE_SHIFT;\
+       m | ((unsigned long)(__va) & (PAGE_SIZE-1));                    \
 })
 #endif
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.