diff options
author | Becky Bruce <beckyb@kernel.crashing.org> | 2011-11-28 09:43:33 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-12-07 00:26:24 -0500 |
commit | d93e4d7d72037d8c9405e8d404ecb2ee162adc25 (patch) | |
tree | ae6a9e67f9232a7d48b6df8d17f9b075e1919955 /arch/powerpc/mm | |
parent | 1257a765479224e7c16f22218dfba48ffa6e6632 (diff) |
powerpc/book3e: Change hugetlb preload to take vma argument
This avoids an extra find_vma() and is less error-prone.
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage-book3e.c | 8 | ||||
-rw-r--r-- | arch/powerpc/mm/mem.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c index 4d6d849a3e54..3bc700655fc8 100644 --- a/arch/powerpc/mm/hugetlbpage-book3e.c +++ b/arch/powerpc/mm/hugetlbpage-book3e.c | |||
@@ -37,12 +37,14 @@ static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid) | |||
37 | return found; | 37 | return found; |
38 | } | 38 | } |
39 | 39 | ||
40 | void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte) | 40 | void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea, |
41 | pte_t pte) | ||
41 | { | 42 | { |
42 | unsigned long mas1, mas2; | 43 | unsigned long mas1, mas2; |
43 | u64 mas7_3; | 44 | u64 mas7_3; |
44 | unsigned long psize, tsize, shift; | 45 | unsigned long psize, tsize, shift; |
45 | unsigned long flags; | 46 | unsigned long flags; |
47 | struct mm_struct *mm; | ||
46 | 48 | ||
47 | #ifdef CONFIG_PPC_FSL_BOOK3E | 49 | #ifdef CONFIG_PPC_FSL_BOOK3E |
48 | int index, ncams; | 50 | int index, ncams; |
@@ -51,12 +53,14 @@ void book3e_hugetlb_preload(struct mm_struct *mm, unsigned long ea, pte_t pte) | |||
51 | if (unlikely(is_kernel_addr(ea))) | 53 | if (unlikely(is_kernel_addr(ea))) |
52 | return; | 54 | return; |
53 | 55 | ||
56 | mm = vma->vm_mm; | ||
57 | |||
54 | #ifdef CONFIG_PPC_MM_SLICES | 58 | #ifdef CONFIG_PPC_MM_SLICES |
55 | psize = get_slice_psize(mm, ea); | 59 | psize = get_slice_psize(mm, ea); |
56 | tsize = mmu_get_tsize(psize); | 60 | tsize = mmu_get_tsize(psize); |
57 | shift = mmu_psize_defs[psize].shift; | 61 | shift = mmu_psize_defs[psize].shift; |
58 | #else | 62 | #else |
59 | psize = vma_mmu_pagesize(find_vma(mm, ea)); | 63 | psize = vma_mmu_pagesize(vma); |
60 | shift = __ilog2(psize); | 64 | shift = __ilog2(psize); |
61 | tsize = shift - 10; | 65 | tsize = shift - 10; |
62 | #endif | 66 | #endif |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 22563b9664c3..83d819f30864 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -553,7 +553,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |||
553 | #if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ | 553 | #if (defined(CONFIG_PPC_BOOK3E_64) || defined(CONFIG_PPC_FSL_BOOK3E)) \ |
554 | && defined(CONFIG_HUGETLB_PAGE) | 554 | && defined(CONFIG_HUGETLB_PAGE) |
555 | if (is_vm_hugetlb_page(vma)) | 555 | if (is_vm_hugetlb_page(vma)) |
556 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); | 556 | book3e_hugetlb_preload(vma, address, *ptep); |
557 | #endif | 557 | #endif |
558 | } | 558 | } |
559 | 559 | ||