Skip to contentSkip to conversation

powerpc: Fix kmalloc alignmenent on non-coherent DMA

PATCH In review Benjamin Herrenschmidt 1 participant 1 message Nov 21, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 8/14 powerpc: Fix kmalloc alignmenent on non-coherent DMA

On platforms doing non-coherent DMA (4xx, 8xx, ...), it's important that kmalloc minimum alignment is set to the cache line size, to avoid sharing cache lines between different objects.

---

 include/asm-powerpc/page_32.h |    4 ++++
 1 file changed, 4 insertions(+)
include/asm-powerpc/page_32.h +4 -0
Index: linux-work/include/asm-powerpc/page_32.h
===================================================================
@@ -6,6 +6,10 @@
 
 #define PPC_MEMSTART	0
 
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
+#endif
+
 #ifndef __ASSEMBLY__
 /*
  * The basic type of a PTE - 64 bits for those CPUs with > 32 bit