diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-07 12:17:21 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-07 12:17:21 -0500 |
| commit | 0477406961c185ef9a6d9c908b5c70ffe206833e (patch) | |
| tree | 1a7e6b0c381c92447dda908566a9e25d9c3d3ff7 | |
| parent | 54e7ff9d6249ba88e393d7fbc8008da9279723be (diff) | |
| parent | d05fdf316067cd311d5e7add08da26ded8a58080 (diff) | |
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
xen: make sure stray alias mappings are gone before pinning
vmap: cope with vm_unmap_aliases before vmalloc_init()
| -rw-r--r-- | arch/x86/xen/enlighten.c | 5 | ||||
| -rw-r--r-- | arch/x86/xen/mmu.c | 9 | ||||
| -rw-r--r-- | mm/vmalloc.c | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b61534c7a4c4..5e4686d70f62 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -863,15 +863,16 @@ static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned l | |||
| 863 | if (PagePinned(virt_to_page(mm->pgd))) { | 863 | if (PagePinned(virt_to_page(mm->pgd))) { |
| 864 | SetPagePinned(page); | 864 | SetPagePinned(page); |
| 865 | 865 | ||
| 866 | vm_unmap_aliases(); | ||
| 866 | if (!PageHighMem(page)) { | 867 | if (!PageHighMem(page)) { |
| 867 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); | 868 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); |
| 868 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) | 869 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) |
| 869 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); | 870 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); |
| 870 | } else | 871 | } else { |
| 871 | /* make sure there are no stray mappings of | 872 | /* make sure there are no stray mappings of |
| 872 | this page */ | 873 | this page */ |
| 873 | kmap_flush_unused(); | 874 | kmap_flush_unused(); |
| 874 | vm_unmap_aliases(); | 875 | } |
| 875 | } | 876 | } |
| 876 | } | 877 | } |
| 877 | 878 | ||
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, | |||
| 850 | read-only, and can be pinned. */ | 850 | read-only, and can be pinned. */ |
| 851 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | 851 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) |
| 852 | { | 852 | { |
| 853 | vm_unmap_aliases(); | ||
| 854 | |||
| 853 | xen_mc_batch(); | 855 | xen_mc_batch(); |
| 854 | 856 | ||
| 855 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { | 857 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { |
| 856 | /* re-enable interrupts for kmap_flush_unused */ | 858 | /* re-enable interrupts for flushing */ |
| 857 | xen_mc_issue(0); | 859 | xen_mc_issue(0); |
| 860 | |||
| 858 | kmap_flush_unused(); | 861 | kmap_flush_unused(); |
| 859 | vm_unmap_aliases(); | 862 | |
| 860 | xen_mc_batch(); | 863 | xen_mc_batch(); |
| 861 | } | 864 | } |
| 862 | 865 | ||
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 66fad3fc02b1..ba6b0f5f7fac 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
| @@ -592,6 +592,8 @@ static void free_unmap_vmap_area_addr(unsigned long addr) | |||
| 592 | 592 | ||
| 593 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) | 593 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) |
| 594 | 594 | ||
| 595 | static bool vmap_initialized __read_mostly = false; | ||
| 596 | |||
| 595 | struct vmap_block_queue { | 597 | struct vmap_block_queue { |
| 596 | spinlock_t lock; | 598 | spinlock_t lock; |
| 597 | struct list_head free; | 599 | struct list_head free; |
| @@ -828,6 +830,9 @@ void vm_unmap_aliases(void) | |||
| 828 | int cpu; | 830 | int cpu; |
| 829 | int flush = 0; | 831 | int flush = 0; |
| 830 | 832 | ||
| 833 | if (unlikely(!vmap_initialized)) | ||
| 834 | return; | ||
| 835 | |||
| 831 | for_each_possible_cpu(cpu) { | 836 | for_each_possible_cpu(cpu) { |
| 832 | struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); | 837 | struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); |
| 833 | struct vmap_block *vb; | 838 | struct vmap_block *vb; |
| @@ -942,6 +947,8 @@ void __init vmalloc_init(void) | |||
| 942 | INIT_LIST_HEAD(&vbq->dirty); | 947 | INIT_LIST_HEAD(&vbq->dirty); |
| 943 | vbq->nr_dirty = 0; | 948 | vbq->nr_dirty = 0; |
| 944 | } | 949 | } |
| 950 | |||
| 951 | vmap_initialized = true; | ||
| 945 | } | 952 | } |
| 946 | 953 | ||
| 947 | void unmap_kernel_range(unsigned long addr, unsigned long size) | 954 | void unmap_kernel_range(unsigned long addr, unsigned long size) |
