diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:34 -0400 |
commit | 27c1ee3f929555b71fa39ec0d81a7e7185de1b16 (patch) | |
tree | 42e40bdfe4efac660d650658019391536ce67a42 /arch/xtensa | |
parent | 37cd9600a9e20359b0283983c9e3a55d84347168 (diff) | |
parent | 086ff4b3a7fb9cdf41e6a5d0ccd99b86d84633a1 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge Andrew's first set of patches:
"Non-MM patches:
- lots of misc bits
- tree-wide have_clk() cleanups
- quite a lot of printk tweaks. I draw your attention to "printk:
convert the format for KERN_<LEVEL> to a 2 byte pattern" which
looks a bit scary. But afaict it's solid.
- backlight updates
- lib/ feature work (notably the addition and use of memweight())
- checkpatch updates
- rtc updates
- nilfs updates
- fatfs updates (partial, still waiting for acks)
- kdump, proc, fork, IPC, sysctl, taskstats, pps, etc
- new fault-injection feature work"
* Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (128 commits)
drivers/misc/lkdtm.c: fix missing allocation failure check
lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
fault-injection: add tool to run command with failslab or fail_page_alloc
fault-injection: add selftests for cpu and memory hotplug
powerpc: pSeries reconfig notifier error injection module
memory: memory notifier error injection module
PM: PM notifier error injection module
cpu: rewrite cpu-notifier-error-inject module
fault-injection: notifier error injection
c/r: fcntl: add F_GETOWNER_UIDS option
resource: make sure requested range is included in the root range
include/linux/aio.h: cpp->C conversions
fs: cachefiles: add support for large files in filesystem caching
pps: return PTR_ERR on error in device_create
taskstats: check nla_reserve() return
sysctl: suppress kmemleak messages
ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION
ipc: compat: use signed size_t types for msgsnd and msgrcv
ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC
ipc: add COMPAT_SHMLBA support
...
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/kernel/syscall.c | 2 | ||||
-rw-r--r-- | arch/xtensa/mm/fault.c | 29 |
2 files changed, 25 insertions, 6 deletions
diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index 816e6d0d686c..05b3f093d5d7 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel/syscall.c | |||
@@ -44,7 +44,7 @@ asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) | |||
44 | unsigned long ret; | 44 | unsigned long ret; |
45 | long err; | 45 | long err; |
46 | 46 | ||
47 | err = do_shmat(shmid, shmaddr, shmflg, &ret); | 47 | err = do_shmat(shmid, shmaddr, shmflg, &ret, SHMLBA); |
48 | if (err) | 48 | if (err) |
49 | return err; | 49 | return err; |
50 | return (long)ret; | 50 | return (long)ret; |
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index b17885a0b508..5a74c53bc69c 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c | |||
@@ -44,6 +44,7 @@ void do_page_fault(struct pt_regs *regs) | |||
44 | 44 | ||
45 | int is_write, is_exec; | 45 | int is_write, is_exec; |
46 | int fault; | 46 | int fault; |
47 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | ||
47 | 48 | ||
48 | info.si_code = SEGV_MAPERR; | 49 | info.si_code = SEGV_MAPERR; |
49 | 50 | ||
@@ -71,6 +72,7 @@ void do_page_fault(struct pt_regs *regs) | |||
71 | address, exccause, regs->pc, is_write? "w":"", is_exec? "x":""); | 72 | address, exccause, regs->pc, is_write? "w":"", is_exec? "x":""); |
72 | #endif | 73 | #endif |
73 | 74 | ||
75 | retry: | ||
74 | down_read(&mm->mmap_sem); | 76 | down_read(&mm->mmap_sem); |
75 | vma = find_vma(mm, address); | 77 | vma = find_vma(mm, address); |
76 | 78 | ||
@@ -93,6 +95,7 @@ good_area: | |||
93 | if (is_write) { | 95 | if (is_write) { |
94 | if (!(vma->vm_flags & VM_WRITE)) | 96 | if (!(vma->vm_flags & VM_WRITE)) |
95 | goto bad_area; | 97 | goto bad_area; |
98 | flags |= FAULT_FLAG_WRITE; | ||
96 | } else if (is_exec) { | 99 | } else if (is_exec) { |
97 | if (!(vma->vm_flags & VM_EXEC)) | 100 | if (!(vma->vm_flags & VM_EXEC)) |
98 | goto bad_area; | 101 | goto bad_area; |
@@ -104,7 +107,11 @@ good_area: | |||
104 | * make sure we exit gracefully rather than endlessly redo | 107 | * make sure we exit gracefully rather than endlessly redo |
105 | * the fault. | 108 | * the fault. |
106 | */ | 109 | */ |
107 | fault = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); | 110 | fault = handle_mm_fault(mm, vma, address, flags); |
111 | |||
112 | if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) | ||
113 | return; | ||
114 | |||
108 | if (unlikely(fault & VM_FAULT_ERROR)) { | 115 | if (unlikely(fault & VM_FAULT_ERROR)) { |
109 | if (fault & VM_FAULT_OOM) | 116 | if (fault & VM_FAULT_OOM) |
110 | goto out_of_memory; | 117 | goto out_of_memory; |
@@ -112,10 +119,22 @@ good_area: | |||
112 | goto do_sigbus; | 119 | goto do_sigbus; |
113 | BUG(); | 120 | BUG(); |
114 | } | 121 | } |
115 | if (fault & VM_FAULT_MAJOR) | 122 | if (flags & FAULT_FLAG_ALLOW_RETRY) { |
116 | current->maj_flt++; | 123 | if (fault & VM_FAULT_MAJOR) |
117 | else | 124 | current->maj_flt++; |
118 | current->min_flt++; | 125 | else |
126 | current->min_flt++; | ||
127 | if (fault & VM_FAULT_RETRY) { | ||
128 | flags &= ~FAULT_FLAG_ALLOW_RETRY; | ||
129 | |||
130 | /* No need to up_read(&mm->mmap_sem) as we would | ||
131 | * have already released it in __lock_page_or_retry | ||
132 | * in mm/filemap.c. | ||
133 | */ | ||
134 | |||
135 | goto retry; | ||
136 | } | ||
137 | } | ||
119 | 138 | ||
120 | up_read(&mm->mmap_sem); | 139 | up_read(&mm->mmap_sem); |
121 | return; | 140 | return; |