13 Nov, 2016
4 commits
-
By using the unaligned access helpers, we drastically improve
performance on small MIPS routers that have to go through the exception
fix-up handler for these unaligned accesses.Signed-off-by: Jason A. Donenfeld
Reviewed-by: Eric Biggers
Acked-by: Martin Willi
Signed-off-by: Herbert Xu -
Switch to resource-managed function devm_kzalloc instead
of kzalloc and remove unneeded kfreeAlso, remove kfree in probe function and remove
function, mv_remove as it is now has nothing to do.
The Coccinelle semantic patch used to make this change is as follows:
//
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
.probe = probefn,
.remove = removefn,
};@prb@
identifier platform.probefn, pdev;
expression e, e1, e2;
@@
probefn(struct platform_device *pdev, ...) {
dev, e1, e2)
...
?-kfree(e);
...+>
}
@rem depends on prb@
identifier platform.removefn;
expression prb.e;
@@
removefn(...) {}
//Signed-off-by: Nadim Almas
Signed-off-by: Herbert Xu -
Trivial fix to spelling mistake "pointeur" to "pointer"
in dev_err messageSigned-off-by: Colin Ian King
Signed-off-by: Herbert Xu -
The exponent size in the ccp_op structure is in bits. A v5
CCP requires the exponent size to be in bytes, so convert
the size from bits to bytes when populating the descriptor.The current code references the exponent in memory, but
these fields have not been set since the exponent is
actually store in the LSB. Populate the descriptor with
the LSB location (address).Signed-off-by: Gary R Hook
Signed-off-by: Herbert Xu
01 Nov, 2016
9 commits
-
Remove the unused but set variable tfm in cryptd_enqueue_request to fix
the following warning when building with 'W=1':crypto/cryptd.c:125:21: warning: variable 'tfm' set but not used [-Wunused-but-set-variable]
Signed-off-by: Tobias Klauser
Signed-off-by: Herbert Xu -
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level
givcipher interface"), crypto_spawn_skcipher2() and
crypto_spawn_skcipher() are equivalent. So switch callers of
crypto_spawn_skcipher2() to crypto_spawn_skcipher() and remove it.Signed-off-by: Eric Biggers
Signed-off-by: Herbert Xu -
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level
givcipher interface"), crypto_grab_skcipher2() and
crypto_grab_skcipher() are equivalent. So switch callers of
crypto_grab_skcipher2() to crypto_grab_skcipher() and remove it.Signed-off-by: Eric Biggers
Signed-off-by: Herbert Xu -
To fix the over consumption on the VDDCore due to the TRNG enabled,
disable the TRNG during suspend, not only disable the user interface
clock (which is controlled by PMC). Because the user interface clock
is independent from any clock that may be used in the entropy source
logic circuitry.Signed-off-by: Wenyou Yang
Acked-by: Nicolas Ferre
Signed-off-by: Herbert Xu -
Fix dependency between acomp and scomp that appears when acomp is
built as moduleSigned-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Building the caam driver on arm64 produces a harmless warning:
drivers/crypto/caam/caamalg.c:140:139: warning: comparison of distinct pointer types lacks a cast
We can use min_t to tell the compiler which type we want it to use
here.Fixes: 5ecf8ef9103c ("crypto: caam - fix sg dump")
Signed-off-by: Arnd Bergmann
Reviewed-by: Horia Geantă
Signed-off-by: Herbert Xu -
Trivial fix to typo in dev_dbg message
Signed-off-by: Colin Ian King
Signed-off-by: Herbert Xu -
There is no need to have the 'struct atmel_aes_dev *aes_dd' variable
static since new value always be assigned before use it.Signed-off-by: Wei Yongjun
Signed-off-by: Herbert Xu -
The HWRNG core allocates two buffers during initialization which are
used to obtain random data. After that data is processed, it is now
zeroized as it is possible that the HWRNG core will not be asked to
produce more random data for a long time. This prevents leaving such
sensitive data in memory.Signed-off-by: Stephan Mueller
Signed-off-by: Herbert Xu
25 Oct, 2016
19 commits
-
Add tests to the test manager for algorithms exposed through acomp.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add scomp backend for deflate compression algorithm.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add scomp backend for 842 compression algorithm.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add scomp backend for lz4hc compression algorithm.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add scomp backend for lz4 compression algorithm.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add scomp backend for lzo compression algorithm.
Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add a synchronous back-end (scomp) to acomp. This allows to easily
expose the already present compression algorithms in LKCF via acomp.Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
Add acomp, an asynchronous compression api that uses scatterlist
buffers.Signed-off-by: Giovanni Cabiddu
Signed-off-by: Herbert Xu -
The abbreviation for Cryptographic Coprocessor is "CCP".
Signed-off-by: Paul Bolle
Acked-by: Gary R Hook
Signed-off-by: Herbert Xu -
The Amlogic Meson is a DT-only platform, which means the devices are
registered via OF and not using the legacy platform devices support.So there's no need to have a MODULE_ALIAS("platform:meson-rng") since
the reported uevent MODALIAS to user-space will always be the OF one.Signed-off-by: Javier Martinez Canillas
Acked-by: Kevin Hilman
Acked-by: Neil Armstrong
Signed-off-by: Herbert Xu -
Use the new API to create and destroy the crypto engine kthread
worker. The API hides some implementation details.In particular, kthread_create_worker() allocates and initializes
struct kthread_worker. It runs the kthread the right way
and stores task_struct into the worker structure.kthread_destroy_worker() flushes all pending works, stops
the kthread and frees the structure.This patch does not change the existing behavior except for
dynamically allocating struct kthread_worker and storing
only the pointer of this structure.It is compile tested only because I did not find an easy
way how to run the code. Well, it should be pretty safe
given the nature of the change.Signed-off-by: Petr Mladek
Signed-off-by: Herbert Xu -
Fix a few problems revealed by testing: verify consistent
units, especially in public slot allocation. Percolate
some common initialization code up to a common routine.
Add some comments.Signed-off-by: Gary R Hook
Signed-off-by: Herbert Xu -
Clean up patch for an unneeded structure member.
Signed-off-by: Gary R Hook
Signed-off-by: Herbert Xu -
Bit fields are not sensitive to endianness, so use
a transparent standard data typeSigned-off-by: Gary R Hook
Signed-off-by: Herbert Xu -
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/char/hw_random/meson-rng.ko | grep alias
alias: platform:meson-rngAfter this patch:
$ modinfo drivers/char/hw_random/meson-rng.ko | grep alias
alias: platform:meson-rng
alias: of:N*T*Camlogic,meson-rngC*
alias: of:N*T*Camlogic,meson-rngSigned-off-by: Javier Martinez Canillas
Acked-by: Neil Armstrong
Signed-off-by: Herbert Xu -
Fix to return error code -EINVAL from the invalid alg ivsize error
handling case instead of 0, as done elsewhere in this function.Signed-off-by: Wei Yongjun
Signed-off-by: Herbert Xu -
Fixes the following sparse warning:
drivers/crypto/ccp/ccp-dev.c:44:6: warning:
symbol 'ccp_error_codes' was not declared. Should it be static?Signed-off-by: Wei Yongjun
Acked-by: Gary R Hook
Acked-by: Gary R Hook
Signed-off-by: Herbert Xu -
i.MX6UL does only require three clocks to enable CAAM module.
Signed-off-by: Marcus Folkesson
Acked-by: Rob Herring
Reviewed-by: Horia Geantă
Signed-off-by: Herbert Xu -
Remove the unused but set variable pinst in padata_parallel_worker to
fix the following warning when building with 'W=1':kernel/padata.c: In function ‘padata_parallel_worker’:
kernel/padata.c:68:26: warning: variable ‘pinst’ set but not used [-Wunused-but-set-variable]Also remove the now unused variable pd which is only used to set pinst.
Signed-off-by: Tobias Klauser
Acked-by: Steffen Klassert
Signed-off-by: Herbert Xu
21 Oct, 2016
8 commits
-
The lsb field uses a value of -1 to indicate that it
is unassigned. Therefore type must be a signed int.Signed-off-by: Gary R Hook
Signed-off-by: Herbert Xu -
The AES key schedule generation is mostly endian agnostic, with the
exception of the rotation and the incorporation of the round constant
at the start of each round. So implement a big endian specific version
of that part to make the whole routine big endian compatible.Fixes: 86464859cc77 ("crypto: arm - AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
Emit the XTS tweak literal constants in the appropriate order for a
single 128-bit scalar literal load.Fixes: 49788fe2a128 ("arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
The AES implementation using pure NEON instructions relies on the generic
AES key schedule generation routines, which store the round keys as arrays
of 32-bit quantities stored in memory using native endianness. This means
we should refer to these round keys using 4x4 loads rather than 16x1 loads.
In addition, the ShiftRows tables are loading using a single scalar load,
which is also affected by endianness, so emit these tables in the correct
order depending on whether we are building for big endian or not.Fixes: 49788fe2a128 ("arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
The AES-CCM implementation that uses ARMv8 Crypto Extensions instructions
refers to the AES round keys as pairs of 64-bit quantities, which causes
failures when building the code for big endian. In addition, it byte swaps
the input counter unconditionally, while this is only required for little
endian builds. So fix both issues.Fixes: 12ac3efe74f8 ("arm64/crypto: use crypto instructions to generate AES key schedule")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
The SHA256 digest is an array of 8 32-bit quantities, so we should refer
to them as such in order for this code to work correctly when built for
big endian. So replace 16 byte scalar loads and stores with 4x32 vector
ones where appropriate.Fixes: 6ba6c74dfc6b ("arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
The SHA1 digest is an array of 5 32-bit quantities, so we should refer
to them as such in order for this code to work correctly when built for
big endian. So replace 16 byte scalar loads and stores with 4x4 vector
ones where appropriate.Fixes: 2c98833a42cd ("arm64/crypto: SHA-1 using ARMv8 Crypto Extensions")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
The GHASH key and digest are both pairs of 64-bit quantities, but the
GHASH code does not always refer to them as such, causing failures when
built for big endian. So replace the 16x1 loads and stores with 2x8 ones.Fixes: b913a6404ce2 ("arm64/crypto: improve performance of GHASH algorithm")
Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu