]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commit
xen/x86: synchronize vmalloc_sync_all() with mm_{,un}pin()
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 22 Sep 2010 07:57:21 +0000 (08:57 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 22 Sep 2010 07:57:21 +0000 (08:57 +0100)
commita842f3f13d1ff4e7a34fdc9b227df88af8dea05c
tree3f40e0e43a22655c413d2158d61eeeba4a142de3
parentcdaeea25fe7688fd51ab7513415e10f27eda1db4
xen/x86: synchronize vmalloc_sync_all() with mm_{,un}pin()

As recently diagnosed by Citrix engineers, mm_{,un}pin() and
vmalloc_sync_all() aren't properly synchronized. So we add a backlink
to the referencing struct mm_struct to the pgd's struct page, and use
this to lock the page table updates in vmalloc_sync_all().

Due to the way pgd-s get allocated and put on the global list on i386,
we have to account for the backlink not to be set yet (in which case
they cannot be subject to (un)pinning.

Along the way, I found it necessary/desirable to also fix
- a potential NULL dereference in i386's pgd_alloc(),
- x86-64 adding not yet cleaned out pgd-s to the global list, and
- x86-64 removing pgd-s from the global list rather late.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/mm/fault-xen.c
arch/i386/mm/pgtable-xen.c
arch/x86_64/mm/fault-xen.c
include/asm-x86_64/mach-xen/asm/pgalloc.h