diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-09-01 12:30:13 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-10-04 10:13:57 -0400 |
commit | d99a043a9a506290a0aac6746a8e412df3dafbfb (patch) | |
tree | dfcda71fb7f0c1d293888cd0a6b76cc7f0a39111 /arch/mips/kernel | |
parent | 8e3a9f4c3ab6dd0da5e8a89bd252518ff2ee5e3a (diff) |
MIPS: uprobes: Flush icache via kernel address
Update arch_uprobe_copy_ixol() to use the kmap_atomic() based kernel
address to flush the icache with flush_icache_range(), rather than the
user mapping. We have the kernel mapping available anyway and this
avoids having to switch to using the new __flush_icache_user_range() for
the sake of Enhanced Virtual Addressing (EVA) where flush_icache_range()
will become ineffective on user addresses.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14154/
Patchwork: https://patchwork.linux-mips.org/patch/14308/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/uprobes.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c index 4c7c1558944a..15ad17cb2b6e 100644 --- a/arch/mips/kernel/uprobes.c +++ b/arch/mips/kernel/uprobes.c | |||
@@ -282,19 +282,14 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, | |||
282 | void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, | 282 | void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, |
283 | void *src, unsigned long len) | 283 | void *src, unsigned long len) |
284 | { | 284 | { |
285 | void *kaddr; | 285 | unsigned long kaddr, kstart; |
286 | 286 | ||
287 | /* Initialize the slot */ | 287 | /* Initialize the slot */ |
288 | kaddr = kmap_atomic(page); | 288 | kaddr = (unsigned long)kmap_atomic(page); |
289 | memcpy(kaddr + (vaddr & ~PAGE_MASK), src, len); | 289 | kstart = kaddr + (vaddr & ~PAGE_MASK); |
290 | kunmap_atomic(kaddr); | 290 | memcpy((void *)kstart, src, len); |
291 | 291 | flush_icache_range(kstart, kstart + len); | |
292 | /* | 292 | kunmap_atomic((void *)kaddr); |
293 | * The MIPS version of flush_icache_range will operate safely on | ||
294 | * user space addresses and more importantly, it doesn't require a | ||
295 | * VMA argument. | ||
296 | */ | ||
297 | flush_icache_range(vaddr, vaddr + len); | ||
298 | } | 293 | } |
299 | 294 | ||
300 | /** | 295 | /** |