ia64/xen-unstable

changeset 7906:69ea493e415a

Simplify arbitrary_virt_to_phys, and fix the x86/64 version to mask
out the NX bit.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 18 17:41:03 2005 +0100 (2005-11-18)
parents 5c954929bb0d
children 8b384e741382
files linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Fri Nov 18 16:32:04 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Fri Nov 18 17:41:03 2005 +0100
     1.3 @@ -438,9 +438,8 @@ void make_pages_writable(void *va, unsig
     1.4  
     1.5  #define arbitrary_virt_to_machine(__va)					\
     1.6  ({									\
     1.7 -	pte_t *__pte = virt_to_ptep(__va);				\
     1.8 -	maddr_t __pa = (maddr_t)pte_mfn(*__pte) << PAGE_SHIFT;		\
     1.9 -	__pa | ((unsigned long)(__va) & (PAGE_SIZE-1));			\
    1.10 +	maddr_t m = (maddr_t)pte_mfn(*virt_to_ptep(__va)) << PAGE_SHIFT;\
    1.11 +	m | ((unsigned long)(__va) & (PAGE_SIZE-1));			\
    1.12  })
    1.13  
    1.14  #endif /* !__ASSEMBLY__ */
     2.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Fri Nov 18 16:32:04 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Fri Nov 18 17:41:03 2005 +0100
     2.3 @@ -29,9 +29,8 @@ extern void xen_init_pt(void);
     2.4  
     2.5  #define arbitrary_virt_to_machine(__va)					\
     2.6  ({									\
     2.7 -	pte_t *__pte = virt_to_ptep(__va);				\
     2.8 -	unsigned long __pa = (*(unsigned long *)__pte) & PAGE_MASK;	\
     2.9 -	__pa | ((unsigned long)(__va) & (PAGE_SIZE-1));			\
    2.10 +	maddr_t m = (maddr_t)pte_mfn(*virt_to_ptep(__va)) << PAGE_SHIFT;\
    2.11 +	m | ((unsigned long)(__va) & (PAGE_SIZE-1));			\
    2.12  })
    2.13  #endif
    2.14