linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: victor.kamensky@linaro.org (Victor Kamensky)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v3] ARM: uprobes need icache flush after xol write
Date: Tue, 15 Apr 2014 21:38:31 -0700	[thread overview]
Message-ID: <1397623112-3211-1-git-send-email-victor.kamensky@linaro.org> (raw)

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

             reply	other threads:[~2014-04-16  4:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  4:38 Victor Kamensky [this message]
2014-04-16  4:38 ` [RFC PATCH v3] ARM: uprobes need icache flush after xol write 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397623112-3211-1-git-send-email-victor.kamensky@linaro.org \
    --to=victor.kamensky@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).