The patch titled xen-paravirt_ops: allocate and free vmalloc areas has been removed from the -mm tree. Its filename was xen-paravirt_ops-allocate-and-free-vmalloc-areas.patch This patch was dropped because Zach's patches destroyed it all ------------------------------------------------------ Subject: xen-paravirt_ops: allocate and free vmalloc areas From: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Allocate/destroy a 'vmalloc' VM area: alloc_vm_area and free_vm_area The alloc function ensures that page tables are constructed for the region of kernel virtual address space and mapped into init_mm. Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> Signed-off-by: Ian Pratt <ian.pratt@xxxxxxxxxxxxx> Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx> Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx> Cc: "Jan Beulich" <JBeulich@xxxxxxxxxx> Cc: "Andi Kleen" <ak@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/i386/mm/fault.c | 43 ++++++++++++++++++++++++++++++++++++++ include/linux/vmalloc.h | 4 +++ 2 files changed, 47 insertions(+) diff -puN arch/i386/mm/fault.c~xen-paravirt_ops-allocate-and-free-vmalloc-areas arch/i386/mm/fault.c --- a/arch/i386/mm/fault.c~xen-paravirt_ops-allocate-and-free-vmalloc-areas +++ a/arch/i386/mm/fault.c @@ -24,6 +24,7 @@ #include <linux/module.h> #include <linux/kprobes.h> #include <linux/uaccess.h> +#include <linux/vmalloc.h> #include <asm/system.h> #include <asm/desc.h> @@ -639,3 +640,45 @@ void _vmalloc_sync_all(void) start = address + PGDIR_SIZE; } } + + +static int f(pte_t *pte, struct page *pmd_page, unsigned long addr, void *data) +{ + /* apply_to_page_range() does all the hard work. */ + return 0; +} + +struct vm_struct *alloc_vm_area(unsigned long size) +{ + struct vm_struct *area; + + area = get_vm_area(size, VM_IOREMAP); + if (area == NULL) + return NULL; + + /* + * This ensures that page tables are constructed for this region + * of kernel virtual address space and mapped into init_mm. + */ + if (apply_to_page_range(&init_mm, (unsigned long)area->addr, + area->size, f, NULL)) { + free_vm_area(area); + return NULL; + } + + /* Make sure the pagetables are constructed in process kernel + mappings */ + vmalloc_sync_all(); + + return area; +} +EXPORT_SYMBOL_GPL(alloc_vm_area); + +void free_vm_area(struct vm_struct *area) +{ + struct vm_struct *ret; + ret = remove_vm_area(area->addr); + BUG_ON(ret != area); + kfree(area); +} +EXPORT_SYMBOL_GPL(free_vm_area); diff -puN include/linux/vmalloc.h~xen-paravirt_ops-allocate-and-free-vmalloc-areas include/linux/vmalloc.h --- a/include/linux/vmalloc.h~xen-paravirt_ops-allocate-and-free-vmalloc-areas +++ a/include/linux/vmalloc.h @@ -68,6 +68,10 @@ extern int map_vm_area(struct vm_struct struct page ***pages); extern void unmap_vm_area(struct vm_struct *area); +/* Allocate/destroy a 'vmalloc' VM area. */ +extern struct vm_struct *alloc_vm_area(unsigned long size); +extern void free_vm_area(struct vm_struct *area); + /* * Internals. Dont't use.. */ _ Patches currently in -mm which might be from jeremy@xxxxxxxx are xen-paravirt_ops-allocate-and-free-vmalloc-areas.patch xen-paravirt_ops-add-nosegneg-capability-to-the-vsyscall-page-notes.patch xen-paravirt_ops-add-xen-config-options.patch xen-paravirt_ops-add-xen-interface-header-files.patch xen-paravirt_ops-core-xen-implementation.patch xen-paravirt_ops-use-the-hvc-console-infrastructure-for-xen-console.patch xen-paravirt_ops-add-early-printk-support-via-hvc-console.patch xen-paravirt_ops-add-xen-grant-table-support.patch xen-paravirt_ops-add-the-xenbus-sysfs-and-virtual-device-hotplug-driver.patch xen-paravirt_ops-add-xen-virtual-block-device-driver.patch xen-paravirt_ops-add-the-xen-virtual-network-device-driver.patch fixes-and-cleanups-for-earlyprintk-aka-boot-console.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html