I386 pgd clone under lock fix.patch
PATCH 4/10 I386 pgd clone under lock fix.patch
Copying of the pgd range must happen under the pgd_lock. This got broken by the paravirt changes in the -mm tree. Badness can result if you copy the pgd before being added to the list when splitting or rejoining large pages.
Signed-off-by Zachary Amsden <[email protected]>
arch/i386/mm/pgtable.c +3 -5
@@ -241,18 +241,16 @@ void pgd_ctor(void *pgd, struct kmem_cac/* !PAE, no pagetable sharing */ memset (pgd,0 ,USER_PTRS_PER_PGD *sizeof (pgd_t)); +spin_lock_irqsave (&pgd_lock, flags); + +/* must happen under lock */ clone_pgd_range ((pgd_t *)pgd +USER_PTRS_PER_PGD , swapper_pg_dir +USER_PTRS_PER_PGD ,KERNEL_PGD_PTRS ); - -spin_lock_irqsave (&pgd_lock, flags); - -/* must happen under lock */ paravirt_alloc_pd_clone (__pa (pgd) >>PAGE_SHIFT ,__pa (swapper_pg_dir) >>PAGE_SHIFT ,USER_PTRS_PER_PGD ,KERNEL_PGD_PTRS ); -pgd_list_add (pgd);spin_unlock_irqrestore (&pgd_lock, flags); }
Quoted 4 lines · Zachary Amsden
Copying of the pgd range must happen under the
pgd_lock. This got broken by the paravirt changes in the -mm tree. Badness can result if you copy the pgd before being added to the list when splitting or rejoining large pages.Signed-off-by Zachary Amsden <[email protected]>
Sorry my review missed this.
Acked-by William Irwin <[email protected]>
-- wli