ia64/xen-unstable

changeset 6154:08d19da852c7

Optimize the Linux arch xen implementation of "set_pte_at".
Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Sat Aug 13 21:26:49 2005 +0000 (2005-08-13)
parents a8a88f85a3e6
children 050bf85fb870
files linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.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-2level.h	Sat Aug 13 21:01:35 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Sat Aug 13 21:26:49 2005 +0000
     1.3 @@ -14,7 +14,17 @@
     1.4   * hook is made available.
     1.5   */
     1.6  #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
     1.7 -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
     1.8 +
     1.9 +inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
    1.10 +		       pte_t *ptep, pte_t val )
    1.11 +{
    1.12 +    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    1.13 +	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    1.14 +    {
    1.15 +        set_pte(ptep, val);
    1.16 +    }
    1.17 +}
    1.18 +
    1.19  #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
    1.20  
    1.21  #ifndef CONFIG_XEN_SHADOW_MODE
     2.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Sat Aug 13 21:01:35 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h	Sat Aug 13 21:26:49 2005 +0000
     2.3 @@ -68,7 +68,16 @@ static inline void set_pte(pte_t *ptep, 
     2.4  		xen_l1_entry_update((pteptr), (pteval))
     2.5  # define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
     2.6  #endif
     2.7 -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
     2.8 +
     2.9 +inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
    2.10 +		       pte_t *ptep, pte_t val )
    2.11 +{
    2.12 +    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    2.13 +	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    2.14 +    {
    2.15 +        set_pte(ptep, val);
    2.16 +    }
    2.17 +}
    2.18  
    2.19  #ifdef CONFIG_XEN_SHADOW_MODE
    2.20  # define set_pmd(pmdptr,pmdval) \
     3.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Sat Aug 13 21:01:35 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Sat Aug 13 21:26:49 2005 +0000
     3.3 @@ -265,7 +265,16 @@ static inline unsigned long pud_bad(pud_
     3.4         val &= ~(_PAGE_USER | _PAGE_DIRTY); 
     3.5         return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
     3.6  } 
     3.7 -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
     3.8 +
     3.9 +inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
    3.10 +		       pte_t *ptep, pte_t val )
    3.11 +{
    3.12 +    if ( ((mm != current->mm) && (mm != &init_mm)) ||
    3.13 +	 HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
    3.14 +    {
    3.15 +        set_pte(ptep, val);
    3.16 +    }
    3.17 +}
    3.18  
    3.19  #define pte_none(x)	(!(x).pte)
    3.20  #define pte_present(x)	((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))