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: [PATCH 2/8] ARM: Implement read/write for ownership in theARMv6 DMA cache ops
Date: Mon, 17 May 2010 09:57:51 +0100	[thread overview]
Message-ID: <20100517085751.GD23118@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <309002C0DA137042828828FC53D7A93492FA313710@IL-MB01.marvell.com>

On Mon, May 17, 2010 at 11:29:53AM +0300, Ronen Shitrit wrote:
> On Mon, May 17, 2010 at 10:34:36AM +0300, Ronen Shitrit wrote:
> > I can only think of one problematic scenario:
> > - After 1 and before 2: 
> > 	CPU0 did spec prefetch for address x 
> > - After 2: 
> > 	CPU0 is doing inv: lock int, ldr x, 
> > 		str x (addr x is marked dirty with wrong data).
> 
> The data has been corrupted at this point; you don't need a second CPU.
>
> [Ronen Shitrit] Why? If the second CPU doesn't exist an invalidate will
> come just after the str inst and the wrong data will not get anywhere...
> (interrupts are locked so I assume no eviction...)

If a speculative prefetch occurs (eg, to prefetch the next ldr) it
could evict the dirty cache line that the str just wrote to.  Cache
replacement algorithms aren't always round-robin.

> 
> > 	CPU1 at this time doing spec prefetch for x which 
> > 		will snoop CPU0 and will cause data corruption... :(
> > 
> > I can assume that if I count on the Soc IO cache coherency support all
> > this isn't relevant, right? Or there are some issues hiding with v6 +
> > IO coherency?
> 
> What "IO cache coherency" ?  Are you saying that your SoC has a mode
> where the DMA controller can snoop the CPU caches?
> 
> [Ronen Shitrit] Yes. 

That suggests to me that your SoC manufacturer intended the system to run
with DMA coherency enabled - maybe to avoid these problems.

We have a macro in the kernel to avoid unnecessary cache handling as a
result of that - arch_is_coherent().  Maybe you should enable the hardware
DMA coherency and ensure arch_is_coherent() returns true for your SoC.

  reply	other threads:[~2010-05-17  8:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 16:44 [PATCH 0/8] Various patches for comments and upstream Catalin Marinas
2010-05-04 16:44 ` [PATCH 1/8] ARM: Improve the L2 cache performance when PL310 is used Catalin Marinas
2010-05-04 17:02   ` Jason McMullan
2010-05-05 16:07     ` Catalin Marinas
2010-05-04 16:44 ` [PATCH 2/8] ARM: Implement read/write for ownership in the ARMv6 DMA cache ops Catalin Marinas
2010-05-04 17:04   ` Jason McMullan
2010-05-05 16:23     ` Catalin Marinas
2010-05-05 13:26   ` George G. Davis
2010-05-06 14:40     ` Catalin Marinas
2010-05-06 15:57       ` George G. Davis
2010-05-12 12:51   ` Ronen Shitrit
2010-05-12 13:55     ` Catalin Marinas
2010-05-12 15:03       ` Ronen Shitrit
2010-05-12 18:48       ` Russell King - ARM Linux
2010-05-12 18:59         ` Russell King - ARM Linux
2010-05-12 20:00           ` Ronen Shitrit
2010-05-12 20:04             ` Russell King - ARM Linux
2010-05-12 20:19               ` Ronen Shitrit
2010-05-12 21:21           ` [PATCH 2/8] ARM: Implement read/write for ownership in theARMv6 " Catalin Marinas
2010-05-13  5:27             ` Ronen Shitrit
2010-05-13  8:26               ` Catalin Marinas
2010-05-13 13:54                 ` George G. Davis
2010-05-13 14:15                   ` Catalin Marinas
2010-05-13 20:34                     ` George G. Davis
2010-05-14 16:29                       ` Catalin Marinas
2010-05-14 16:42                         ` Catalin Marinas
2010-05-15  1:26                           ` George G. Davis
2010-05-16  6:28                             ` Ronen Shitrit
2010-05-16  6:29                 ` Ronen Shitrit
2010-05-16 15:01                   ` Russell King - ARM Linux
2010-05-17  6:29                     ` Ronen Shitrit
2010-05-17  6:57                       ` Russell King - ARM Linux
2010-05-17  7:34                         ` Ronen Shitrit
2010-05-17  7:43                           ` Russell King - ARM Linux
2010-05-17  8:29                             ` Ronen Shitrit
2010-05-17  8:57                               ` Russell King - ARM Linux [this message]
2010-05-17  9:50                                 ` Ronen Shitrit
2010-05-17 10:03                                   ` Russell King - ARM Linux
2010-05-17 11:26                                     ` Ronen Shitrit
2010-05-17 11:31                                       ` Russell King - ARM Linux
2010-05-17 11:45                                         ` Catalin Marinas
2010-05-17 10:00                           ` Catalin Marinas
2010-05-17 11:29                             ` Ronen Shitrit
2010-05-17 11:42                               ` Catalin Marinas
2010-05-17 12:04                                 ` Ronen Shitrit
2010-05-17 13:45                                   ` Catalin Marinas
2010-05-17  9:51                   ` Catalin Marinas
2010-05-17  9:57                     ` Catalin Marinas
2010-05-17  9:59                       ` Ronen Shitrit
2010-05-17 11:08                         ` Catalin Marinas
2010-05-17 11:27                           ` Ronen Shitrit
2010-05-17 11:47                             ` Catalin Marinas
2010-05-17 13:46                               ` [PATCH 2/8] ARM: Implement read/write for ownership intheARMv6 " Catalin Marinas
2010-05-04 16:44 ` [PATCH 3/8] ARM: Align machine_desc.phys_io to a 1MB section Catalin Marinas
2010-05-04 16:44 ` [PATCH 4/8] ARM: Remove the domain switching on ARMv6k/v7 CPUs Catalin Marinas
2010-05-04 16:44 ` [PATCH 5/8] ARM: Fix the __arm_ioremap_caller() definition in nommu.c Catalin Marinas
2010-05-04 17:19   ` Russell King - ARM Linux
2010-05-04 16:44 ` [PATCH 6/8] ARM: Implement copy_to_user_page() for noMMU Catalin Marinas
2010-05-04 17:19   ` Russell King - ARM Linux
2010-05-04 16:44 ` [PATCH 7/8] ARM: Use the Inner Shareable I-cache and BTB ops on ARMv7 SMP Catalin Marinas
2010-05-28 18:50   ` Russell King - ARM Linux
2010-05-28 21:37     ` [PATCH 7/8] ARM: Use the Inner Shareable I-cache and BTB opson " Catalin Marinas
2010-05-04 16:44 ` [PATCH 8/8] ARM: Implement phys_mem_access_prot() to avoid attributes aliasing Catalin Marinas
2010-05-04 16:48 ` [PATCH 0/8] Various patches for comments and upstream 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=20100517085751.GD23118@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).