Re: [PATCH] crypto_mem_not_equal: add constant-time equality testing of memory regions

2013-09-19 Thread Daniel Borkmann
On 09/19/2013 02:13 AM, James Yonan wrote: [...] We can easily specify -Os in the Makefile rather than depending on #pragma optimize or __attribute__ optimize if they are considered broken. Re: arch/*/crypto/... asm, not sure it's worth it given the extra effort to develop, test, and maintain

Re: [PATCH v2] crypto: caam - map src buffer before access

2013-09-19 Thread Horia Geantă
On 9/11/2013 10:24 PM, Yashpal Dutta wrote: KMap the buffers before copying trailing bytes during hmac into a session temporary buffer. This is required if pinned buffer from user-space is send during hmac and is safe even if hmac request is generated from within kernel. Signed-off-by: Yashpal

Re: crypto: GCM API usage

2013-09-19 Thread Marcelo Cerri
On Mon, Sep 16, 2013 at 08:34:11PM +0200, Dominik Paulus wrote: Hi, On Mon, Sep 16, 2013 at 12:58:40PM +0200, dominik.d.pau...@studium.uni-erlangen.de wrote: We are currently trying to add encryption support to the usbip kernel driver. Unfortunately, there is almost no documentation for

[PATCH 00/51] DMA mask changes

2013-09-19 Thread Russell King - ARM Linux
This started out as a request to look at the DMA mask situation, and how to solve the issues which we have on ARM - notably how the DMA mask should be setup. However, I started off reviewing how the dma_mask and coherent_dma_mask was being used, and what I found was rather messy, and in some

[PATCH 02/51] DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { *using_dac = true; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

[PATCH 03/51] DMA-API: net: intel/e1000e: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 04/51] DMA-API: net: intel/igb: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 05/51] DMA-API: net: intel/igbvf: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 06/51] DMA-API: net: intel/ixgb: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 07/51] DMA-API: net: intel/ixgbe: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { pci_using_dac = 1; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

[PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks

2013-09-19 Thread Russell King
Provide a helper to set both the DMA and coherent DMA masks to the same value - this avoids duplicated code in a number of drivers, sometimes with buggy error handling, and also allows us identify which drivers do things differently. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk ---

[PATCH 08/51] DMA-API: net: intel/ixgbevf: fix 32-bit DMA mask handling

2013-09-19 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(pdev-dev, DMA_BIT_MASK(64)) !dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(64))) { pci_using_dac = 1; } else { err = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));

[PATCH 17/51] DMA-API: block: nvme-core: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-19 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- drivers/block/nvme-core.c | 10 -- 1 files changed, 4

Re: [PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks

2013-09-19 Thread Ben Hutchings
On Thu, 2013-09-19 at 22:25 +0100, Russell King wrote: Provide a helper to set both the DMA and coherent DMA masks to the same value - this avoids duplicated code in a number of drivers, sometimes with buggy error handling, and also allows us identify which drivers do things differently.

[PATCH 35/51] DMA-API: parport: parport_pc.c: use dma_coerce_mask_and_coherent()

2013-09-19 Thread Russell King
The code sequence: dev-coherent_dma_mask = DMA_BIT_MASK(24); dev-dma_mask = dev-coherent_dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this mask. Signed-off-by: Russell

[PATCH 50/51] ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-19 Thread Russell King
From: Santosh Shilimkar santosh.shilim...@ti.com DMA bounce limit is the maximum direct DMA'able memory beyond which bounce buffers has to be used to perform dma operations. MMC queue layr relies on dma_mask but its calculation is based on max_*pfn which don't have uniform meaning across

[PATCH 43/51] DMA-API: dma: edma.c: no need to explicitly initialize DMA masks

2013-09-19 Thread Russell King
register_platform_device_full() can setup the DMA mask provided the appropriate member is set in struct platform_device_info. So lets make that be the case. This avoids a direct reference to the DMA masks by this driver. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk ---

[PATCH 44/51] DMA-API: dcdbas: update DMA mask handing

2013-09-19 Thread Russell King
dcdbas was explicitly initializing DMA masks thusly: dcdbas_pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32); dcdbas_pdev-dev.dma_mask = dcdbas_pdev-dev.coherent_dma_mask; which bypasses the architecture check. Moreover, it is creating the dcdbas_pdev device itself, and using the

[PATCH 40/51] DMA-API: crypto: fix ixp4xx crypto platform device support

2013-09-19 Thread Russell King
Don't statically allocate struct device's in modules, and shut the warning up with an empty release() function. There's a reason that warning is there and that's not for people to hide in this way. It's there to persuade people to use the correct APIs to allocate platform devices.

[PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-19 Thread Russell King
Use platform_device_register_full() for those drivers which can, to avoid messing directly with DMA masks. This can only be done when the driver does not need to access the allocated musb platform device from within its callbacks, which may be called during the musb device probing.