linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Do not call flush_cache_user_range with mmap_sem held
Date: Wed, 18 Apr 2012 09:40:58 +0100	[thread overview]
Message-ID: <20120418084058.GA723@arm.com> (raw)
In-Reply-To: <CAOesGMjEW0cj2v-2OuWTd9WhLdZr3xOdEpZ2qy_UTdyMhYvaDA@mail.gmail.com>

On Mon, Apr 09, 2012 at 03:24:29PM +0100, Olof Johansson wrote:
> On Sun, Apr 8, 2012 at 10:58 PM, Dirk Behme <dirk.behme@googlemail.com> wrote:
> > In an other thread
> >
> > http://lists.arm.linux.org.uk/lurker/message/20120406.033509.ca9fe8cf.en.html
> >
> > it seems that we have an additional user where this patch fixed an issue.
> >
> > So would it be possible to talk about this patch, again?
> 
> This patch had plenty of talk already. :-)  What it needs is for
> someone to go in and annotate (and thus partially rewrite) the pre-v6
> cacheflush loops with exception fixups, so that the mmap_sem can be
> safely dropped.

There is no need to annotate the pre-v6 cacheflush loops as the cache
maintenance ops on v5 and early do not generate translation or page
faults (VIVT cache that doesn't do page table walks).

> As mentioned above, v6 and v7 are already annotated -- so a bad
> passed-in pointer will just cause a fault, fixup and signal to the
> application like other architectures where the flush can be done from
> userspace, or any other bad pointer passed into a syscall.

A bad pointer is already ignored by do_cache_op() since find_vma()
cannot find a proper address. There is a scenario for multi-threaded
apps where one thread unmaps a range while another tries to flush. For
consistency with the other bad pointer case (i.e. ignoring it), the
cache flushing fixup code simply skips the faulting page without sending
signals to the application.

>From my perspective, this patch is still valid (it keeps the find_vma()
call under the mmap_sem lock but calls the cache flushing outside this
critical region).

-- 
Catalin

  parent reply	other threads:[~2012-04-18  8:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 17:33 [PATCH] ARM: Do not call flush_cache_user_range with mmap_sem held Catalin Marinas
2011-11-16 21:23 ` Olof Johansson
2011-11-16 23:50   ` Russell King - ARM Linux
2011-11-17  0:16     ` Olof Johansson
2011-11-17  0:20       ` Olof Johansson
2011-11-17 10:26       ` Catalin Marinas
2011-11-17 10:49         ` Russell King - ARM Linux
2011-11-17 10:45       ` Russell King - ARM Linux
2011-11-20 17:54         ` Olof Johansson
2011-11-17 10:22     ` Catalin Marinas
2011-11-17 10:42       ` Russell King - ARM Linux
2011-11-17 10:59         ` Catalin Marinas
2011-11-17 11:03           ` Russell King - ARM Linux
2011-11-17 11:25             ` Catalin Marinas
2012-04-09  5:58               ` Dirk Behme
2012-04-09 14:24                 ` Olof Johansson
2012-04-10 17:17                   ` Will Deacon
2012-04-18 15:05                     ` Will Deacon
2012-04-18 15:27                       ` Russell King - ARM Linux
2012-04-18 16:27                         ` Will Deacon
2012-04-18 17:15                         ` Catalin Marinas
2012-04-18  8:40                   ` Catalin Marinas [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-28  7:32 [PATCH] [ARM] " Dima Zavin
2010-04-28  7:35 ` Dima Zavin
2010-04-29 13:00 ` Russell King - ARM Linux
2010-04-29 18:16   ` Jamie Lokier
2010-04-29 18:24     ` Russell King - ARM Linux
2010-04-29 19:23       ` Dima Zavin
2010-05-04  4:07         ` Dima Zavin
2010-05-04  7:40           ` Russell King - ARM Linux
2010-05-06 15:08 ` Catalin Marinas

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=20120418084058.GA723@arm.com \
    --to=catalin.marinas@arm.com \
    --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).