aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/include/asm/pgtable_64.h4
-rw-r--r--arch/x86/include/asm/pgtable.h11
2 files changed, 11 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 7619f2f792af..dfb0019bf05b 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -616,7 +616,7 @@ static inline unsigned long pte_present(pte_t pte)
616} 616}
617 617
618#define pte_accessible pte_accessible 618#define pte_accessible pte_accessible
619static inline unsigned long pte_accessible(pte_t a) 619static inline unsigned long pte_accessible(struct mm_struct *mm, pte_t a)
620{ 620{
621 return pte_val(a) & _PAGE_VALID; 621 return pte_val(a) & _PAGE_VALID;
622} 622}
@@ -806,7 +806,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
806 * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U 806 * SUN4V NOTE: _PAGE_VALID is the same value in both the SUN4U
807 * and SUN4V pte layout, so this inline test is fine. 807 * and SUN4V pte layout, so this inline test is fine.
808 */ 808 */
809 if (likely(mm != &init_mm) && pte_accessible(orig)) 809 if (likely(mm != &init_mm) && pte_accessible(mm, orig))
810 tlb_batch_add(mm, addr, ptep, orig, fullmm); 810 tlb_batch_add(mm, addr, ptep, orig, fullmm);
811} 811}
812 812
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 1e672234c4ff..5460bf923e16 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -415,9 +415,16 @@ static inline int pte_present(pte_t a)
415} 415}
416 416
417#define pte_accessible pte_accessible 417#define pte_accessible pte_accessible
418static inline int pte_accessible(pte_t a) 418static inline bool pte_accessible(struct mm_struct *mm, pte_t a)
419{ 419{
420 return pte_flags(a) & _PAGE_PRESENT; 420 if (pte_flags(a) & _PAGE_PRESENT)
421 return true;
422
423 if ((pte_flags(a) & (_PAGE_PROTNONE | _PAGE_NUMA)) &&
424 mm_tlb_flush_pending(mm))
425 return true;
426
427 return false;
421} 428}
422 429
423static inline int pte_hidden(pte_t pte) 430static inline int pte_hidden(pte_t pte)