aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-29 14:43:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-29 14:43:30 -0400
commiteefbab599531240adaffa1d23900afbc8b0342bd (patch)
tree2beb38a94aca40c7e5a0396503968d041e584bf9
parent90f1e7481eebfd47e7dbf7c8c0cbfe31e025e031 (diff)
parent3062aa50a6b2c3103470178fe7506c450d79ebe5 (diff)
Merge branch 'frv' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-frv
* 'frv' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-frv: FRV: Use generic show_interrupts() FRV: Convert genirq namespace frv: Select GENERIC_HARDIRQS_NO_DEPRECATED frv: Convert cpu irq_chip to new functions frv: Convert mb93493 irq_chip to new functions frv: Convert mb93093 irq_chip to new function frv: Convert mb93091 irq_chip to new functions frv: Fix typo from __do_IRQ overhaul frv: Remove stale irq_chip.end FRV: Do some cleanups FRV: Missing node arg in alloc_thread_info_node() macro NOMMU: implement access_remote_vm NOMMU: support SMP dynamic percpu_alloc NOMMU: percpu should use is_vmalloc_addr().
-rw-r--r--arch/frv/Kconfig1
-rw-r--r--arch/frv/include/asm/system.h9
-rw-r--r--arch/frv/include/asm/thread_info.h4
-rw-r--r--arch/frv/kernel/irq-mb93091.c2
-rw-r--r--include/linux/vmalloc.h32
-rw-r--r--mm/nommu.c52
-rw-r--r--mm/percpu.c3
7 files changed, 76 insertions, 27 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index e06e3c3434a4..6db8aea5667f 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -363,7 +363,6 @@ menu "Power management options"
363 363
364config ARCH_SUSPEND_POSSIBLE 364config ARCH_SUSPEND_POSSIBLE
365 def_bool y 365 def_bool y
366 depends on !SMP
367 366
368source kernel/power/Kconfig 367source kernel/power/Kconfig
369endmenu 368endmenu
diff --git a/arch/frv/include/asm/system.h b/arch/frv/include/asm/system.h
index 0a6d8d9ca45b..6c10fd2c626d 100644
--- a/arch/frv/include/asm/system.h
+++ b/arch/frv/include/asm/system.h
@@ -45,21 +45,12 @@ do { \
45#define wmb() asm volatile ("membar" : : :"memory") 45#define wmb() asm volatile ("membar" : : :"memory")
46#define read_barrier_depends() do { } while (0) 46#define read_barrier_depends() do { } while (0)
47 47
48#ifdef CONFIG_SMP
49#define smp_mb() mb()
50#define smp_rmb() rmb()
51#define smp_wmb() wmb()
52#define smp_read_barrier_depends() read_barrier_depends()
53#define set_mb(var, value) \
54 do { xchg(&var, (value)); } while (0)
55#else
56#define smp_mb() barrier() 48#define smp_mb() barrier()
57#define smp_rmb() barrier() 49#define smp_rmb() barrier()
58#define smp_wmb() barrier() 50#define smp_wmb() barrier()
59#define smp_read_barrier_depends() do {} while(0) 51#define smp_read_barrier_depends() do {} while(0)
60#define set_mb(var, value) \ 52#define set_mb(var, value) \
61 do { var = (value); barrier(); } while (0) 53 do { var = (value); barrier(); } while (0)
62#endif
63 54
64extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); 55extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2)));
65extern void free_initmem(void); 56extern void free_initmem(void);
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index 8582e9c7531c..cefbe73dc119 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -21,6 +21,8 @@
21 21
22#define THREAD_SIZE 8192 22#define THREAD_SIZE 8192
23 23
24#define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
25
24/* 26/*
25 * low level task data that entry.S needs immediate access to 27 * low level task data that entry.S needs immediate access to
26 * - this struct should fit entirely inside of one cache line 28 * - this struct should fit entirely inside of one cache line
@@ -87,7 +89,7 @@ register struct thread_info *__current_thread_info asm("gr15");
87#define alloc_thread_info_node(tsk, node) \ 89#define alloc_thread_info_node(tsk, node) \
88 kzalloc_node(THREAD_SIZE, GFP_KERNEL, node) 90 kzalloc_node(THREAD_SIZE, GFP_KERNEL, node)
89#else 91#else
90#define alloc_thread_info_node(tsk) \ 92#define alloc_thread_info_node(tsk, node) \
91 kmalloc_node(THREAD_SIZE, GFP_KERNEL, node) 93 kmalloc_node(THREAD_SIZE, GFP_KERNEL, node)
92#endif 94#endif
93 95
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c
index 372fe60b1c2e..9afc2ea400dc 100644
--- a/arch/frv/kernel/irq-mb93091.c
+++ b/arch/frv/kernel/irq-mb93091.c
@@ -47,7 +47,7 @@ static void frv_fpga_mask(struct irq_data *d)
47 47
48static void frv_fpga_ack(struct irq_data *d) 48static void frv_fpga_ack(struct irq_data *d)
49{ 49{
50 __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); 50 __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA));
51} 51}
52 52
53static void frv_fpga_mask_ack(struct irq_data *d) 53static void frv_fpga_mask_ack(struct irq_data *d)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 4ed6fcd6b726..9332e52ea8c2 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -95,10 +95,27 @@ extern struct vm_struct *remove_vm_area(const void *addr);
95 95
96extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 96extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
97 struct page ***pages); 97 struct page ***pages);
98#ifdef CONFIG_MMU
98extern int map_kernel_range_noflush(unsigned long start, unsigned long size, 99extern int map_kernel_range_noflush(unsigned long start, unsigned long size,
99 pgprot_t prot, struct page **pages); 100 pgprot_t prot, struct page **pages);
100extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size); 101extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size);
101extern void unmap_kernel_range(unsigned long addr, unsigned long size); 102extern void unmap_kernel_range(unsigned long addr, unsigned long size);
103#else
104static inline int
105map_kernel_range_noflush(unsigned long start, unsigned long size,
106 pgprot_t prot, struct page **pages)
107{
108 return size >> PAGE_SHIFT;
109}
110static inline void
111unmap_kernel_range_noflush(unsigned long addr, unsigned long size)
112{
113}
114static inline void
115unmap_kernel_range(unsigned long addr, unsigned long size)
116{
117}
118#endif
102 119
103/* Allocate/destroy a 'vmalloc' VM area. */ 120/* Allocate/destroy a 'vmalloc' VM area. */
104extern struct vm_struct *alloc_vm_area(size_t size); 121extern struct vm_struct *alloc_vm_area(size_t size);
@@ -116,11 +133,26 @@ extern struct vm_struct *vmlist;
116extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); 133extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
117 134
118#ifdef CONFIG_SMP 135#ifdef CONFIG_SMP
136# ifdef CONFIG_MMU
119struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, 137struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
120 const size_t *sizes, int nr_vms, 138 const size_t *sizes, int nr_vms,
121 size_t align); 139 size_t align);
122 140
123void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); 141void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
142# else
143static inline struct vm_struct **
144pcpu_get_vm_areas(const unsigned long *offsets,
145 const size_t *sizes, int nr_vms,
146 size_t align)
147{
148 return NULL;
149}
150
151static inline void
152pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
153{
154}
155# endif
124#endif 156#endif
125 157
126#endif /* _LINUX_VMALLOC_H */ 158#endif /* _LINUX_VMALLOC_H */
diff --git a/mm/nommu.c b/mm/nommu.c
index cb86e7d5e7f5..c4c542c736a9 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1971,21 +1971,10 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1971} 1971}
1972EXPORT_SYMBOL(filemap_fault); 1972EXPORT_SYMBOL(filemap_fault);
1973 1973
1974/* 1974static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
1975 * Access another process' address space. 1975 unsigned long addr, void *buf, int len, int write)
1976 * - source/target buffer must be kernel space
1977 */
1978int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write)
1979{ 1976{
1980 struct vm_area_struct *vma; 1977 struct vm_area_struct *vma;
1981 struct mm_struct *mm;
1982
1983 if (addr + len < addr)
1984 return 0;
1985
1986 mm = get_task_mm(tsk);
1987 if (!mm)
1988 return 0;
1989 1978
1990 down_read(&mm->mmap_sem); 1979 down_read(&mm->mmap_sem);
1991 1980
@@ -2010,6 +1999,43 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
2010 } 1999 }
2011 2000
2012 up_read(&mm->mmap_sem); 2001 up_read(&mm->mmap_sem);
2002
2003 return len;
2004}
2005
2006/**
2007 * @access_remote_vm - access another process' address space
2008 * @mm: the mm_struct of the target address space
2009 * @addr: start address to access
2010 * @buf: source or destination buffer
2011 * @len: number of bytes to transfer
2012 * @write: whether the access is a write
2013 *
2014 * The caller must hold a reference on @mm.
2015 */
2016int access_remote_vm(struct mm_struct *mm, unsigned long addr,
2017 void *buf, int len, int write)
2018{
2019 return __access_remote_vm(NULL, mm, addr, buf, len, write);
2020}
2021
2022/*
2023 * Access another process' address space.
2024 * - source/target buffer must be kernel space
2025 */
2026int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write)
2027{
2028 struct mm_struct *mm;
2029
2030 if (addr + len < addr)
2031 return 0;
2032
2033 mm = get_task_mm(tsk);
2034 if (!mm)
2035 return 0;
2036
2037 len = __access_remote_vm(tsk, mm, addr, buf, len, write);
2038
2013 mmput(mm); 2039 mmput(mm);
2014 return len; 2040 return len;
2015} 2041}
diff --git a/mm/percpu.c b/mm/percpu.c
index 3f930018aa60..55d4d113fbd3 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1008,8 +1008,7 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr)
1008 } 1008 }
1009 1009
1010 if (in_first_chunk) { 1010 if (in_first_chunk) {
1011 if ((unsigned long)addr < VMALLOC_START || 1011 if (!is_vmalloc_addr(addr))
1012 (unsigned long)addr >= VMALLOC_END)
1013 return __pa(addr); 1012 return __pa(addr);
1014 else 1013 else
1015 return page_to_phys(vmalloc_to_page(addr)); 1014 return page_to_phys(vmalloc_to_page(addr));