ia64/xen-unstable

changeset 8040:0ea18c1ea134

Another PAE fix for pgd_ctor.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Nov 24 19:40:18 2005 +0100 (2005-11-24)
parents 0ec1d38f26f7
children 877d738e7a40
files linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Nov 24 19:16:13 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Nov 24 19:40:18 2005 +0100
     1.3 @@ -285,19 +285,18 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
     1.4  	BUG_ON(rc);
     1.5  #endif
     1.6  
     1.7 -	if (!HAVE_SHARED_KERNEL_PMD)
     1.8 -		spin_lock_irqsave(&pgd_lock, flags);
     1.9 +	if (HAVE_SHARED_KERNEL_PMD) {
    1.10 +		memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
    1.11 +		       swapper_pg_dir + USER_PTRS_PER_PGD,
    1.12 +		       (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
    1.13 +		return;
    1.14 +	}
    1.15  
    1.16 -	memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
    1.17 -			swapper_pg_dir + USER_PTRS_PER_PGD,
    1.18 -			(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
    1.19 +	memset(pgd, 0, PTRS_PER_PGD*sizeof(pgd_t));
    1.20  
    1.21 -	if (HAVE_SHARED_KERNEL_PMD)
    1.22 -		return;
    1.23 -
    1.24 +	spin_lock_irqsave(&pgd_lock, flags);
    1.25  	pgd_list_add(pgd);
    1.26  	spin_unlock_irqrestore(&pgd_lock, flags);
    1.27 -	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
    1.28  }
    1.29  
    1.30  void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)