linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: uprobes need icache flush after xol write
Date: Tue, 8 Apr 2014 16:41:17 +0100	[thread overview]
Message-ID: <20140408154117.GI16119@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140408152735.GA30076@redhat.com>

On Tue, Apr 08, 2014 at 05:27:35PM +0200, Oleg Nesterov wrote:
> Sorry, I din't read the whole thread yet...
> 
> On 04/08, Russell King - ARM Linux wrote:
> > On Tue, Apr 08, 2014 at 09:05:49AM -0400, David Long wrote:
> > > Unfortunately copy_to_user_page() also needs a pointer to a vma struct
> > > so, while it presumably provides the model to follow, it can't simply be
> > > dropped in.
> >
> > Well, isn't this code doing the same thing as ptrace?  It seems to want
> > to modify a page in userspace of another process to change instructions
> > that are going to be executed. That's what ptrace does, and ptrace
> > already copes with all the issues there.
> 
> Yes, but it does get_user_pages(&vma) and thus it knows vma.
> 
> > Given that we've already solved that problem, wouldn't it be a good idea
> > if the tracing code would stop trying to reinvent broken solutions to
> > problems we have already solved?
> 
> But uprobes can't do this. Of course, I am not saying this is impossible,
> but it would be nice to avoid mmap_sem/find_vma/etc.
> 
> Almost nobody (iirc only sparc?) actually uses this "vma" arguments. And
> at least the supported architectures do not (at least this is what I think
> after the quick grep).
> 
> Perhaps we can rolerate the hack below?

This has no effect at fixing the reported problem though:

#define flush_icache_user_range(vma,page,addr,len) \
        flush_dcache_page(page)

so it results in no change.

The bigger question is... what is this function supposed to do?  It's
not been documented in Documentation/cachetlb.txt, and nothing in the
kernel refers to this function - it is completely unused.

I think let's start out by killing this function - the semantics of
this function have been lost, so it's not clear what it was supposed
to do in its original form.  Even going back to the start of git
history, it looks like it was never used outside arch code.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

  reply	other threads:[~2014-04-08 15:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  3:04 [RFC PATCH] ARM: uprobes need icache flush after xol write Victor Kamensky
2014-04-08  3:04 ` Victor Kamensky
2014-04-08  8:24   ` Dave Martin
2014-04-08 11:46     ` Russell King - ARM Linux
2014-04-08 13:05       ` David Long
2014-04-08 13:30         ` Russell King - ARM Linux
2014-04-08 14:09           ` Victor Kamensky
2014-04-08 15:35             ` Victor Kamensky
2014-04-08 16:19               ` Russell King - ARM Linux
2014-04-08 16:29                 ` David Long
2014-04-08 18:39                 ` Victor Kamensky
2014-04-08 15:27           ` Oleg Nesterov
2014-04-08 15:41             ` Russell King - ARM Linux [this message]
2014-04-09 16:18               ` Russell King - ARM Linux
2014-04-09 16:38                 ` Russell King - ARM Linux
2014-04-09 18:24                 ` Oleg Nesterov
2014-04-08 14:15         ` 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=20140408154117.GI16119@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).