pgtable_32.c (d20ead9e86881bc7ae84e385f47b5196b7d93aac) pgtable_32.c (6c435456dc91ace468b4e9d72ad0e13dafa22a45)
1/*
2 * linux/arch/i386/mm/pgtable.c
3 */
4
5#include <linux/sched.h>
6#include <linux/kernel.h>
7#include <linux/errno.h>
8#include <linux/mm.h>

--- 316 unchanged lines hidden (view full) ---

325pgd_t *pgd_alloc(struct mm_struct *mm)
326{
327 int i;
328 pgd_t *pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
329
330 if (PTRS_PER_PMD == 1 || !pgd)
331 return pgd;
332
1/*
2 * linux/arch/i386/mm/pgtable.c
3 */
4
5#include <linux/sched.h>
6#include <linux/kernel.h>
7#include <linux/errno.h>
8#include <linux/mm.h>

--- 316 unchanged lines hidden (view full) ---

325pgd_t *pgd_alloc(struct mm_struct *mm)
326{
327 int i;
328 pgd_t *pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
329
330 if (PTRS_PER_PMD == 1 || !pgd)
331 return pgd;
332
333 mm->pgd = pgd; /* so that alloc_pd can use it */
334
333 for (i = 0; i < UNSHARED_PTRS_PER_PGD; ++i) {
334 pmd_t *pmd = pmd_cache_alloc(i);
335
336 if (!pmd)
337 goto out_oom;
338
335 for (i = 0; i < UNSHARED_PTRS_PER_PGD; ++i) {
336 pmd_t *pmd = pmd_cache_alloc(i);
337
338 if (!pmd)
339 goto out_oom;
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)));
341 }
342 return pgd;
343
344out_oom:
345 for (i--; i >= 0; i--) {
346 pgd_t pgdent = pgd[i];
347 void* pmd = (void *)__va(pgd_val(pgdent)-1);

--- 28 unchanged lines hidden ---
342 set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
343 }
344 return pgd;
345
346out_oom:
347 for (i--; i >= 0; i--) {
348 pgd_t pgdent = pgd[i];
349 void* pmd = (void *)__va(pgd_val(pgdent)-1);

--- 28 unchanged lines hidden ---