The patch titled vm/agp: remove private page protection map has been added to the -mm tree. Its filename is vm-agp-remove-private-page-protection-map-2.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: vm/agp: remove private page protection map From: Hugh Dickins <hugh@xxxxxxxxxxx> AGP keeps its own copy of the protection_map, upcoming DRM changes will also require access to this map from modules. Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx> Cc: Dave Airlie <airlied@xxxxxxxx> Cc: Dave Jones <davej@xxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/char/agp/frontend.c | 21 ++------------------- include/linux/mm.h | 2 +- mm/mmap.c | 7 +++++++ 3 files changed, 10 insertions(+), 20 deletions(-) diff -puN drivers/char/agp/frontend.c~vm-agp-remove-private-page-protection-map-2 drivers/char/agp/frontend.c --- a/drivers/char/agp/frontend.c~vm-agp-remove-private-page-protection-map-2 +++ a/drivers/char/agp/frontend.c @@ -151,29 +151,12 @@ static void agp_add_seg_to_client(struct client->segments = seg; } -/* Originally taken from linux/mm/mmap.c from the array - * protection_map. - * The original really should be exported to modules, or - * some routine which does the conversion for you - */ - static pgprot_t agp_convert_mmap_flags(int prot) { -#define _trans(x,bit1,bit2) \ -((bit1==bit2)?(x&bit1):(x&bit1)?bit2:0) - unsigned long prot_bits; - pgprot_t temp; - - prot_bits = _trans(prot, PROT_READ, VM_READ) | - _trans(prot, PROT_WRITE, VM_WRITE) | - _trans(prot, PROT_EXEC, VM_EXEC); - prot_bits |= VM_SHARED; - - temp = vm_get_page_prot(prot_bits & 0x0000000f); - - return temp; + prot_bits = calc_vm_prot_bits(prot) | VM_SHARED; + return vm_get_page_prot(prot_bits); } static int agp_create_segment(struct agp_client *client, struct agp_region *region) diff -puN include/linux/mm.h~vm-agp-remove-private-page-protection-map-2 include/linux/mm.h --- a/include/linux/mm.h~vm-agp-remove-private-page-protection-map-2 +++ a/include/linux/mm.h @@ -1053,7 +1053,7 @@ static inline unsigned long vma_pages(st return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; } -pgprot_t vm_get_page_prot(u8 vm_flags); +pgprot_t vm_get_page_prot(unsigned long vm_flags); struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); struct page *vmalloc_to_page(void *addr); unsigned long vmalloc_to_pfn(void *addr); diff -puN mm/mmap.c~vm-agp-remove-private-page-protection-map-2 mm/mmap.c --- a/mm/mmap.c~vm-agp-remove-private-page-protection-map-2 +++ a/mm/mmap.c @@ -66,6 +66,13 @@ pgprot_t vm_get_page_prot(u8 vm_flags) } EXPORT_SYMBOL(vm_get_page_prot); +pgprot_t vm_get_page_prot(unsigned long vm_flags) +{ + return protection_map[vm_flags & + (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]; +} +EXPORT_SYMBOL(vm_get_page_prot); + int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; _ Patches currently in -mm which might be from hugh@xxxxxxxxxxx are mm-vm_bug_on.patch mm-tracking-shared-dirty-pages.patch mm-balance-dirty-pages.patch mm-optimize-the-new-mprotect-code-a-bit.patch mm-small-cleanup-of-install_page.patch mm-fixup-do_wp_page.patch mm-msync-cleanup.patch mm-tracking-shared-dirty-pages-wimp.patch vm-agp-remove-private-page-protection-map-2.patch make-prot_write-imply-prot_read.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