[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] PAE pgd construction code should use clone_pgd_range().



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f79656988ecf191e75fd3cc63889c2893f0bdcec
# Parent  463fc8a9e7376a956c433de079a65893e9486e68
PAE pgd construction code should use clone_pgd_range().
Also fix the loop that allocates users pmds.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 463fc8a9e737 -r f79656988ecf 
linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c   Fri Apr 21 09:14:47 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c   Fri Apr 21 09:38:20 
2006 +0100
@@ -306,14 +306,14 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
                        BUG_ON(rc);
                }
                if (HAVE_SHARED_KERNEL_PMD)
-                       memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
-                              swapper_pg_dir + USER_PTRS_PER_PGD,
-                              (PTRS_PER_PGD - USER_PTRS_PER_PGD) * 
sizeof(pgd_t));
+                       clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
+                                       swapper_pg_dir + USER_PTRS_PER_PGD,
+                                       KERNEL_PGD_PTRS);
        } else {
                spin_lock_irqsave(&pgd_lock, flags);
-               memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
-                      swapper_pg_dir + USER_PTRS_PER_PGD,
-                      (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+               clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
+                               swapper_pg_dir + USER_PTRS_PER_PGD,
+                               KERNEL_PGD_PTRS);
                memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
                pgd_list_add(pgd);
                spin_unlock_irqrestore(&pgd_lock, flags);
@@ -360,7 +360,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
                        pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
                        if (!pmd)
                                goto out_oom;
-                       set_pgd(&pgd[USER_PTRS_PER_PGD], __pgd(1 + __pa(pmd)));
+                       set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
                }
 
                spin_lock_irqsave(&pgd_lock, flags);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.