Commit d93e4d7d authored by Becky Bruce's avatar Becky Bruce Committed by Benjamin Herrenschmidt

powerpc/book3e: Change hugetlb preload to take vma argument

This avoids an extra find_vma() and is less error-prone.
Signed-off-by: default avatarBecky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1257a765
...@@ -52,7 +52,8 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, ...@@ -52,7 +52,8 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
} }
#endif #endif
void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte); void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
pte_t pte);
void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr); void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
......
...@@ -37,12 +37,14 @@ static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid) ...@@ -37,12 +37,14 @@ static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid)
return found; return found;
} }
void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte) void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
pte_t pte)
{ {
unsigned long mas1, mas2; unsigned long mas1, mas2;
u64 mas7_3; u64 mas7_3;
unsigned long psize, tsize, shift; unsigned long psize, tsize, shift;
unsigned long flags; unsigned long flags;
struct mm_struct *mm;
#ifdef CONFIG_PPC_FSL_BOOK3E #ifdef CONFIG_PPC_FSL_BOOK3E
int index, ncams; int index, ncams;
...@@ -51,12 +53,14 @@ void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte) ...@@ -51,12 +53,14 @@ void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte)
if (unlikely(is_kernel_addr(ea))) if (unlikely(is_kernel_addr(ea)))
return; return;
mm = vma->vm_mm;
#ifdef CONFIG_PPC_MM_SLICES #ifdef CONFIG_PPC_MM_SLICES
psize = get_slice_psize(mm, ea); psize = get_slice_psize(mm, ea);
tsize = mmu_get_tsize(psize); tsize = mmu_get_tsize(psize);
shift = mmu_psize_defs[psize].shift; shift = mmu_psize_defs[psize].shift;
#else #else
psize = vma_mmu_pagesize(find_vma(mm, ea)); psize = vma_mmu_pagesize(vma);
shift = __ilog2(psize); shift = __ilog2(psize);
tsize = shift - 10; tsize = shift - 10;
#endif #endif
......
...@@ -553,7 +553,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, ...@@ -553,7 +553,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
#if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ #if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \
&& defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_HUGETLB_PAGE)
if (is_vm_hugetlb_page(vma)) if (is_vm_hugetlb_page(vma))
book3e_hugetlb_preload(vma->vm_mm, address, *ptep); book3e_hugetlb_preload(vma, address, *ptep);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment