linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* change_page_attr() implementation for ARM?
@ 2013-10-17  5:05 Hiroshi Doyu
  2013-10-17 10:13 ` Catalin Marinas
  0 siblings, 1 reply; 11+ messages in thread
From: Hiroshi Doyu @ 2013-10-17  5:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I found a bit old discussion[1] about CPA support on ARM32(Cortex-A9).

It seesm that CPA API on ARM wasn't possible because maintaining
multiple pagetables under SMP is difficult. Instead currently we are
using precallocated memory via DMA API.

Is this situation still same for Cortex-A15 and ARM64? If the
mismatched aliasing problem doesn't happen, is CPA API feasible?

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-October/069275.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-October/069315.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-October/069318.html

^ permalink raw reply	[flat|nested] 11+ messages in thread
* change_page_attr() implementation for ARM?
@ 2011-09-21 22:10 Vinod Rex
  2011-09-23  9:04 ` Catalin Marinas
  0 siblings, 1 reply; 11+ messages in thread
From: Vinod Rex @ 2011-09-21 22:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Cortex-A9, we have observed stale data being read from write-combine (C=0 B=1) memory regions mapped into userspace which have a duplicate cacheable mapping in the kernel address space (due to the kernel linear mapping).

The issue appears to be due to speculative prefetch on the cacheable kernel linear mapping which gets lines into the L2 cache. When reads are performed on the write-combine mapping for this address range, these reads get the stale data from L2 instead of memory.

As per the Cortex-A9 spec, behavior for double mappings with conflicting page attributes is undefined, so we need a way to make sure all duplicate mappings have the same memory type attributes. 

Similar issue on x86 is handled using the change_page_attr()/set_memory_*() functions defined in arch/x86/mm/pageattr.c. ?This function modifies the attributes of the page in kernel linear map to match the corresponding mapping in userspace to avoid having duplicate mappings with different page attributes. It accomplishes this by splitting section (large page) mappings into 4KB page mappings as needed so that the page attribute change is done only for the requested memory region.

Would a similar implementation for ARM be appropriate? We are experimenting with a port of change_page_attr() to ARM that seems to solve our problems.

Other approaches proposed to solve this on ARM, by remapping CMA reserved region using 4KB page mappings will not help us since IOMMU mappings don't use DMA contiguous allocation routines.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-11-14 15:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-17  5:05 change_page_attr() implementation for ARM? Hiroshi Doyu
2013-10-17 10:13 ` Catalin Marinas
2013-10-17 10:28   ` Hiroshi Doyu
2013-11-12 13:45   ` Hiroshi Doyu
2013-11-14 15:41     ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2011-09-21 22:10 Vinod Rex
2011-09-23  9:04 ` Catalin Marinas
2011-10-13  2:27   ` Krishna Reddy
2011-10-13  8:49     ` Russell King - ARM Linux
2011-10-13  8:59       ` Catalin Marinas
2011-10-13  8:52     ` Catalin Marinas

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).