Skip to content

Commit

Permalink
hugetlb: introduce generic version of huge_pte_none()
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_none, 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 fe63222 commit cae72ab
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 40 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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma)));
}

#define __HAVE_ARCH_HUGE_PTE_NONE
static inline int huge_pte_none(pte_t pte)
{
unsigned long val = pte_val(pte) & ~_PAGE_GLOBAL;
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}

static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
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 @@ -73,4 +73,11 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
}
#endif

#ifndef __HAVE_ARCH_HUGE_PTE_NONE
static inline int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}
#endif

#endif /* _ASM_GENERIC_HUGETLB_H */

0 comments on commit cae72ab

Please sign in to comment.