linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v3] ARM: uprobes need icache flush after xol write
@ 2014-04-16  4:38 Victor Kamensky
  2014-04-16  4:38 ` Victor Kamensky
  0 siblings, 1 reply; 10+ messages in thread
From: Victor Kamensky @ 2014-04-16  4:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

As it was discussed on [1] today, here is potential ARM specific
fix for uprobes dcache/icache flush problem. I am aware that
other options are still under discussion. This patch is provided for
reference only as one of possible solutions.

The xol slot flush code shares code with ARM backend of
copy_to_user_page - flush_ptrace_access function. But code and new 
implementation of flush_uprobe_xol_access modified in such way that
xol flush does need vma.

Changes since V2 [2] version:

x) address Dave Long's comment about passing checkpatch

x) addressed Oleg's comment and instead of arch_uprobe_flush_xol_access
function use arch_uprobe_copy_ixol function that maps kernel pages, 
copies, and flush caches

x) removed FLAG_UA_BROADCAST, during discussion on [1] it was
elaborated that task executing xol single step could be 
migrated to another CPU, so we need to take care of remote
icaches if CPU does not support remote snooping. I.e
flush_uprobe_xol_access will check cache_ops_need_broadcast()
and perform smp_call_function on SMP CPUs that do not
support remote snooping.

x) added preempt_disable/preempt_enable in arch_uprobe_copy_ixol as
copy_to_user_page does. I admit that I have some guesses, but I 
don't completely understand why copy_to_user_page does that, so 
playing on safe side - added it similar to copy_to_user_page code.

Thanks,
Victor

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-April/247611.html

[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-April/245743.html

Victor Kamensky (1):
  ARM: uprobes need icache flush after xol write

 arch/arm/include/asm/cacheflush.h |  2 ++
 arch/arm/kernel/uprobes.c         | 22 ++++++++++++++++++++++
 arch/arm/mm/flush.c               | 33 ++++++++++++++++++++++++++++-----
 include/linux/uprobes.h           |  3 +++
 kernel/events/uprobes.c           | 25 +++++++++++++++++--------
 5 files changed, 72 insertions(+), 13 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-25 20:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16  4:38 [RFC PATCH v3] ARM: uprobes need icache flush after xol write Victor Kamensky
2014-04-16  4:38 ` Victor Kamensky
2014-04-16 15:06   ` Oleg Nesterov
2014-04-16 15:10     ` David Miller
     [not found]       ` <20140416152946.GA13564@redhat.com>
2014-04-16 15:47         ` David Miller
2014-04-16 16:53           ` Oleg Nesterov
2014-04-16 20:22           ` Russell King - ARM Linux
2014-04-16 21:13             ` David Miller
2014-04-25 20:16               ` David Long
2014-04-25 20:37                 ` Victor Kamensky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).