diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-10-28 19:23:06 +1100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-07 10:05:59 +0100 |
commit | d05fdf316067cd311d5e7add08da26ded8a58080 (patch) | |
tree | abf6541cdd9e19f17eab6c73c4ffb09a23f0826e /arch/x86/xen/mmu.c | |
parent | 9b46333406b9cb3397ab538485a4d57c316af0ff (diff) | |
download | linux-d05fdf316067cd311d5e7add08da26ded8a58080.tar.gz linux-d05fdf316067cd311d5e7add08da26ded8a58080.tar.bz2 linux-d05fdf316067cd311d5e7add08da26ded8a58080.zip |
xen: make sure stray alias mappings are gone before pinning
Xen requires that all mappings of pagetable pages are read-only, so
that they can't be updated illegally. As a result, if a page is being
turned into a pagetable page, we need to make sure all its mappings
are RO.
If the page had been used for ioremap or vmalloc, it may still have
left over mappings as a result of not having been lazily unmapped.
This change makes sure we explicitly mop them all up before pinning
the page.
Unlike aliases created by kmap, the there can be vmalloc aliases even
for non-high pages, so we must do the flush unconditionally.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r-- | arch/x86/xen/mmu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index aba77b2b7d18..89f3b6edc65a 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -850,13 +850,16 @@ static int xen_pin_page(struct mm_struct *mm, struct page *page, read-only, and can be pinned. */ static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) { + vm_unmap_aliases(); + xen_mc_batch(); - if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { - /* re-enable interrupts for kmap_flush_unused */ + if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { + /* re-enable interrupts for flushing */ xen_mc_issue(0); + kmap_flush_unused(); - vm_unmap_aliases(); + xen_mc_batch(); } |