Skip to content

Commit

Permalink
hugetlb: introduce generic version of huge_pte_wrprotect
Browse files Browse the repository at this point in the history
arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use
the same version of huge_pte_wrprotect, so move this generic
implementation into asm-generic/hugetlb.h.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Alexandre Ghiti <[email protected]>
Reviewed-by: Luiz Capitulino <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Tested-by: Helge Deller <[email protected]>			[parisc]
Acked-by: Catalin Marinas <[email protected]>	[arm64]
Acked-by: Paul Burton <[email protected]>		[MIPS]
Acked-by: Ingo Molnar <[email protected]>		[x86]
Cc: Arnd Bergmann <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Russell King <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AlexGhiti authored and torvalds committed Oct 26, 2018
1 parent cae72ab commit c4916a0
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 45 deletions.
5 changes: 0 additions & 5 deletions arch/arm/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void arch_clear_hugepage_flags(struct page *page)
{
clear_bit(PG_dcache_clean, &page->flags);
Expand Down
5 changes: 0 additions & 5 deletions arch/arm64/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void arch_clear_hugepage_flags(struct page *page)
{
clear_bit(PG_dcache_clean, &page->flags);
Expand Down
5 changes: 0 additions & 5 deletions arch/ia64/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
{
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/mips/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ static inline int huge_pte_none(pte_t pte)
return !val || (val == (unsigned long)invalid_pte_table);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/parisc/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
{
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep);

Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
flush_hugetlb_page(vma, addr);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep,
pte_t pte, int dirty);
Expand Down
5 changes: 0 additions & 5 deletions arch/sh/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
{
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/sparc/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
{
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
Expand Down
5 changes: 0 additions & 5 deletions arch/x86/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
Expand Down
7 changes: 7 additions & 0 deletions include/asm-generic/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,11 @@ static inline int huge_pte_none(pte_t pte)
}
#endif

#ifndef __HAVE_ARCH_HUGE_PTE_WRPROTECT
static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}
#endif

#endif /* _ASM_GENERIC_HUGETLB_H */

0 comments on commit c4916a0

Please sign in to comment.