Release 4.14 arch/powerpc/include/asm/hugetlb.h
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_POWERPC_HUGETLB_H
#define _ASM_POWERPC_HUGETLB_H
#ifdef CONFIG_HUGETLB_PAGE
#include <asm/page.h>
#include <asm-generic/hugetlb.h>
extern struct kmem_cache *hugepte_cache;
#ifdef CONFIG_PPC_BOOK3S_64
#include <asm/book3s/64/hugetlb.h>
/*
* This should work for other subarchs too. But right now we use the
* new format only for 64bit book3s
*/
static inline pte_t *hugepd_page(hugepd_t hpd)
{
BUG_ON(!hugepd_ok(hpd));
/*
* We have only four bits to encode, MMU page size
*/
BUILD_BUG_ON((MMU_PAGE_COUNT - 1) > 0xf);
return __va(hpd_val(hpd) & HUGEPD_ADDR_MASK);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 39 | 90.70% | 2 | 66.67% |
Paul Mackerras | 4 | 9.30% | 1 | 33.33% |
Total | 43 | 100.00% | 3 | 100.00% |
static inline unsigned int hugepd_mmu_psize(hugepd_t hpd)
{
return (hpd_val(hpd) & HUGEPD_SHIFT_MASK) >> 2;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 23 | 100.00% | 2 | 100.00% |
Total | 23 | 100.00% | 2 | 100.00% |
static inline unsigned int hugepd_shift(hugepd_t hpd)
{
return mmu_psize_to_shift(hugepd_mmu_psize(hpd));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
static inline void flush_hugetlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
if (radix_enabled())
return radix__flush_hugetlb_page(vma, vmaddr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 29 | 100.00% | 1 | 100.00% |
Total | 29 | 100.00% | 1 | 100.00% |
static inline void __local_flush_hugetlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
if (radix_enabled())
return radix__local_flush_hugetlb_page(vma, vmaddr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 29 | 100.00% | 1 | 100.00% |
Total | 29 | 100.00% | 1 | 100.00% |
#else
static inline pte_t *hugepd_page(hugepd_t hpd)
{
BUG_ON(!hugepd_ok(hpd));
#ifdef CONFIG_PPC_8xx
return (pte_t *)__va(hpd_val(hpd) &
~(_PMD_PAGE_MASK | _PMD_PRESENT_MASK));
#else
return (pte_t *)((hpd_val(hpd) &
~HUGEPD_SHIFT_MASK) | PD_HUGE);
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Becky Bruce | 36 | 54.55% | 1 | 33.33% |
Christophe Leroy | 24 | 36.36% | 1 | 33.33% |
Aneesh Kumar K.V | 6 | 9.09% | 1 | 33.33% |
Total | 66 | 100.00% | 3 | 100.00% |
static inline unsigned int hugepd_shift(hugepd_t hpd)
{
#ifdef CONFIG_PPC_8xx
return ((hpd_val(hpd) & _PMD_PAGE_MASK) >> 1) + 17;
#else
return hpd_val(hpd) & HUGEPD_SHIFT_MASK;
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 20 | 47.62% | 1 | 33.33% |
Becky Bruce | 16 | 38.10% | 1 | 33.33% |
Aneesh Kumar K.V | 6 | 14.29% | 1 | 33.33% |
Total | 42 | 100.00% | 3 | 100.00% |
#endif /* CONFIG_PPC_BOOK3S_64 */
static inline pte_t *hugepte_offset(hugepd_t hpd, unsigned long addr,
unsigned pdshift)
{
/*
* On FSL BookE, we have multiple higher-level table entries that
* point to the same hugepte. Just use the first one since they're all
* identical. So for that case, idx=0.
*/
unsigned long idx = 0;
pte_t *dir = hugepd_page(hpd);
#ifndef CONFIG_PPC_FSL_BOOK3E
idx = (addr & ((1UL << pdshift) - 1)) >> hugepd_shift(hpd);
#endif
return dir + idx;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Becky Bruce | 62 | 95.38% | 2 | 66.67% |
Aneesh Kumar K.V | 3 | 4.62% | 1 | 33.33% |
Total | 65 | 100.00% | 3 | 100.00% |
pte_t *huge_pte_offset_and_shift(struct mm_struct *mm,
unsigned long addr, unsigned *shift);
void flush_dcache_icache_hugepage(struct page *page);
#if defined(CONFIG_PPC_MM_SLICES)
int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
unsigned long len);
#else
static inline int is_hugepage_only_range(struct mm_struct *mm,
unsigned long addr,
unsigned long len)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Becky Bruce | 23 | 100.00% | 1 | 100.00% |
Total | 23 | 100.00% | 1 | 100.00% |
#endif
void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
pte_t pte);
#ifdef CONFIG_PPC_8xx
static inline void flush_hugetlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
flush_tlb_page(vma, vmaddr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 23 | 100.00% | 1 | 100.00% |
Total | 23 | 100.00% | 1 | 100.00% |
#else
void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
#endif
void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
unsigned long end, unsigned long floor,
unsigned long ceiling);
/*
* The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
* to override the version in mm/hugetlb.c
*/
#define vma_mmu_pagesize vma_mmu_pagesize
/*
* If the arch doesn't supply something else, assume that hugepage
* size aligned regions are ok without further preparation.
*/
static inline int prepare_hugepage_range(struct file *file,
unsigned long addr, unsigned long len)
{
struct hstate *h = hstate_file(file);
if (len & ~huge_page_mask(h))
return -EINVAL;
if (addr & ~huge_page_mask(h))
return -EINVAL;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gerald Schaefer | 38 | 62.30% | 1 | 33.33% |
Jon Tollefson | 18 | 29.51% | 1 | 33.33% |
Andi Kleen | 5 | 8.20% | 1 | 33.33% |
Total | 61 | 100.00% | 3 | 100.00% |
static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte)
{
set_pte_at(mm, addr, ptep, pte);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Gibson | 34 | 100.00% | 1 | 100.00% |
Total | 34 | 100.00% | 1 | 100.00% |
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
#ifdef CONFIG_PPC64
return __pte(pte_update(mm, addr, ptep, ~0UL, 0, 1));
#else
return __pte(pte_update(ptep, ~0UL, 0));
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Gibson | 38 | 62.30% | 1 | 33.33% |
Becky Bruce | 21 | 34.43% | 1 | 33.33% |
Aneesh Kumar K.V | 2 | 3.28% | 1 | 33.33% |
Total | 61 | 100.00% | 3 | 100.00% |
static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
{
pte_t pte;
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
flush_hugetlb_page(vma, addr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Gibson | 24 | 55.81% | 1 | 33.33% |
Gerald Schaefer | 18 | 41.86% | 1 | 33.33% |
Aneesh Kumar K.V | 1 | 2.33% | 1 | 33.33% |
Total | 43 | 100.00% | 3 | 100.00% |
static inline int huge_pte_none(pte_t pte)
{
return pte_none(pte);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gerald Schaefer | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline pte_t huge_pte_wrprotect(pte_t pte)
{
return pte_wrprotect(pte);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gerald Schaefer | 16 | 100.00% | 1 | 100.00% |
Total | 16 | 100.00% | 1 | 100.00% |
static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep,
pte_t pte, int dirty)
{
#ifdef HUGETLB_NEED_PRELOAD
/*
* The "return 1" forces a call of update_mmu_cache, which will write a
* TLB entry. Without this, platforms that don't do a write of the TLB
* entry in the TLB miss handler asm will fault ad infinitum.
*/
ptep_set_access_flags(vma, addr, ptep, pte, dirty);
return 1;
#else
return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gerald Schaefer | 40 | 62.50% | 1 | 33.33% |
Becky Bruce | 24 | 37.50% | 2 | 66.67% |
Total | 64 | 100.00% | 3 | 100.00% |
static inline pte_t huge_ptep_get(pte_t *ptep)
{
return *ptep;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Gerald Schaefer | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void arch_clear_hugepage_flags(struct page *page)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Will Deacon | 11 | 100.00% | 1 | 100.00% |
Total | 11 | 100.00% | 1 | 100.00% |
#else /* ! CONFIG_HUGETLB_PAGE */
static inline void flush_hugetlb_page(struct vm_area_struct *vma,
unsigned long vmaddr)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Becky Bruce | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#define hugepd_shift(x) 0
static inline pte_t *hugepte_offset(hugepd_t hpd, unsigned long addr,
unsigned pdshift)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Aneesh Kumar K.V | 21 | 100.00% | 2 | 100.00% |
Total | 21 | 100.00% | 2 | 100.00% |
#endif /* CONFIG_HUGETLB_PAGE */
#endif /* _ASM_POWERPC_HUGETLB_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Becky Bruce | 251 | 28.17% | 6 | 22.22% |
Gerald Schaefer | 201 | 22.56% | 4 | 14.81% |
Aneesh Kumar K.V | 198 | 22.22% | 8 | 29.63% |
David Gibson | 123 | 13.80% | 2 | 7.41% |
Christophe Leroy | 74 | 8.31% | 1 | 3.70% |
Jon Tollefson | 18 | 2.02% | 1 | 3.70% |
Will Deacon | 11 | 1.23% | 1 | 3.70% |
Mel Gorman | 5 | 0.56% | 1 | 3.70% |
Andi Kleen | 5 | 0.56% | 1 | 3.70% |
Paul Mackerras | 4 | 0.45% | 1 | 3.70% |
Greg Kroah-Hartman | 1 | 0.11% | 1 | 3.70% |
Total | 891 | 100.00% | 27 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.