ia64/xen-unstable

changeset 14019:4b9680c58d73

linux/x86: Clean up page table handling headers

- remove dead code
- fix line breaking and space vs. tab usage
- remove redundant parentheses

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Tue Feb 20 09:41:32 2007 +0000 (2007-02-20)
parents 832b252f1f6f
children 266d203d7f39
files linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable-3level.h linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable-3level.h	Tue Feb 20 09:34:22 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable-3level.h	Tue Feb 20 09:41:32 2007 +0000
     1.3 @@ -52,22 +52,14 @@ static inline int pte_exec_kernel(pte_t 
     1.4   */
     1.5  #define __HAVE_ARCH_SET_PTE_ATOMIC
     1.6  
     1.7 -#if 1
     1.8 -/* use writable pagetables */
     1.9  static inline void set_pte(pte_t *ptep, pte_t pte)
    1.10  {
    1.11  	ptep->pte_high = pte.pte_high;
    1.12  	smp_wmb();
    1.13  	ptep->pte_low = pte.pte_low;
    1.14  }
    1.15 -# define set_pte_atomic(pteptr,pteval) \
    1.16 +#define set_pte_atomic(pteptr,pteval) \
    1.17  		set_64bit((unsigned long long *)(pteptr),pte_val_ma(pteval))
    1.18 -#else
    1.19 -/* no writable pagetables */
    1.20 -# define set_pte(pteptr,pteval)				\
    1.21 -		xen_l1_entry_update((pteptr), (pteval))
    1.22 -# define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
    1.23 -#endif
    1.24  
    1.25  #define set_pte_at(_mm,addr,ptep,pteval) do {				\
    1.26  	if (((_mm) != current->mm && (_mm) != &init_mm) ||		\
     2.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h	Tue Feb 20 09:34:22 2007 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h	Tue Feb 20 09:41:32 2007 +0000
     2.3 @@ -433,12 +433,15 @@ extern void noexec_setup(const char *str
     2.4  #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
     2.5  	do {								  \
     2.6  		if (__dirty) {						  \
     2.7 -		        if ( likely((__vma)->vm_mm == current->mm) ) {    \
     2.8 -			    BUG_ON(HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits))); \
     2.9 -			} else {                                          \
    2.10 -                            xen_l1_entry_update((__ptep), (__entry)); \
    2.11 -			    flush_tlb_page((__vma), (__address));         \
    2.12 -			}                                                 \
    2.13 +			if ( likely((__vma)->vm_mm == current->mm) ) {	  \
    2.14 +				BUG_ON(HYPERVISOR_update_va_mapping(__address, \
    2.15 +					__entry,			  \
    2.16 +					(unsigned long)(__vma)->vm_mm->cpu_vm_mask.bits| \
    2.17 +					UVMF_INVLPG|UVMF_MULTI));	  \
    2.18 +			} else {					  \
    2.19 +				xen_l1_entry_update(__ptep, __entry);	  \
    2.20 +				flush_tlb_page(__vma, __address);	  \
    2.21 +			}						  \
    2.22  		}							  \
    2.23  	} while (0)
    2.24  
     3.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgtable.h	Tue Feb 20 09:34:22 2007 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/pgtable.h	Tue Feb 20 09:41:32 2007 +0000
     3.3 @@ -487,24 +487,18 @@ static inline pte_t pte_modify(pte_t pte
     3.4   * race with other CPU's that might be updating the dirty
     3.5   * bit at the same time. */
     3.6  #define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
     3.7 -#if 0
     3.8  #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
     3.9  	do {								  \
    3.10  		if (__dirty) {						  \
    3.11 -			set_pte(__ptep, __entry);			  \
    3.12 -			flush_tlb_page(__vma, __address);		  \
    3.13 -		}							  \
    3.14 -	} while (0)
    3.15 -#endif
    3.16 -#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
    3.17 -	do {								  \
    3.18 -		if (__dirty) {						  \
    3.19 -		        if ( likely((__vma)->vm_mm == current->mm) ) {    \
    3.20 -			    BUG_ON(HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits))); \
    3.21 -			} else {                                          \
    3.22 -                            xen_l1_entry_update((__ptep), (__entry)); \
    3.23 -			    flush_tlb_page((__vma), (__address));         \
    3.24 -			}                                                 \
    3.25 +			if ( likely((__vma)->vm_mm == current->mm) ) {	  \
    3.26 +				BUG_ON(HYPERVISOR_update_va_mapping(__address, \
    3.27 +					__entry,			  \
    3.28 +					(unsigned long)(__vma)->vm_mm->cpu_vm_mask.bits| \
    3.29 +						UVMF_INVLPG|UVMF_MULTI)); \
    3.30 +			} else {					  \
    3.31 +				xen_l1_entry_update(__ptep, __entry);	  \
    3.32 +				flush_tlb_page(__vma, __address);	  \
    3.33 +			}						  \
    3.34  		}							  \
    3.35  	} while (0)
    3.36