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 1/5] ARM: Use lazy cache flushing on ARMv7 SMP systems
Date: Fri, 26 Mar 2010 14:49:42 +0000	[thread overview]
Message-ID: <1269614982.807.80.camel@e102109-lin.cambridge.arm.com> (raw)
In-Reply-To: <20100323213345.GH19572@n2100.arm.linux.org.uk>

On Tue, 2010-03-23 at 21:33 +0000, Russell King - ARM Linux wrote:
> On Mon, Mar 22, 2010 at 03:19:39PM +0000, Catalin Marinas wrote:
> > ARMv7 processors like Cortex-A9 broadcast the cache maintenance
> > operations in hardware. This patch allows the
> > flush_dcache_page/update_mmu_cache pair to work in lazy flushing mode
> > similar to the UP case.
> 
> Didn't Ben point out that there's a race with the lazy dcache flushing
> on SMP platforms?

BTW, even with the current code we still have a similar race with the
I-cache. set_pte_at() creates the entry that another CPU may execute
from before we invalidate the I-cache in update_mmu_cache().

A solution would be that set_pte_at() sets the NX bit which is cleared
later in udpate_mmu_cache() after the I-cache invalidation. Some care
needs to be taken with possible prefetch aborts in the small window when
the page isn't executable.

Note that even if we flush the caches in set_pte_at(), we still have the
I-cache race unless we write the pte twice, first with NX and then
without. So I'm more in favour of the solution in the previous
paragraph.

-- 
Catalin

  parent reply	other threads:[~2010-03-26 14:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 15:19 [PATCH 0/5] Various patches for 2.6.35-rc1 Catalin Marinas
2010-03-22 15:19 ` [PATCH 1/5] ARM: Use lazy cache flushing on ARMv7 SMP systems Catalin Marinas
2010-03-23 21:33   ` Russell King - ARM Linux
2010-03-24  9:51     ` Catalin Marinas
2010-03-26 14:49     ` Catalin Marinas [this message]
2010-03-26 17:36       ` Catalin Marinas
2010-03-22 15:19 ` [PATCH 2/5] ARM: Implement read/write for ownership in the ARMv6 DMA cache ops Catalin Marinas
2010-03-23 21:38   ` Russell King - ARM Linux
2010-03-26 14:08     ` [PATCH 2/5] ARM: Implement read/write for ownership in theARMv6 " Catalin Marinas
2010-03-22 15:19 ` [PATCH 3/5] ARM: Correct the VFPv3 detection Catalin Marinas
2010-03-23 21:38   ` Russell King - ARM Linux
2010-03-22 15:19 ` [PATCH 4/5] ARM: Align machine_desc.phys_io to a 1MB section Catalin Marinas
2010-03-23 21:39   ` Russell King - ARM Linux
2010-03-22 15:20 ` [PATCH 5/5] ARM: Remove the domain switching on ARMv6k/v7 CPUs 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=1269614982.807.80.camel@e102109-lin.cambridge.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).