Jan Beulich
2007-Feb-13 15:07 UTC
[Xen-devel] [PATCH] 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> Index: sle10sp1-2007-01-31/include/asm-i386/mach-xen/asm/pgtable-3level.h ==================================================================--- sle10sp1-2007-01-31.orig/include/asm-i386/mach-xen/asm/pgtable-3level.h 2007-02-13 14:14:45.000000000 +0100 +++ sle10sp1-2007-01-31/include/asm-i386/mach-xen/asm/pgtable-3level.h 2007-02-13 12:28:26.000000000 +0100 @@ -52,22 +52,14 @@ static inline int pte_exec_kernel(pte_t */ #define __HAVE_ARCH_SET_PTE_ATOMIC -#if 1 -/* use writable pagetables */ static inline void set_pte(pte_t *ptep, pte_t pte) { ptep->pte_high = pte.pte_high; smp_wmb(); ptep->pte_low = pte.pte_low; } -# define set_pte_atomic(pteptr,pteval) \ +#define set_pte_atomic(pteptr,pteval) \ set_64bit((unsigned long long *)(pteptr),pte_val_ma(pteval)) -#else -/* no writable pagetables */ -# define set_pte(pteptr,pteval) \ - xen_l1_entry_update((pteptr), (pteval)) -# define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval) -#endif #define set_pte_at(_mm,addr,ptep,pteval) do { \ if (((_mm) != current->mm && (_mm) != &init_mm) || \ Index: sle10sp1-2007-01-31/include/asm-i386/mach-xen/asm/pgtable.h ==================================================================--- sle10sp1-2007-01-31.orig/include/asm-i386/mach-xen/asm/pgtable.h 2007-02-13 12:27:16.000000000 +0100 +++ sle10sp1-2007-01-31/include/asm-i386/mach-xen/asm/pgtable.h 2007-02-13 12:28:26.000000000 +0100 @@ -432,12 +432,15 @@ extern void noexec_setup(const char *str #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ do { \ if (__dirty) { \ - if ( likely((__vma)->vm_mm == current->mm) ) { \ - BUG_ON(HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits))); \ - } else { \ - xen_l1_entry_update((__ptep), (__entry)); \ - flush_tlb_page((__vma), (__address)); \ - } \ + if ( likely((__vma)->vm_mm == current->mm) ) { \ + BUG_ON(HYPERVISOR_update_va_mapping(__address, \ + __entry, \ + (unsigned long)(__vma)->vm_mm->cpu_vm_mask.bits| \ + UVMF_INVLPG|UVMF_MULTI)); \ + } else { \ + xen_l1_entry_update(__ptep, __entry); \ + flush_tlb_page(__vma, __address); \ + } \ } \ } while (0) Index: sle10sp1-2007-01-31/include/asm-x86_64/mach-xen/asm/pgtable.h ==================================================================--- sle10sp1-2007-01-31.orig/include/asm-x86_64/mach-xen/asm/pgtable.h 2007-02-13 12:27:16.000000000 +0100 +++ sle10sp1-2007-01-31/include/asm-x86_64/mach-xen/asm/pgtable.h 2007-02-13 12:28:26.000000000 +0100 @@ -479,24 +479,18 @@ static inline pte_t pte_modify(pte_t pte * race with other CPU''s that might be updating the dirty * bit at the same time. */ #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS -#if 0 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ do { \ if (__dirty) { \ - set_pte(__ptep, __entry); \ - flush_tlb_page(__vma, __address); \ - } \ - } while (0) -#endif -#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ - do { \ - if (__dirty) { \ - if ( likely((__vma)->vm_mm == current->mm) ) { \ - BUG_ON(HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits))); \ - } else { \ - xen_l1_entry_update((__ptep), (__entry)); \ - flush_tlb_page((__vma), (__address)); \ - } \ + if ( likely((__vma)->vm_mm == current->mm) ) { \ + BUG_ON(HYPERVISOR_update_va_mapping(__address, \ + __entry, \ + (unsigned long)(__vma)->vm_mm->cpu_vm_mask.bits| \ + UVMF_INVLPG|UVMF_MULTI)); \ + } else { \ + xen_l1_entry_update(__ptep, __entry); \ + flush_tlb_page(__vma, __address); \ + } \ } \ } while (0) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel