- 01 12月, 2015 2 次提交
-
-
由 Anton Blanchard 提交于
The enable_kernel_*() functions leave the relevant MSR bits enabled until we exit the kernel sometime later. Create disable versions that wrap the kernel use of FP, Altivec VSX or SPE. While we don't want to disable it normally for performance reasons (MSR writes are slow), it will be used for a debug boot option that does this and catches bad uses in other areas of the kernel. Signed-off-by: NAnton Blanchard <anton@samba.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
由 Anton Blanchard 提交于
With the recent change to enable_kernel_vsx(), we no longer need to call enable_kernel_fp() and enable_kernel_altivec(). Signed-off-by: NAnton Blanchard <anton@samba.org> Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
-
- 13 11月, 2015 1 次提交
-
-
由 Tadeusz Struk 提交于
Bugfix - don't dereference userspace pointer. Cc: stable@vger.kernel.org Signed-off-by: NTadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
- 07 11月, 2015 1 次提交
-
-
由 Suthikulpanit, Suravee 提交于
Now that we have the new DMA attribute APIs, we can replace the older acpi_check_dma() and device_dma_is_coherent(). Signed-off-by: NSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Acked-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 20 10月, 2015 30 次提交
-
-
由 Russell King 提交于
Much of the driver uses cpu_to_le32() to convert values for descriptors to little endian before writing. Use __le32 to define the hardware- accessed parts of the descriptors, and ensure most places where it's reasonable to do so use cpu_to_le32() when assigning to these. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
When tdma->src is freed in mv_cesa_dma_cleanup(), we convert the DMA address from a little-endian value prior to calling dma_pool_free(). However, mv_cesa_dma_add_op() assigns tdma->src without first converting the DMA address to little endian. Fix this. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Use the IO memcpy() functions when copying from/to MMIO memory. These locations were found via sparse. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Use gfp_t not u32 for the GFP flags. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
cur_dma is part of the software state, not read by the hardware. Storing it in LE32 format is wrong, use dma_addr_t for this. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Use relaxed IO accessors where appropriate. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
The kernel's coding style suggests that closing braces for initialisers should not be aligned to the open brace column. The CodingStyle doc shows how this should be done. Remove the additional tab. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Avoid exporting lots of state by only exporting what we really require, which is the buffer containing the set of pending bytes to be hashed, number of pending bytes, the context buffer, and the function pointer state. This reduces down the exported state size to 216 bytes from 576 bytes. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
caam does not properly calculate the size of the retained state when non-block aligned hashes are requested - it uses the wrong buffer sizes, which results in errors such as: caam_jr 2102000.jr1: 40000501: DECO: desc idx 5: SGT Length Error. The descriptor is trying to read more data than is contained in the SGT table. We end up here with: in_len 0x46 blocksize 0x40 last_bufsize 0x0 next_bufsize 0x6 to_hash 0x40 ctx_len 0x28 nbytes 0x20 which results in a job descriptor of: jobdesc@889: ed03d918: b0861c08 3daa0080 f1400000 3d03d938 jobdesc@889: ed03d928: 00000068 f8400000 3cde2a40 00000028 where the word at 0xed03d928 is the expected data size (0x68), and a scatterlist containing: sg@892: ed03d938: 00000000 3cde2a40 00000028 00000000 sg@892: ed03d948: 00000000 3d03d100 00000006 00000000 sg@892: ed03d958: 00000000 7e8aa700 40000020 00000000 0x68 comes from 0x28 (the context size) plus the "in_len" rounded down to a block size (0x40). in_len comes from 0x26 bytes of unhashed data from the previous operation, plus the 0x20 bytes from the latest operation. The fixed version would create: sg@892: ed03d938: 00000000 3cde2a40 00000028 00000000 sg@892: ed03d948: 00000000 3d03d100 00000026 00000000 sg@892: ed03d958: 00000000 7e8aa700 40000020 00000000 which replaces the 0x06 length with the correct 0x26 bytes of previously unhashed data. This fixes a previous commit which erroneously "fixed" this due to a DMA-API bug report; that commit indicates that the bug was caused via a test_ahash_pnum() function in the tcrypt module. No such function has ever existed in the mainline kernel. Given that the change in this commit has been tested with DMA API debug enabled and shows no issue, I can only conclude that test_ahash_pnum() was triggering that bad behaviour by CAAM. Fixes: 7d5196ab ("crypto: caam - Correct DMA unmap size in ahash_update_ctx()") Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
When exporting and importing the hash state, we will only export and import into hashes which share the same struct crypto_ahash pointer. (See hash_accept->af_alg_accept->hash_accept_parent.) This means that saving the caam_hash_ctx structure on export, and restoring it on import is a waste of resources. So, remove this code. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Print the errno code when hash registration fails, so we know why the failure occurred. This aids debugging. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Boris Brezillon 提交于
To: Boris Brezillon <boris.brezillon@free-electrons.com>,Arnaud Ebalard <arno@natisbad.org>,Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,Jason Cooper <jason@lakedaemon.net> The local chain variable is not cleaned up if an error occurs in the middle of DMA chain creation. Fix that by dropping the local chain variable and using the dreq->chain field which will be cleaned up by mv_cesa_dma_cleanup() in case of errors. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reported-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
When adding the software padding, this must be done using the first/mid fragment mode, and any subsequent operation needs to be a mid-fragment. Fix this. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Rearrange the last request handling for hashes which require software padding. We prepare the padding to be appended, and then append as much of the padding to any existing data that's already queued up, adding an operation block and launching the operation. Any remainder is then appended as a separate operation. This ensures that the hardware only ever sees multiples of the hash block size to be operated on for software padded hashes, thus ensuring that the engine always indicates that it has finished the calculation. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Rearrange the last request handling for hardware finished hashes by moving the generation of the fragment operation into this path. This results in a simplified sequence to handle this case, and allows us to move the software padded case further down into the function. Add comments describing these parts. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Move the test for the last request out of mv_cesa_ahash_dma_last_req() to its caller, and move the mv_cesa_dma_add_frag() down into this function. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Avoid adding the final operation within the loop, but instead add it outside. We combine this with the handling for the no-data case. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
When we process the last request of data, and the request contains user data, the loop in mv_cesa_ahash_dma_req_init() marks the first data size as being iter.base.op_len which does not include the size of the cache data. This means we end up hashing an insufficient amount of data. Fix this by always including the cache size in the first operation length of any request. This has the effect that for a request containing no user data, iter.base.op_len === iter.src.op_offset === creq->cache_ptr As a result, we include one further change to use iter.base.op_len in the cache-but-no-user-data case to make the next change clearer. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Use the presence of the scatterlist to determine whether we should load any new user data to the engine. The following shall always be true at this point: iter.base.op_len == 0 === iter.src.sg In doing so, we can: 1. eliminate the test for iter.base.op_len inside the loop, which makes the loop operation more obvious and understandable. 2. move the operation generation for the cache-only case. This prepares the code for the next step in its transformation, and also uncovers a bug that will be fixed in the next patch. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Move the calls to mv_cesa_dma_add_frag() into the parent function, mv_cesa_ahash_dma_req_init(). This is in preparation to changing when we generate the operation blocks, as we need to avoid generating a block for a partial hash block at the end of the user data. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
If we add a template first-fragment operation, always update the template to be a mid-fragment. This ensures that mid-fragments always follow on from a first fragment in every case. This means we can move the first to mid-fragment update code out of mv_cesa_ahash_dma_add_data(). Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Add a helper to add the fragment operation block followed by the DMA entry to launch the operation. Although at the moment this pattern only strictly appears at one site, two other sites can be factored as well by slightly changing the order in which the DMA operations are performed. This should be harmless as the only thing which matters is to have all the data loaded into SRAM prior to launching the operation. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Multiple locations in the driver test the operation context fragment type, checking whether it is a first fragment or not. Introduce a mv_cesa_mac_op_is_first_frag() helper, which returns true if the fragment operation is for a first fragment. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
mv_cesa_get_op_cfg() does not write to its argument, it only reads. So, let's make it const. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Ensure that the template operation is fully initialised, otherwise we end up loading data from the kernel stack into the engines, which can upset the hash results. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
The endianness of the bit length used in the final stage depends on the endianness of the algorithm - md5 hashes need it to be in little endian format, whereas SHA hashes need it in big endian format. Use the previously added algorithm endianness flag to control this. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Rather than determining whether we're using a MD5 hash by looking at the digest size, switch to a cleaner solution using a per-request flag initialised by the method type. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
Currently, we read/write the state in CPU endian, but on the final request, we convert its endian according to the requested algorithm. (md5 is little endian, SHA are big endian.) Always keep creq->state in CPU native endian format, and perform the necessary conversion when copying the hash to the result. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Russell King 提交于
There's an easier way to get at the hash transform - rather than using crypto_ahash_tfm(ahash), we can get it directly from req->base.tfm. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Tadeusz Struk 提交于
qat_crypto_get_instance_node function needs to handle situation when the first dev in the list is not started. Signed-off-by: NTadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
- 15 10月, 2015 3 次提交
-
-
由 LABBE Corentin 提交于
Some array of const char are not set as const. This patch fix that. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 LABBE Corentin 提交于
Some array of const char are not set as const. This patch fix that. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Christoph Hellwig 提交于
<linux/highmem.h> is the placace the get the kmap type flags, asm-generic files are generic implementations only to be used by architecture code. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
- 14 10月, 2015 3 次提交
-
-
由 LABBE Corentin 提交于
Using the devm_xxx() managed function to stripdown the error and remove code. In the same time, we replace request_mem_region/ioremap by the unified devm_ioremap_resource() function. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 LABBE Corentin 提交于
Using the devm_xxx() managed function to stripdown the error and remove code. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-
由 Arnd Bergmann 提交于
The mxs-dcp driver relies on the stmp_reset_block() helper function, which is provided by CONFIG_STMP_DEVICE. This symbol is always set on MXS, but the driver can now also be built for MXC (i.MX6), which results in a built error if no other driver selects STMP_DEVICE: drivers/built-in.o: In function `mxs_dcp_probe': vf610-ocotp.c:(.text+0x3df302): undefined reference to `stmp_reset_block' This adds the 'select', like all other stmp drivers have it. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Fixes: a2712e6c ("crypto: mxs-dcp - Allow MXS_DCP to be used on MX6SL") Acked-by: NMarek Vasut <marex@denx.de> Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
-