lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100519235158A.fujita.tomonori@lab.ntt.co.jp>
Date:	Wed, 19 May 2010 23:50:08 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	dwmw2@...radead.org
Cc:	herbert@...dor.hengli.com.au, vapier@...too.org, npiggin@...e.de,
	os@...ix.com, davem@...emloft.net, penberg@...helsinki.fi,
	mpm@...enic.com, ken@...elabs.ch, geert@...ux-m68k.org,
	michael-dev@...i-braun.de, linux-kernel@...r.kernel.org,
	linux-crypto@...r.kernel.org, anemo@....ocn.ne.jp
Subject: Re: [PATCH 5/4] Provide __dma_aligned macro

On Wed, 19 May 2010 14:49:08 +0100
David Woodhouse <dwmw2@...radead.org> wrote:

> Commit 3843384a055496dfed3c93ae883d964d8290fdab ("Input: ad7877 - keep
> dma rx buffers in seperate cache lines")[sic] introduced the use of
> ____cacheline_aligned to ensure that buffers used for DMA as part of a
> structure were suitably separated from the rest of the structure.
> 
> However, aligning to the cache line size isn't necessary on
> cache-coherent architectures. To avoid wasting space, the correct value
> to use for the alignment is ARCH_KMALLOC_MINALIGN.
> 
> This patch provides a __dma_aligned macro which does the right thing.
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@...el.com>
> 
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index ca32ed7..4487cf3 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -5,6 +5,9 @@
>  #include <linux/err.h>
>  #include <linux/dma-attrs.h>
>  #include <linux/scatterlist.h>
> +#include <linux/slab.h>
> +
> +#define __dma_aligned __attribute__((__aligned__(ARCH_KMALLOC_MINALIGN)))

As wrote in other mail, such was proposed several times:

http://www.mail-archive.com/linux-scsi@vger.kernel.org/msg12633.html
http://lwn.net/Articles/2269/

And rejected.

http://lwn.net/Articles/2270/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ