All of lore.kernel.org
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] Do not call flush_cache_user_range with mmap_sem held
Date: Tue, 14 Dec 2010 21:08:42 +0000	[thread overview]
Message-ID: <AANLkTimw839TCrzY0X4n8_AcwwdT1kFxNQNNsFC9SRdb@mail.gmail.com> (raw)
In-Reply-To: <20101214190503.GB24303@n2100.arm.linux.org.uk>

On Tuesday, 14 December 2010, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Dec 14, 2010 at 05:51:36PM +0000, Catalin Marinas wrote:
>> But what's the problem if such mapping disappears? The
>> flush_cache_user_range code should just skip such pages.
>
> That's only half the story.
>
> What if someone remaps something over that range before the cache
> maintainence has completed.

That someone remapping the same range can only be a thread of the same
process. If the code was so badly written as to unmap ranges of memory
when a thread actively uses it, then it probably deserves any
corruption.

OTOH, the cache flushing operations is pretty harmless even if you do
it on the wrong memory range. On ARM11MPCore we probably need to do
some read/write for ownership as in the DMA ops.

There are architectures at allow cache flushing from user space (no
invalidation as that's a bit dangerous) and they don't have any access
to the kernel semaphores. I don't see this any difference here, we
just need to make sure that the kernel can cope with invalid ranges.

-- 
Catalin

  reply	other threads:[~2010-12-14 21:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  4:57 [PATCH 0/4][RFC] Trivial ARM related Android patches John Stultz
2010-12-14  4:57 ` [PATCH 1/4] avoid mis-detecting some V7 cores in the decompressor John Stultz
2010-12-14  4:57 ` [PATCH 2/4] Optionally flush entire dcache from v6_dma_flush_range John Stultz
2010-12-14  9:30   ` Russell King - ARM Linux
2010-12-14 10:58   ` Catalin Marinas
2010-12-14  4:57 ` [PATCH 3/4] process: Add display of memory around registers when displaying regs John Stultz
2010-12-14  9:34   ` Russell King - ARM Linux
2010-12-14  4:57 ` [PATCH 4/4] Do not call flush_cache_user_range with mmap_sem held John Stultz
2010-12-14  9:30   ` Russell King - ARM Linux
2010-12-14 17:51     ` Catalin Marinas
2010-12-14 19:05       ` Russell King - ARM Linux
2010-12-14 21:08         ` Catalin Marinas [this message]
2011-04-04 13:27           ` Catalin Marinas
2011-04-04 13:37             ` Russell King - ARM Linux
2011-04-04 13:43               ` Catalin Marinas
2011-08-26  7:32                 ` Jiejing.Zhang 
2011-09-05 11:21                   ` Catalin Marinas
2010-12-14 18:18   ` 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=AANLkTimw839TCrzY0X4n8_AcwwdT1kFxNQNNsFC9SRdb@mail.gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.