ia64/xen-unstable

changeset 9802:72adf2025a93

PAE pgd construction code should use clone_pgd_range().
Also fix the loop that allocates users pmds.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 21 09:37:22 2006 +0100 (2006-04-21)
parents 376d51321a3a
children 9c313ff7a0ed
files linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Fri Apr 21 09:14:07 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c	Fri Apr 21 09:37:22 2006 +0100
     1.3 @@ -306,14 +306,14 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
     1.4  			BUG_ON(rc);
     1.5  		}
     1.6  		if (HAVE_SHARED_KERNEL_PMD)
     1.7 -			memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
     1.8 -			       swapper_pg_dir + USER_PTRS_PER_PGD,
     1.9 -			       (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
    1.10 +			clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
    1.11 +					swapper_pg_dir + USER_PTRS_PER_PGD,
    1.12 +					KERNEL_PGD_PTRS);
    1.13  	} else {
    1.14  		spin_lock_irqsave(&pgd_lock, flags);
    1.15 -		memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
    1.16 -		       swapper_pg_dir + USER_PTRS_PER_PGD,
    1.17 -		       (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
    1.18 +		clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
    1.19 +				swapper_pg_dir + USER_PTRS_PER_PGD,
    1.20 +				KERNEL_PGD_PTRS);
    1.21  		memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
    1.22  		pgd_list_add(pgd);
    1.23  		spin_unlock_irqrestore(&pgd_lock, flags);
    1.24 @@ -360,7 +360,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
    1.25  			pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
    1.26  			if (!pmd)
    1.27  				goto out_oom;
    1.28 -			set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
    1.29 +			set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
    1.30  		}
    1.31  
    1.32  		spin_lock_irqsave(&pgd_lock, flags);