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: Thu, 17 Nov 2011 11:25:08 +0000 [thread overview]
Message-ID: <20111117112508.GA20412@arm.com> (raw)
In-Reply-To: <20111117110339.GO9581@n2100.arm.linux.org.uk>
On Thu, Nov 17, 2011 at 11:03:39AM +0000, Russell King - ARM Linux wrote:
> On Thu, Nov 17, 2011 at 10:59:36AM +0000, Catalin Marinas wrote:
> > On Thu, Nov 17, 2011 at 10:42:46AM +0000, Russell King - ARM Linux wrote:
> > > On Thu, Nov 17, 2011 at 10:22:05AM +0000, Catalin Marinas wrote:
> > > > BTW, we could even go a step further an remove the vma checks entirely,
> > > > just use access_ok() since __cpuc_coherent_user_range() can handle
> > > > unmapped ranges properly (though it may introduce some latency if some
> > > > user app passes a 3G range but we can change the fixup code to abort the
> > > > operation when it gets a fault that can't be fixed up).
> > >
> > > So, do you think that it is acceptable to be able to pass into this from
> > > userspace the arguments '0', '~0', '0' and have the kernel spin over the
> > > entire 4G space, including IO space on any of the supported architectures.
> >
> > We have access_ok() to check for user only space.
> >
> > > Note that pre-ARMv6 CPUs will spin over that range in 32-byte steps
> > > whether or not there's a page present.
> >
> > You are right, the pre-v6 hardware would not trigger a fault. So if we
> > don't want another #ifdef in this function, we just keep the vma checks
> > for all architecture versions.
> >
> > But I consider that the original patch is still valid.
>
> You thinks it's safe to walk the vma list with no locks held?
No, I don't, but the patch only releases the semaphore when calling the
cache flushing function. The vmas are walked with the semaphore held.
Please read the patch I posted properly.
--
Catalin
next prev parent reply other threads:[~2011-11-17 11:25 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 [this message]
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
-- 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=20111117112508.GA20412@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).