diff options
Diffstat (limited to 'arch/x86/mm/pgtable.c')
-rw-r--r-- | arch/x86/mm/pgtable.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 45b99ac39480..418c4432fb39 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -215,13 +215,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
215 | 215 | ||
216 | /* so that alloc_pmd can use it */ | 216 | /* so that alloc_pmd can use it */ |
217 | mm->pgd = pgd; | 217 | mm->pgd = pgd; |
218 | if (pgd) | 218 | if (pgd) { |
219 | pgd_ctor(pgd); | 219 | pgd_ctor(pgd); |
220 | 220 | ||
221 | if (pgd && !pgd_prepopulate_pmd(mm, pgd)) { | 221 | if (paravirt_pgd_alloc(mm) != 0 || |
222 | pgd_dtor(pgd); | 222 | !pgd_prepopulate_pmd(mm, pgd)) { |
223 | free_page((unsigned long)pgd); | 223 | pgd_dtor(pgd); |
224 | pgd = NULL; | 224 | free_page((unsigned long)pgd); |
225 | pgd = NULL; | ||
226 | } | ||
225 | } | 227 | } |
226 | 228 | ||
227 | return pgd; | 229 | return pgd; |
@@ -231,6 +233,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
231 | { | 233 | { |
232 | pgd_mop_up_pmds(mm, pgd); | 234 | pgd_mop_up_pmds(mm, pgd); |
233 | pgd_dtor(pgd); | 235 | pgd_dtor(pgd); |
236 | paravirt_pgd_free(mm, pgd); | ||
234 | free_page((unsigned long)pgd); | 237 | free_page((unsigned long)pgd); |
235 | } | 238 | } |
236 | 239 | ||