diff options
Diffstat (limited to 'arch/x86/mm/pgtable_32.c')
-rw-r--r-- | arch/x86/mm/pgtable_32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index be61a1d845a4..f85ee44720d2 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -330,13 +330,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
330 | if (PTRS_PER_PMD == 1 || !pgd) | 330 | if (PTRS_PER_PMD == 1 || !pgd) |
331 | return pgd; | 331 | return pgd; |
332 | 332 | ||
333 | mm->pgd = pgd; /* so that alloc_pd can use it */ | ||
334 | |||
333 | for (i = 0; i < UNSHARED_PTRS_PER_PGD; ++i) { | 335 | for (i = 0; i < UNSHARED_PTRS_PER_PGD; ++i) { |
334 | pmd_t *pmd = pmd_cache_alloc(i); | 336 | pmd_t *pmd = pmd_cache_alloc(i); |
335 | 337 | ||
336 | if (!pmd) | 338 | if (!pmd) |
337 | goto out_oom; | 339 | goto out_oom; |
338 | 340 | ||
339 | paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT); | 341 | paravirt_alloc_pd(mm, __pa(pmd) >> PAGE_SHIFT); |
340 | set_pgd(&pgd[i], __pgd(1 + __pa(pmd))); | 342 | set_pgd(&pgd[i], __pgd(1 + __pa(pmd))); |
341 | } | 343 | } |
342 | return pgd; | 344 | return pgd; |