]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 May 2016 02:24:13 +0000 (19:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 May 2016 02:24:13 +0000 (19:24 -0700)
Pull sparc updates from David Miller:
 "Some 32-bit kgdb cleanups from Sam Ravnborg, and a hugepage TLB flush
  overhead fix on 64-bit from Nitin Gupta"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Reduce TLB flushes during hugepte changes
  aeroflex/greth: fix warning about unused variable
  openprom: fix warning
  sparc32: drop superfluous cast in calls to __nocache_pa()
  sparc32: fix build with STRICT_MM_TYPECHECKS
  sparc32: use proper prototype for trapbase
  sparc32: drop local prototype in kgdb_32
  sparc32: drop hardcoding trap_level in kgdb_trap

1  2 
arch/sparc/include/asm/pgtable_64.h

index 93ce0ada3c63fe1dfbd918125d7663886a78031d,5a189bf3c8ac58f4fd06af24189c8611b547e6f4..e7d82803a48fcc5a14e1f9cb283d71c58a002ce6
@@@ -375,7 -375,7 +375,7 @@@ static inline pgprot_t pgprot_noncached
  #define pgprot_noncached pgprot_noncached
  
  #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
- static inline pte_t pte_mkhuge(pte_t pte)
+ static inline unsigned long __pte_huge_mask(void)
  {
        unsigned long mask;
  
        : "=r" (mask)
        : "i" (_PAGE_SZHUGE_4U), "i" (_PAGE_SZHUGE_4V));
  
-       return __pte(pte_val(pte) | mask);
+       return mask;
+ }
+ static inline pte_t pte_mkhuge(pte_t pte)
+ {
+       return __pte(pte_val(pte) | __pte_huge_mask());
+ }
+ static inline bool is_hugetlb_pte(pte_t pte)
+ {
+       return !!(pte_val(pte) & __pte_huge_mask());
  }
  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
  static inline pmd_t pmd_mkhuge(pmd_t pmd)
  {
        return __pmd(pte_val(pte));
  }
  #endif
+ #else
+ static inline bool is_hugetlb_pte(pte_t pte)
+ {
+       return false;
+ }
  #endif
  
  static inline pte_t pte_mkdirty(pte_t pte)
@@@ -681,6 -697,8 +697,6 @@@ static inline unsigned long pmd_trans_h
        return pte_val(pte) & _PAGE_PMD_HUGE;
  }
  
 -#define has_transparent_hugepage() 1
 -
  static inline pmd_t pmd_mkold(pmd_t pmd)
  {
        pte_t pte = __pte(pmd_val(pmd));
@@@ -856,6 -874,19 +872,19 @@@ static inline unsigned long pud_pfn(pud
  void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
                   pte_t *ptep, pte_t orig, int fullmm);
  
+ static void maybe_tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
+                               pte_t *ptep, pte_t orig, int fullmm)
+ {
+       /* It is more efficient to let flush_tlb_kernel_range()
+        * handle init_mm tlb flushes.
+        *
+        * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U
+        *             and SUN4V pte layout, so this inline test is fine.
+        */
+       if (likely(mm != &init_mm) && pte_accessible(mm, orig))
+               tlb_batch_add(mm, vaddr, ptep, orig, fullmm);
+ }
  #define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
  static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
                                            unsigned long addr,
@@@ -872,15 -903,7 +901,7 @@@ static inline void __set_pte_at(struct 
        pte_t orig = *ptep;
  
        *ptep = pte;
-       /* It is more efficient to let flush_tlb_kernel_range()
-        * handle init_mm tlb flushes.
-        *
-        * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U
-        *             and SUN4V pte layout, so this inline test is fine.
-        */
-       if (likely(mm != &init_mm) && pte_accessible(mm, orig))
-               tlb_batch_add(mm, addr, ptep, orig, fullmm);
+       maybe_tlb_batch_add(mm, addr, ptep, orig, fullmm);
  }
  
  #define set_pte_at(mm,addr,ptep,pte)  \