diff options
author | Herbert Xu <herbert@lithui.me.apana.org.au> | 2017-12-22 04:00:50 -0500 |
---|---|---|
committer | Herbert Xu <herbert@lithui.me.apana.org.au> | 2017-12-22 04:00:50 -0500 |
commit | 45fa9a324d0f5be9140ba2e0db9b8fb8a0b9b7e8 (patch) | |
tree | a5e7c8428030ec0462b58133d6548ddff3802018 /mm/hugetlb.c | |
parent | fc8517bf627c9b834f80274a1bc9ecd39b27231b (diff) | |
parent | 2973633e9f09311e849f975d969737af81a521ff (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to pick up inside-secure fixes.
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 681b300185c0..9a334f5fb730 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -3125,6 +3125,13 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) | |||
3125 | } | 3125 | } |
3126 | } | 3126 | } |
3127 | 3127 | ||
3128 | static int hugetlb_vm_op_split(struct vm_area_struct *vma, unsigned long addr) | ||
3129 | { | ||
3130 | if (addr & ~(huge_page_mask(hstate_vma(vma)))) | ||
3131 | return -EINVAL; | ||
3132 | return 0; | ||
3133 | } | ||
3134 | |||
3128 | /* | 3135 | /* |
3129 | * We cannot handle pagefaults against hugetlb pages at all. They cause | 3136 | * We cannot handle pagefaults against hugetlb pages at all. They cause |
3130 | * handle_mm_fault() to try to instantiate regular-sized pages in the | 3137 | * handle_mm_fault() to try to instantiate regular-sized pages in the |
@@ -3141,6 +3148,7 @@ const struct vm_operations_struct hugetlb_vm_ops = { | |||
3141 | .fault = hugetlb_vm_op_fault, | 3148 | .fault = hugetlb_vm_op_fault, |
3142 | .open = hugetlb_vm_op_open, | 3149 | .open = hugetlb_vm_op_open, |
3143 | .close = hugetlb_vm_op_close, | 3150 | .close = hugetlb_vm_op_close, |
3151 | .split = hugetlb_vm_op_split, | ||
3144 | }; | 3152 | }; |
3145 | 3153 | ||
3146 | static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, | 3154 | static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, |
@@ -4627,7 +4635,9 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, | |||
4627 | pte_t *pte = NULL; | 4635 | pte_t *pte = NULL; |
4628 | 4636 | ||
4629 | pgd = pgd_offset(mm, addr); | 4637 | pgd = pgd_offset(mm, addr); |
4630 | p4d = p4d_offset(pgd, addr); | 4638 | p4d = p4d_alloc(mm, pgd, addr); |
4639 | if (!p4d) | ||
4640 | return NULL; | ||
4631 | pud = pud_alloc(mm, p4d, addr); | 4641 | pud = pud_alloc(mm, p4d, addr); |
4632 | if (pud) { | 4642 | if (pud) { |
4633 | if (sz == PUD_SIZE) { | 4643 | if (sz == PUD_SIZE) { |