diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 17:00:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 17:00:58 -0500 |
commit | c40f6f8bbc4cbd2902671aacd587400ddca62627 (patch) | |
tree | a991e5521e10943f4457fb7f494e00aec75cc7df /arch | |
parent | 1a7d0f0bec4be078ce2cfb11538c0f4ffbbed8e5 (diff) | |
parent | cb6ff208076b5f434db1b8c983429269d719cef5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-nommu
* git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-nommu:
NOMMU: Support XIP on initramfs
NOMMU: Teach kobjsize() about VMA regions.
FLAT: Don't attempt to expand the userspace stack to fill the space allocated
FDPIC: Don't attempt to expand the userspace stack to fill the space allocated
NOMMU: Improve procfs output using per-MM VMAs
NOMMU: Make mmap allocation page trimming behaviour configurable.
NOMMU: Make VMAs per MM as for MMU-mode linux
NOMMU: Delete askedalloc and realalloc variables
NOMMU: Rename ARM's struct vm_region
NOMMU: Fix cleanup handling in ramfs_nommu_get_umapped_area()
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/mmu.h | 1 | ||||
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 28 | ||||
-rw-r--r-- | arch/blackfin/include/asm/mmu.h | 1 | ||||
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 6 | ||||
-rw-r--r-- | arch/blackfin/kernel/traps.c | 11 | ||||
-rw-r--r-- | arch/frv/kernel/ptrace.c | 11 | ||||
-rw-r--r-- | arch/h8300/include/asm/mmu.h | 1 | ||||
-rw-r--r-- | arch/m68knommu/include/asm/mmu.h | 1 | ||||
-rw-r--r-- | arch/sh/include/asm/mmu.h | 1 |
9 files changed, 29 insertions, 32 deletions
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 53099d4ee421..b561584d04a1 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
@@ -24,7 +24,6 @@ typedef struct { | |||
24 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> | 24 | * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> |
25 | */ | 25 | */ |
26 | typedef struct { | 26 | typedef struct { |
27 | struct vm_list_struct *vmlist; | ||
28 | unsigned long end_brk; | 27 | unsigned long end_brk; |
29 | } mm_context_t; | 28 | } mm_context_t; |
30 | 29 | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 67960017dc8f..310e479309ef 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -71,7 +71,7 @@ static DEFINE_SPINLOCK(consistent_lock); | |||
71 | * the amount of RAM found at boot time.) I would imagine that get_vm_area() | 71 | * the amount of RAM found at boot time.) I would imagine that get_vm_area() |
72 | * would have to initialise this each time prior to calling vm_region_alloc(). | 72 | * would have to initialise this each time prior to calling vm_region_alloc(). |
73 | */ | 73 | */ |
74 | struct vm_region { | 74 | struct arm_vm_region { |
75 | struct list_head vm_list; | 75 | struct list_head vm_list; |
76 | unsigned long vm_start; | 76 | unsigned long vm_start; |
77 | unsigned long vm_end; | 77 | unsigned long vm_end; |
@@ -79,20 +79,20 @@ struct vm_region { | |||
79 | int vm_active; | 79 | int vm_active; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static struct vm_region consistent_head = { | 82 | static struct arm_vm_region consistent_head = { |
83 | .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), | 83 | .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), |
84 | .vm_start = CONSISTENT_BASE, | 84 | .vm_start = CONSISTENT_BASE, |
85 | .vm_end = CONSISTENT_END, | 85 | .vm_end = CONSISTENT_END, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static struct vm_region * | 88 | static struct arm_vm_region * |
89 | vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) | 89 | arm_vm_region_alloc(struct arm_vm_region *head, size_t size, gfp_t gfp) |
90 | { | 90 | { |
91 | unsigned long addr = head->vm_start, end = head->vm_end - size; | 91 | unsigned long addr = head->vm_start, end = head->vm_end - size; |
92 | unsigned long flags; | 92 | unsigned long flags; |
93 | struct vm_region *c, *new; | 93 | struct arm_vm_region *c, *new; |
94 | 94 | ||
95 | new = kmalloc(sizeof(struct vm_region), gfp); | 95 | new = kmalloc(sizeof(struct arm_vm_region), gfp); |
96 | if (!new) | 96 | if (!new) |
97 | goto out; | 97 | goto out; |
98 | 98 | ||
@@ -127,9 +127,9 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) | |||
127 | return NULL; | 127 | return NULL; |
128 | } | 128 | } |
129 | 129 | ||
130 | static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr) | 130 | static struct arm_vm_region *arm_vm_region_find(struct arm_vm_region *head, unsigned long addr) |
131 | { | 131 | { |
132 | struct vm_region *c; | 132 | struct arm_vm_region *c; |
133 | 133 | ||
134 | list_for_each_entry(c, &head->vm_list, vm_list) { | 134 | list_for_each_entry(c, &head->vm_list, vm_list) { |
135 | if (c->vm_active && c->vm_start == addr) | 135 | if (c->vm_active && c->vm_start == addr) |
@@ -149,7 +149,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
149 | pgprot_t prot) | 149 | pgprot_t prot) |
150 | { | 150 | { |
151 | struct page *page; | 151 | struct page *page; |
152 | struct vm_region *c; | 152 | struct arm_vm_region *c; |
153 | unsigned long order; | 153 | unsigned long order; |
154 | u64 mask = ISA_DMA_THRESHOLD, limit; | 154 | u64 mask = ISA_DMA_THRESHOLD, limit; |
155 | 155 | ||
@@ -214,7 +214,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
214 | /* | 214 | /* |
215 | * Allocate a virtual address in the consistent mapping region. | 215 | * Allocate a virtual address in the consistent mapping region. |
216 | */ | 216 | */ |
217 | c = vm_region_alloc(&consistent_head, size, | 217 | c = arm_vm_region_alloc(&consistent_head, size, |
218 | gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); | 218 | gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); |
219 | if (c) { | 219 | if (c) { |
220 | pte_t *pte; | 220 | pte_t *pte; |
@@ -311,13 +311,13 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma, | |||
311 | void *cpu_addr, dma_addr_t dma_addr, size_t size) | 311 | void *cpu_addr, dma_addr_t dma_addr, size_t size) |
312 | { | 312 | { |
313 | unsigned long flags, user_size, kern_size; | 313 | unsigned long flags, user_size, kern_size; |
314 | struct vm_region *c; | 314 | struct arm_vm_region *c; |
315 | int ret = -ENXIO; | 315 | int ret = -ENXIO; |
316 | 316 | ||
317 | user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 317 | user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
318 | 318 | ||
319 | spin_lock_irqsave(&consistent_lock, flags); | 319 | spin_lock_irqsave(&consistent_lock, flags); |
320 | c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); | 320 | c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr); |
321 | spin_unlock_irqrestore(&consistent_lock, flags); | 321 | spin_unlock_irqrestore(&consistent_lock, flags); |
322 | 322 | ||
323 | if (c) { | 323 | if (c) { |
@@ -359,7 +359,7 @@ EXPORT_SYMBOL(dma_mmap_writecombine); | |||
359 | */ | 359 | */ |
360 | void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) | 360 | void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) |
361 | { | 361 | { |
362 | struct vm_region *c; | 362 | struct arm_vm_region *c; |
363 | unsigned long flags, addr; | 363 | unsigned long flags, addr; |
364 | pte_t *ptep; | 364 | pte_t *ptep; |
365 | int idx; | 365 | int idx; |
@@ -378,7 +378,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr | |||
378 | size = PAGE_ALIGN(size); | 378 | size = PAGE_ALIGN(size); |
379 | 379 | ||
380 | spin_lock_irqsave(&consistent_lock, flags); | 380 | spin_lock_irqsave(&consistent_lock, flags); |
381 | c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); | 381 | c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr); |
382 | if (!c) | 382 | if (!c) |
383 | goto no_area; | 383 | goto no_area; |
384 | 384 | ||
diff --git a/arch/blackfin/include/asm/mmu.h b/arch/blackfin/include/asm/mmu.h index 757e43906ed4..dbfd686360e6 100644 --- a/arch/blackfin/include/asm/mmu.h +++ b/arch/blackfin/include/asm/mmu.h | |||
@@ -10,7 +10,6 @@ struct sram_list_struct { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | typedef struct { | 12 | typedef struct { |
13 | struct vm_list_struct *vmlist; | ||
14 | unsigned long end_brk; | 13 | unsigned long end_brk; |
15 | unsigned long stack_start; | 14 | unsigned long stack_start; |
16 | 15 | ||
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index d2d388536630..594e325b40e4 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -160,15 +160,15 @@ put_reg(struct task_struct *task, int regno, unsigned long data) | |||
160 | static inline int is_user_addr_valid(struct task_struct *child, | 160 | static inline int is_user_addr_valid(struct task_struct *child, |
161 | unsigned long start, unsigned long len) | 161 | unsigned long start, unsigned long len) |
162 | { | 162 | { |
163 | struct vm_list_struct *vml; | 163 | struct vm_area_struct *vma; |
164 | struct sram_list_struct *sraml; | 164 | struct sram_list_struct *sraml; |
165 | 165 | ||
166 | /* overflow */ | 166 | /* overflow */ |
167 | if (start + len < start) | 167 | if (start + len < start) |
168 | return -EIO; | 168 | return -EIO; |
169 | 169 | ||
170 | for (vml = child->mm->context.vmlist; vml; vml = vml->next) | 170 | vma = find_vma(child->mm, start); |
171 | if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end) | 171 | if (vma && start >= vma->vm_start && start + len <= vma->vm_end) |
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | for (sraml = child->mm->context.sram_list; sraml; sraml = sraml->next) | 174 | for (sraml = child->mm->context.sram_list; sraml; sraml = sraml->next) |
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 17d8e4172896..5b0667da8d05 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/kallsyms.h> | 33 | #include <linux/kallsyms.h> |
34 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
35 | #include <linux/rbtree.h> | ||
35 | #include <asm/traps.h> | 36 | #include <asm/traps.h> |
36 | #include <asm/cacheflush.h> | 37 | #include <asm/cacheflush.h> |
37 | #include <asm/cplb.h> | 38 | #include <asm/cplb.h> |
@@ -83,6 +84,7 @@ static void decode_address(char *buf, unsigned long address) | |||
83 | struct mm_struct *mm; | 84 | struct mm_struct *mm; |
84 | unsigned long flags, offset; | 85 | unsigned long flags, offset; |
85 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); | 86 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); |
87 | struct rb_node *n; | ||
86 | 88 | ||
87 | #ifdef CONFIG_KALLSYMS | 89 | #ifdef CONFIG_KALLSYMS |
88 | unsigned long symsize; | 90 | unsigned long symsize; |
@@ -128,9 +130,10 @@ static void decode_address(char *buf, unsigned long address) | |||
128 | if (!mm) | 130 | if (!mm) |
129 | continue; | 131 | continue; |
130 | 132 | ||
131 | vml = mm->context.vmlist; | 133 | for (n = rb_first(&mm->mm_rb); n; n = rb_next(n)) { |
132 | while (vml) { | 134 | struct vm_area_struct *vma; |
133 | struct vm_area_struct *vma = vml->vma; | 135 | |
136 | vma = rb_entry(n, struct vm_area_struct, vm_rb); | ||
134 | 137 | ||
135 | if (address >= vma->vm_start && address < vma->vm_end) { | 138 | if (address >= vma->vm_start && address < vma->vm_end) { |
136 | char _tmpbuf[256]; | 139 | char _tmpbuf[256]; |
@@ -176,8 +179,6 @@ static void decode_address(char *buf, unsigned long address) | |||
176 | 179 | ||
177 | goto done; | 180 | goto done; |
178 | } | 181 | } |
179 | |||
180 | vml = vml->next; | ||
181 | } | 182 | } |
182 | if (!in_atomic) | 183 | if (!in_atomic) |
183 | mmput(mm); | 184 | mmput(mm); |
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c index 709e9bdc6126..5e7d401d21e7 100644 --- a/arch/frv/kernel/ptrace.c +++ b/arch/frv/kernel/ptrace.c | |||
@@ -69,7 +69,8 @@ static inline int put_reg(struct task_struct *task, int regno, | |||
69 | } | 69 | } |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * check that an address falls within the bounds of the target process's memory mappings | 72 | * check that an address falls within the bounds of the target process's memory |
73 | * mappings | ||
73 | */ | 74 | */ |
74 | static inline int is_user_addr_valid(struct task_struct *child, | 75 | static inline int is_user_addr_valid(struct task_struct *child, |
75 | unsigned long start, unsigned long len) | 76 | unsigned long start, unsigned long len) |
@@ -79,11 +80,11 @@ static inline int is_user_addr_valid(struct task_struct *child, | |||
79 | return -EIO; | 80 | return -EIO; |
80 | return 0; | 81 | return 0; |
81 | #else | 82 | #else |
82 | struct vm_list_struct *vml; | 83 | struct vm_area_struct *vma; |
83 | 84 | ||
84 | for (vml = child->mm->context.vmlist; vml; vml = vml->next) | 85 | vma = find_vma(child->mm, start); |
85 | if (start >= vml->vma->vm_start && start + len <= vml->vma->vm_end) | 86 | if (vma && start >= vma->vm_start && start + len <= vma->vm_end) |
86 | return 0; | 87 | return 0; |
87 | 88 | ||
88 | return -EIO; | 89 | return -EIO; |
89 | #endif | 90 | #endif |
diff --git a/arch/h8300/include/asm/mmu.h b/arch/h8300/include/asm/mmu.h index 2ce06ea46104..31309969df70 100644 --- a/arch/h8300/include/asm/mmu.h +++ b/arch/h8300/include/asm/mmu.h | |||
@@ -4,7 +4,6 @@ | |||
4 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ | 4 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ |
5 | 5 | ||
6 | typedef struct { | 6 | typedef struct { |
7 | struct vm_list_struct *vmlist; | ||
8 | unsigned long end_brk; | 7 | unsigned long end_brk; |
9 | } mm_context_t; | 8 | } mm_context_t; |
10 | 9 | ||
diff --git a/arch/m68knommu/include/asm/mmu.h b/arch/m68knommu/include/asm/mmu.h index 5fa6b68353ba..e2da1e6f09fe 100644 --- a/arch/m68knommu/include/asm/mmu.h +++ b/arch/m68knommu/include/asm/mmu.h | |||
@@ -4,7 +4,6 @@ | |||
4 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ | 4 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ |
5 | 5 | ||
6 | typedef struct { | 6 | typedef struct { |
7 | struct vm_list_struct *vmlist; | ||
8 | unsigned long end_brk; | 7 | unsigned long end_brk; |
9 | } mm_context_t; | 8 | } mm_context_t; |
10 | 9 | ||
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h index fdcb93bc6d11..6c43625bb1a5 100644 --- a/arch/sh/include/asm/mmu.h +++ b/arch/sh/include/asm/mmu.h | |||
@@ -9,7 +9,6 @@ typedef struct { | |||
9 | mm_context_id_t id; | 9 | mm_context_id_t id; |
10 | void *vdso; | 10 | void *vdso; |
11 | #else | 11 | #else |
12 | struct vm_list_struct *vmlist; | ||
13 | unsigned long end_brk; | 12 | unsigned long end_brk; |
14 | #endif | 13 | #endif |
15 | #ifdef CONFIG_BINFMT_ELF_FDPIC | 14 | #ifdef CONFIG_BINFMT_ELF_FDPIC |