[PATCH 5/6] crypto: ccp - Enable support for AES GCM on v5 CCPs

2016-10-13 Thread Gary R Hook
A version 5 device provides the primitive commands required for AES GCM. This patch adds support for en/decryption. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile|1 drivers/crypto/ccp/ccp-crypto-aes-galois.c | 252 +++ drivers/crypto

[PATCH 2/6] crypto: ccp - Remove unneeded sign-extension support

2016-10-13 Thread Gary R Hook
The reverse-get/set functions can be simplified by eliminating unused code. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-ops.c | 145 +- 1 file changed, 59 insertions(+), 86 deletions(-) diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers

[PATCH 3/6] crypto: ccp - Add support for RSA on the CCP

2016-10-13 Thread Gary R Hook
Wire up the v3 CCP as a cipher provider. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-main.c | 15 ++ drivers/crypto/ccp/ccp-crypto-rsa.c | 258 ++ drivers/crypto/ccp/ccp-crypto.h | 24

[PATCH 6/6] crypto: ccp - Enable 3DES function on v5 CCPs

2016-10-13 Thread Gary R Hook
Wire up support for Triple DES in ECB mode. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-des3.c | 254 ++ drivers/crypto/ccp/ccp-crypto-main.c | 10 + drivers/crypto/ccp/ccp-crypto.h | 25

Re: [PATCH 3/6] crypto: ccp - Add support for RSA on the CCP

2016-10-13 Thread Gary R Hook
On 10/13/2016 01:25 PM, Stephan Mueller wrote: Am Donnerstag, 13. Oktober 2016, 09:53:09 CEST schrieb Gary R Hook: Hi Gary, Wire up the v3 CCP as a cipher provider. Signed-off-by: Gary R Hook --- ...snip... +} + +static void ccp_free_mpi_key(struct ccp_rsa_key *key) +{ + mpi_free

[PATCH] crypto: Move RSA+MPI constructs into an #include file

2016-10-14 Thread Gary R Hook
Move RSA support of general use into internal/rsa.h. This allows reuse of, e.g. RSA MPI keys and support functions. Signed-off-by: Gary R Hook --- crypto/rsa.c | 16 include/crypto/internal/rsa.h | 17 + 2 files changed, 17 insertions(+), 16

Re: [PATCH -next] crypto: ccp - Fix non static symbol warning

2016-10-18 Thread Gary R Hook
On 10/17/2016 10:08 AM, Wei Yongjun wrote: From: Wei Yongjun 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 Excellent. Thank you. Acked-by: Gary R Hook

[PATCH] crypto: ccp - change bitfield type to unsigned ints

2016-10-18 Thread Gary R Hook
Bit fields are not sensitive to endianness, so use a transparent standard data type Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev.h b

[PATCH] crypto: ccp - remove unneeded code

2016-10-18 Thread Gary R Hook
Clean up patch for an unneeded structure member. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h index 0d996fe..b96d788 100644 --- a/drivers/crypto/ccp/ccp-dev.h +++ b

[PATCH] crypto: ccp - Clean up the LSB slot allocation code

2016-10-18 Thread Gary R Hook
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 --- drivers/crypto/ccp/ccp-dev-v3.c |4 drivers/crypto/ccp/ccp-dev-v5.c

Re: [PATCH][TRIVIAL] crypto: ccp - fix typo "CPP"

2016-10-20 Thread Gary R Hook
On 10/20/2016 02:20 PM, Paul Bolle wrote: The abbreviation for Cryptographic Coprocessor is "CCP". Signed-off-by: Paul Bolle Acked-by: Gary R Hook --- include/linux/ccp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/ccp.h b/include/l

[PATCH] crypto: ccp - Fix handling of RSA exponent on a v5 device

2016-11-01 Thread Gary R Hook
store in the LSB. Populate the descriptor with the LSB location (address). Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index ff7816a

[PATCH] crypto: ccp - Update the command queue on errors

2016-11-02 Thread Gary R Hook
Move the command queue tail pointer when an error is detected. Always return the error. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c

[PATCH V2 0/9] Enable hashing and ciphers for v5 CCP

2016-11-04 Thread Gary R Hook
The following series implements new function for a version 5 CCP: Support for SHA-2, wiring of RSA using the updated framework, additional RSA features for new devices, AES GCM mode, and Triple-DES in ECB and CBC mode. --- Gary R Hook (9): crypto: ccp - Fix handling of RSA exponent on a v5

[PATCH V2 1/9] crypto: ccp - Fix handling of RSA exponent on a v5 device

2016-11-04 Thread Gary R Hook
store in the LSB. Populate the descriptor with the LSB location (address). Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index ff7816a

[PATCH V2 2/9] crypto: ccp - Update the command queue on errors

2016-11-04 Thread Gary R Hook
Move the command queue tail pointer when an error is detected. Always return the error. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c

[PATCH V2 3/9] crypto: ccp - Simplify some buffer management routines

2016-11-04 Thread Gary R Hook
The reverse-get/set functions can be simplified by eliminating unused code. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-ops.c | 142 +- 1 file changed, 56 insertions(+), 86 deletions(-) diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers

[PATCH V2 4/9] crypto: ccp - Add SHA-2 support

2016-11-04 Thread Gary R Hook
Incorporate 384-bit and 512-bit hashing for a version 5 CCP device Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-sha.c | 22 +++ drivers/crypto/ccp/ccp-crypto.h |8 ++-- drivers/crypto/ccp/ccp-ops.c| 72 +++ include

[PATCH V2 6/9] crypto: ccp - Add support for RSA on the CCP

2016-11-04 Thread Gary R Hook
Wire up the CCP as an RSA cipher provider. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-main.c | 19 ++ drivers/crypto/ccp/ccp-crypto-rsa.c | 294 ++ drivers/crypto/ccp/ccp-crypto.h | 32

[PATCH V2 5/9] crypto: Move RSA+MPI constructs into an #include file

2016-11-04 Thread Gary R Hook
RSA support of general use, but dependent upon MPI, should go into internal/rsa.h Signed-off-by: Gary R Hook --- crypto/rsa.c | 16 include/crypto/internal/rsa.h | 17 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/crypto

[PATCH V2 7/9] crypto: ccp - Enhance RSA support for a v5 CCP

2016-11-04 Thread Gary R Hook
Take advantage of the increased RSA key size support in the v5 CCP. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-rsa.c |5 ++ drivers/crypto/ccp/ccp-crypto.h |1 drivers/crypto/ccp/ccp-dev-v3.c |1 drivers/crypto/ccp/ccp-dev-v5.c | 10 +++-- drivers

[PATCH V2 8/9] crypto: ccp - Enable support for AES GCM on v5 CCPs

2016-11-04 Thread Gary R Hook
A version 5 device provides the primitive commands required for AES GCM. This patch adds support for en/decryption. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile|1 drivers/crypto/ccp/ccp-crypto-aes-galois.c | 257 drivers/crypto

[PATCH V2 9/9] crypto: ccp - Enable 3DES function on v5 CCPs

2016-11-04 Thread Gary R Hook
Wire up support for Triple DES in ECB mode. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-des3.c | 254 ++ drivers/crypto/ccp/ccp-crypto-main.c | 10 + drivers/crypto/ccp/ccp-crypto.h | 20

[PATCH 0/4] crypto: ccp - CCP driver updates 2016-03-01

2016-03-01 Thread Gary R Hook
ons through a struct of function pointers This patch series is based on cryptodev-2.6 --- Gary R Hook (4): crypto: ccp - Remove check for x86 family and model crypto: ccp - Support for multiple CCPs crypto: ccp - CCP versioning support crypto: ccp - Add abstraction for dev

[PATCH 1/4] crypto: ccp - Remove check for x86 family and model

2016-03-01 Thread Gary R Hook
Each x86 SoC will make use of a unique PCI ID for the CCP device so it is not necessary to check for the CPU family and model. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.c | 47 ++ 1 file changed, 11 insertions(+), 36 deletions(-) diff

[PATCH 4/4] crypto: ccp - Add abstraction for device-specific calls

2016-03-01 Thread Gary R Hook
-by: Gary R Hook --- drivers/crypto/ccp/Makefile |2 drivers/crypto/ccp/ccp-dev-v3.c | 534 + drivers/crypto/ccp/ccp-dev.c | 306 + drivers/crypto/ccp/ccp-dev.h | 138 +- drivers/crypto/ccp/ccp-ops.c

[PATCH 3/4] crypto: ccp - CCP versioning support

2016-03-01 Thread Gary R Hook
manages the version-specific data. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes.c | 12 ++- drivers/crypto/ccp/ccp-crypto-sha.c |9 +++- drivers/crypto/ccp/ccp-dev.c| 27 drivers/crypto/ccp/ccp-dev.h|8

[PATCH 2/4] crypto: ccp - Support for multiple CCPs

2016-03-01 Thread Gary R Hook
Enable management of >1 CCPs in a system. Each device will get a unique identifier, as well as uniquely named resources. Treat each CCP as an orthogonal unit and register resources individually. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.c |

[PATCH] crypto: ccp - Use different flag vars for nested locks

2016-03-11 Thread Gary R Hook
This patch fixes a coccinelle warning about reusing a flags variable in nested lock acquisition. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c

[PATCH V3 1/2] crypto: ccp - Use only the relevant interrupt bits

2017-04-20 Thread Gary R Hook
Each CCP queue can product interrupts for 4 conditions: operation complete, queue empty, error, and queue stopped. This driver only works with completion and error events. Cc: # 4.9.x- Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |9 + drivers/crypto/ccp/ccp

[PATCH V3 0/2] Interrupt management fixes

2017-04-20 Thread Gary R Hook
Correct the driver to attend to only relevant interrupt bits, and ensure that interrupts are managed properly at module unload. Changes from V2: - Apply patches to relevant stable branches Changes from V1: - Changed the #define to "SUPPORTED_INTERRUPTS" --- Gary R Hook (2): c

[PATCH V3 1/2] crypto: ccp - Use only the relevant interrupt bits

2017-04-20 Thread Gary R Hook
Each CCP queue can product interrupts for 4 conditions: operation complete, queue empty, error, and queue stopped. This driver only works with completion and error events. Cc: # 4.9.x+ Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |9 + drivers/crypto/ccp/ccp

[PATCH V3 2/2] crypto: ccp - Disable interrupts early on unload

2017-04-20 Thread Gary R Hook
From: Gary R Hook Ensure that we disable interrupts first when shutting down the driver. Cc: # 4.9.x+ Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto

Re: [PATCH V3 1/2] crypto: ccp - Use only the relevant interrupt bits

2017-04-20 Thread Gary R Hook
proper pair, with cover letter, is right behind this one. Not that there's anything wrong with this one, only that it went out without a cover letter. ...and now I see that there's a typo. Dang it. Cc: # 4.9.x- Signed-off-by: Gary R Hook ---

[PATCH 2/2] crypto: ccp - Change ISR handler method for a v5 CCP

2017-04-21 Thread Gary R Hook
event being 'lost' and the queue hanging, waiting to be serviced. Since the status bits are never fully de-asserted, the CCP never generates another interrupt (all bits zero -> one or more bits one), and no further CCP operations will be executed. Cc: # 4.9.x+ Signed-off-by

[PATCH 0/2] Change CCP ISR handler model

2017-04-21 Thread Gary R Hook
serializing state changes, handles processing of the interrupts, and avoids the loss of task completion status. --- Gary R Hook (2): crypto: ccp - Change ISR handler method for a v3 CCP crypto: ccp - Change ISR handler method for a v5 CCP drivers/crypto/ccp/ccp-dev-v3.c | 120

[PATCH 1/2] crypto: ccp - Change ISR handler method for a v3 CCP

2017-04-21 Thread Gary R Hook
event being 'lost' and the queue hanging, waiting to be serviced. Since the status bits are never fully de-asserted, the CCP never generates another interrupt (all bits zero -> one or more bits one), and no further CCP operations will be executed. Cc: # 4.9.x+ Signed-off-by

[PATCH] crypto: ccp - Add a module author

2017-04-25 Thread Gary R Hook
CC: # 4.9.x+ Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index 92d1c6959f08..b7504562715c 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp

[PATCH] crypto: ccp - Add debugfs entries for CCP information

2017-04-26 Thread Gary R Hook
b/drivers/crypto/ccp/ccp-debugfs.c new file mode 100644 index ..6d86693b117f --- /dev/null +++ b/drivers/crypto/ccp/ccp-debugfs.c @@ -0,0 +1,345 @@ +/* + * AMD Cryptographic Coprocessor (CCP) driver + * + * Copyright (C) 2017 Advanced Micro Devices, Inc. + * + * Author: Gary R Hook +

[PATCH V2] crypto: ccp - Add debugfs entries for CCP information

2017-05-02 Thread Gary R Hook
es from V1: - Correct polarity of test when destroying devices at module unload Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |3 drivers/crypto/ccp/ccp-debugfs.c | 345 ++ drivers/crypto/ccp/ccp-dev-v5.c | 28 +++ drivers/crypto/ccp

Re: [PATCH v2 9/9] crypto: ccp - Use IPAD/OPAD constant

2017-05-19 Thread Gary R Hook
On 5/19/2017 1:53 AM, Corentin Labbe wrote: This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe Acked-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-sha.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH] crypto: ccp - Release locks before returning

2017-06-19 Thread Gary R Hook
krobot warning: make sure that all error return paths release locks. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/ccp-debugfs.c b/drivers/crypto/ccp/ccp-debugfs.c index

[PATCH] crypto: ccp - Provide a roll-back method for debugfs setup

2017-06-21 Thread Gary R Hook
Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/ccp-debugfs.c b/drivers/crypto/ccp/ccp-debugfs.c index 3cd6c83754e0..99aba1622613 100644 --- a/drivers/crypto/ccp/ccp

[PATCH 0/4] Enable full RSA support on CCPs

2017-06-21 Thread Gary R Hook
The following series enables RSA operations on version 5 devices, adds a set-reqsize function (to provide uniformity with other cipher APIs), implements akcipher enablement in the crypto layer, and makes a tweak for expanded v5 device capabilities. --- Gary R Hook (4): crypto: ccp - Fix

[PATCH 1/4] crypto: ccp - Fix base RSA function for version 5 CCPs

2017-06-21 Thread Gary R Hook
Version 5 devices have requirements for buffer lengths, as well as parameter format (e.g. bits vs. bytes). Fix the base CCP driver code to meet requirements all supported versions. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 10 ++-- drivers/crypto/ccp/ccp-ops.c| 95

[PATCH 2/4] crypto: Add akcipher_set_reqsize() function

2017-06-21 Thread Gary R Hook
Signed-off-by: Gary R Hook --- include/crypto/internal/akcipher.h |6 ++ 1 file changed, 6 insertions(+) diff --git a/include/crypto/internal/akcipher.h b/include/crypto/internal/akcipher.h index 479a0078f0f7..805686ba2be4 100644 --- a/include/crypto/internal/akcipher.h +++ b/include

[PATCH 3/4] crypto: ccp - Add support for RSA on the CCP

2017-06-21 Thread Gary R Hook
Wire up the v3 CCP as a cipher provider. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-main.c | 21 ++ drivers/crypto/ccp/ccp-crypto-rsa.c | 286 ++ drivers/crypto/ccp/ccp-crypto.h | 31

[PATCH 4/4] crypto: ccp - Expand RSA support for a v5 ccp

2017-06-21 Thread Gary R Hook
A V5 device can accommodate larger keys, as well as read the keys directly from memory instead of requiring them to be in a local storage block. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-rsa.c |5 - drivers/crypto/ccp/ccp-crypto.h |1 + drivers/crypto/ccp/ccp

Re: [PATCH 3/4] crypto: ccp - Add support for RSA on the CCP

2017-06-22 Thread Gary R Hook
On 06/22/2017 12:15 AM, Stephan Müller wrote: Am Donnerstag, 22. Juni 2017, 00:48:01 CEST schrieb Gary R Hook: Hi Gary, Thanks, Stephen. Good catch(es). I will re-work this, but it looks like my changes should wait until after the patch set posted by Brijesh (Introduce AMD Secure Processor

[PATCH 2] crypto: ccp - Provide a roll-back method for debugfs setup

2017-06-27 Thread Gary R Hook
Changes since v1: - Remove unneeded local variable Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/ccp-debugfs.c b/drivers/crypto/ccp/ccp-debugfs.c index 3cd6c83754e0

[PATCH] crypto: ccp - Fix some line spacing

2017-06-27 Thread Gary R Hook
Add/remove blank lines as appropriate. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.c |1 + include/linux/ccp.h |1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index 2506b5025700

[PATCH] crypto: ccp - Change all references to use the JOB ID macro

2017-06-27 Thread Gary R Hook
Use the CCP_NEW_JOBID() macro when assigning an identifier Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-ops.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index c0dfdacbdff5..78f29d459df8 100644

Re: [PATCH 2] crypto: ccp - Provide a roll-back method for debugfs setup

2017-06-27 Thread Gary R Hook
On 06/27/2017 08:57 AM, Hook, Gary wrote: Changes since v1: - Remove unneeded local variable My apologies for this patch... Pretty sure that the first version won't pass review anyway because of this. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c |

[PATCH v3] crypto: ccp - Provide an error path for debugfs setup failure

2017-06-28 Thread Gary R Hook
Changes since v2: - On failure remove only the DebugFS heirarchy for this device Changes since v1: - Remove unneeded local variable Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-debugfs.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers

Re: [PATCH] crypto: ccp-platform: print error message on platform_get_irq failure

2017-06-30 Thread Gary R Hook
On 06/30/2017 12:59 AM, Gustavo A. R. Silva wrote: Print error message on platform_get_irq failure before return. Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/ccp/ccp-platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-platform.c b/

Re: [PATCH v3 RESEND 1/5] crypto: ccp - Use devres interface to allocate PCI/iomap and cleanup

2017-07-03 Thread Gary R Hook
On 06/29/2017 11:54 AM, Singh, Brijesh wrote: Update pci and platform files to use devres interface to allocate the PCI and iomap resources. Also add helper functions to consolicate module init, exit and power mangagement code duplication. Signed-off-by: Brijesh Singh Acked-by: Gary R Hook

Re: [PATCH v3 RESEND 2/5] crypto: ccp - Introduce the AMD Secure Processor device

2017-07-03 Thread Gary R Hook
: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/Kconfig| 6 +- drivers/crypto/ccp/Kconfig| 21 +++-- drivers/crypto/ccp/Makefile | 4 +- drivers/crypto/ccp/ccp-dev-v3.c | 4 +- drivers/crypto/ccp/ccp-dev-v5.c | 5 +- drivers/crypto/ccp/ccp-dev.c

Re: [PATCH v3 RESEND 3/5] crypto: cpp - Abstract interrupt registeration

2017-07-03 Thread Gary R Hook
invoked upon interrupt. Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 6 +-- drivers/crypto/ccp/ccp-dev-v5.c | 7 ++- drivers/crypto/ccp/ccp-dev.c | 3 +- drivers/crypto/ccp/ccp-dev.h | 2 - drivers/crypto/ccp/ccp-pci.c | 103

Re: [PATCH v3 RESEND 4/5] crypto: ccp - rename ccp driver initialize files as sp device

2017-07-03 Thread Gary R Hook
other than renaming file and structures Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/Makefile| 4 +- drivers/crypto/ccp/ccp-dev.h | 6 -- drivers/crypto/ccp/sp-dev.c| 12 ++-- drivers/cryp

Re: [PATCH v3 RESEND 5/5] crypto: ccp - remove ccp_present() check from device initialize

2017-07-03 Thread Gary R Hook
On 06/29/2017 11:54 AM, Singh, Brijesh wrote: Since SP device driver supports multiples devices (e.g CCP, PSP), we should not fail the driver init just because CCP device is not found. Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/sp-dev.c | 12 1

[PATCH] crypto: ccp - Update copyright dates for 2017.

2017-07-17 Thread Gary R Hook
Some updates this year have not had copyright dates changed in modified files. Correct this for 2017. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-galois.c |2 +- drivers/crypto/ccp/ccp-crypto-des3.c |2 +- drivers/crypto/ccp/ccp-crypto-main.c |2

[PATCH] crypto: ccp - Fix XTS-AES support on a version 5 CCP

2017-07-17 Thread Gary R Hook
Version 5 CCPs have differing requirements for XTS-AES: key components are stored in a 512-bit vector. The context must be little-endian justified. AES-256 is supported now, so propagate the cipher size to the command descriptor. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes

[PATCH 0/4] Enable RSA Support on the CCP

2017-07-17 Thread Gary R Hook
This series accomplishes the following: - Fix RSA support in the base CCP driver - Add the akcipher_set_reqsize() function - Enable RSA support in the crypto layer - Allow for a larger RSA modulus in a version 5 CCP --- Gary R Hook (4): crypto: ccp - Fix base RSA function for version

[PATCH 1/4] crypto: ccp - Fix base RSA function for version 5 CCPs

2017-07-17 Thread Gary R Hook
Version 5 devices have requirements for buffer lengths, as well as parameter format (e.g. bits vs. bytes). Fix the base CCP driver code to meet requirements all supported versions. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 10 +++-- drivers/crypto/ccp/ccp-ops.c

[PATCH 2/4] crypto: Add akcipher_set_reqsize() function

2017-07-17 Thread Gary R Hook
Signed-off-by: Gary R Hook --- 0 files changed diff --git a/include/crypto/internal/akcipher.h b/include/crypto/internal/akcipher.h index 479a0078f0f7..805686ba2be4 100644 --- a/include/crypto/internal/akcipher.h +++ b/include/crypto/internal/akcipher.h @@ -38,6 +38,12 @@ static inline void

[PATCH 4/4] csrypto: ccp - Expand RSA support for a v5 ccp

2017-07-17 Thread Gary R Hook
A version 5 CCP can handle an RSA modulus up to 16k bits. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-rsa.c |5 - drivers/crypto/ccp/ccp-crypto.h |1 + drivers/crypto/ccp/ccp-dev-v3.c |1 + drivers/crypto/ccp/ccp-dev-v5.c |2 ++ drivers/crypto

[PATCH 3/4] crypto: ccp - Add support for RSA on the CCP

2017-07-17 Thread Gary R Hook
Wire up the CCP as an RSA cipher provider. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-main.c | 19 ++ drivers/crypto/ccp/ccp-crypto-rsa.c | 296 ++ drivers/crypto/ccp/ccp-crypto.h | 31

Re: [PATCH] crypto: ccp - Fix XTS-AES support on a version 5 CCP

2017-07-18 Thread Gary R Hook
On 07/18/2017 01:28 AM, Stephan Müller wrote: Am Montag, 17. Juli 2017, 22:08:27 CEST schrieb Gary R Hook: Hi Gary, Version 5 CCPs have differing requirements for XTS-AES: key components are stored in a 512-bit vector. The context must be little-endian justified. AES-256 is supported now, so

Re: Poor RNG performance on Ryzen

2017-07-21 Thread Gary R Hook
On 07/21/2017 09:47 AM, Theodore Ts'o wrote: On Fri, Jul 21, 2017 at 01:39:13PM +0200, Oliver Mangold wrote: Better, but obviously there is still much room for improvement by reducing the number of calls to RDRAND. Hmm, is there some way we can easily tell we are running on Ryzen? Or do we be

Re: [PATCH] crypto: ccp - Fix XTS-AES support on a version 5 CCP

2017-07-21 Thread Gary R Hook
On 07/17/2017 04:48 PM, Lendacky, Thomas wrote: On 7/17/2017 3:08 PM, Gary R Hook wrote: Version 5 CCPs have differing requirements for XTS-AES: key components are stored in a 512-bit vector. The context must be little-endian justified. AES-256 is supported now, so propagate the cipher size to

[PATCH v2 2/4] crypto: ccp - Enable XTS-AES-128 support on all CCPs

2017-07-21 Thread Gary R Hook
Version 5 CCPs have some new requirements for XTS-AES: the type field must be specified, and the key requires 512 bits, with each part occupying 256 bits and padded with zeroes. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |2 ++ drivers/crypto/ccp/ccp-dev.h|2

[PATCH v2 1/4] crypto: ccp - Add a call to xts_check_key()

2017-07-21 Thread Gary R Hook
Vet the key using the available standard function Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c |9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index

[PATCH v2 3/4] crypto: ccp - Rework the unit-size check for XTS-AES

2017-07-21 Thread Gary R Hook
The CCP supports a limited set of unit-size values. Change the check for this parameter such that acceptable values match the enumeration. Then clarify the conditions under which we must use the fallback implementation. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c

[PATCH v2 4/4] crypto: ccp - Add XTS-AES-256 support for CCP version 5

2017-07-21 Thread Gary R Hook
Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 16 +--- drivers/crypto/ccp/ccp-crypto.h |2 +- drivers/crypto/ccp/ccp-ops.c|3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/ccp-crypto-aes

[PATCH v2 0/4] Update support for XTS-AES on AMD CCPs

2017-07-21 Thread Gary R Hook
xts_check_key() in the crypto layer --- Gary R Hook (4): crypto: ccp - Add a call to xts_check_key() crypto: ccp - Enable XTS-AES-128 support on all CCPs crypto: ccp - Rework the unit-size check for XTS-AES crypto: ccp - Add XTS-AES-256 support for CCP version 5 drivers/crypto

[PATCH] crypto: ccp - Fix XTS-AES-128 support on v5 CCPs

2017-07-25 Thread Gary R Hook
Version 5 CCPs have some new requirements for XTS-AES: the type field must be specified, and the key requires 512 bits, with each part occupying 256 bits and padded with zeroes. cc: # 4.9.x+ Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c |4 ++- drivers/crypto/ccp

[PATCH v3 3/3] crypto: ccp - Add XTS-AES-256 support for CCP version 5

2017-07-25 Thread Gary R Hook
Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 26 ++ drivers/crypto/ccp/ccp-crypto.h |2 +- drivers/crypto/ccp/ccp-ops.c|2 ++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ccp/ccp

[PATCH v3 2/3] crypto: ccp - Rework the unit-size check for XTS-AES

2017-07-25 Thread Gary R Hook
The CCP supports a limited set of unit-size values. Change the check for this parameter such that acceptable values match the enumeration. Then clarify the conditions under which we must use the fallback implementation. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c

[PATCH v3 1/3] crypto: ccp - Add a call to xts_check_key()

2017-07-25 Thread Gary R Hook
Vet the key using the available standard function Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-aes-xts.c |9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-crypto-aes-xts.c b/drivers/crypto/ccp/ccp-crypto-aes-xts.c index

[PATCH v3 0/3] Update support for XTS-AES on AMD CCPs

2017-07-25 Thread Gary R Hook
- Remove unnecessary variable - Delay a change (that belongs in the CCP v5 patch) Changes since v1: - rework the validation of the unit-size; move to a separate patch - expand the key buffer to accommodate 256-bit keys - use xts_check_key() in the crypto layer --- Gary R Hook (3): crypto

Re: [PATCH v3 0/3] Update support for XTS-AES on AMD CCPs

2017-07-25 Thread Gary R Hook
- Edit comments - Remove unnecessary variable - Delay a change (that belongs in the CCP v5 patch) Changes since v1: - rework the validation of the unit-size; move to a separate patch - expand the key buffer to accommodate 256-bit keys - use xts_check_key() in the crypto layer ---

Re: [PATCH] crypto: ccp - avoid uninitialized variable warning

2017-08-01 Thread Gary R Hook
On 07/31/2017 03:49 PM, Arnd Bergmann wrote: The added support for version 5 CCPs introduced a false-positive warning in the RSA implementation: drivers/crypto/ccp/ccp-ops.c: In function 'ccp_run_rsa_cmd': drivers/crypto/ccp/ccp-ops.c:1856:3: error: 'sb_count' may be used uninitialized in this

Re: [PATCH] crypto: ccp - select CONFIG_CRYPTO_RSA

2017-08-01 Thread Gary R Hook
select CRYPTO_RSA help Support for using the cryptographic API with the AMD Cryptographic Coprocessor. This module supports offload of SHA and AES algorithms. Reviewed by: Gary R Hook

Re: [PATCH] crypto: ccp - avoid uninitialized variable warning

2017-08-01 Thread Gary R Hook
On 08/01/2017 03:35 PM, Arnd Bergmann wrote: On Tue, Aug 1, 2017 at 4:52 PM, Gary R Hook wrote: On 07/31/2017 03:49 PM, Arnd Bergmann wrote: The added support for version 5 CCPs introduced a false-positive warning in the RSA implementation: drivers/crypto/ccp/ccp-ops.c: In function

Re: [PATCH] crypto: ccp - avoid uninitialized variable warning

2017-08-01 Thread Gary R Hook
, 0)) + if (sb_count) cmd_q->ccp->vdata->perform->sbfree(cmd_q, op.sb_key, sb_count); return ret; Reviewed-by: Gary R Hook

Re: [PATCH v4 02/19] crypto: ccm: use -EAGAIN for transient busy indication

2017-08-08 Thread Gary R Hook
On 08/08/2017 07:03 AM, Gilad Ben-Yossef wrote: Replace -EBUSY with -EAGAIN when reporting transient busy indication in the absence of backlog. Signed-off-by: Gilad Ben-Yossef Could we use "ccp" in the subject line, please? --- drivers/crypto/ccp/ccp-crypto-main.c | 8 +++- drivers/cry

Re: crypto: ccp: use dma_mapping_error to check map error

2017-08-08 Thread Gary R Hook
On 08/08/2017 08:42 AM, Pan Bian wrote: The return value of dma_map_single() should be checked by dma_mapping_error(). However, in function ccp_init_dm_workarea(), its return value is checked against NULL, which could result in failures. Signed-off-by: Pan Bian Acked-by: Gary R Hook

Re: [PATCH v5 02/19] crypto: ccp: use -EAGAIN for transient busy indication

2017-08-14 Thread Gary R Hook
On 08/14/2017 10:21 AM, Gilad Ben-Yossef wrote: Replace -EBUSY with -EAGAIN when reporting transient busy indication in the absence of backlog. Signed-off-by: Gilad Ben-Yossef Reviewed-by: Gary R Hook --- drivers/crypto/ccp/ccp-crypto-main.c | 8 +++- drivers/crypto/ccp/ccp-dev.c

Re: [PATCH] crypto: ccp - Fix XTS-AES support on a version 5 CCP

2017-08-18 Thread Gary R Hook
On 07/17/2017 04:48 PM, Lendacky, Thomas wrote: On 7/17/2017 3:08 PM, Gary R Hook wrote: Version 5 CCPs have differing requirements for XTS-AES: key components are stored in a 512-bit vector. The context must be little-endian justified. AES-256 is supported now, so propagate the cipher size to

Re: [PATCH] crypto: ccp - Fix XTS-AES-128 support on v5 CCPs

2017-08-18 Thread Gary R Hook
On Tue, Jul 25, 2017 at 02:12:11PM -0500, Gary R Hook wrote: > Version 5 CCPs have some new requirements for XTS-AES: the type field > must be specified, and the key requires 512 bits, with each part > occupying 256 bits and padded with zeroes. > > cc: # 4.9.x+ > > Signe

Re: [PATCH] crypto: ccp - Fix XTS-AES support on a version 5 CCP

2017-08-18 Thread Gary R Hook
On 08/18/2017 11:19 AM, Gary R Hook wrote: On 07/17/2017 04:48 PM, Lendacky, Thomas wrote: On 7/17/2017 3:08 PM, Gary R Hook wrote: Version 5 CCPs have differing requirements for XTS-AES: key components are stored in a 512-bit vector. The context must be little-endian justified. AES-256 is

Re: [PATCH] crypto: ccp - Fix XTS-AES-128 support on v5 CCPs

2017-08-22 Thread Gary R Hook
On 08/18/2017 11:02 PM, Herbert Xu wrote: On Fri, Aug 18, 2017 at 11:41:04AM -0500, Gary R Hook wrote: On Tue, Jul 25, 2017 at 02:12:11PM -0500, Gary R Hook wrote: Version 5 CCPs have some new requirements for XTS-AES: the type field must be specified, and the key requires 512 bits, with each

[PATCH] crypto: ccp - unmap pages and remove unmap objects in callback

2017-09-05 Thread Gary R Hook
From: amd Clean up the mapped pages and the unmap object once we are done with it. This enables the final clean-up of the object once the transfer is complete. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dmaengine.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers

[PATCH] crypto:ccp - invoke the DMA callback in a standard way

2017-09-05 Thread Gary R Hook
From: amd Use the provided mechanism in dmaengine.h to invoke the completion callback. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dmaengine.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-06 Thread Gary R Hook
On 09/06/2017 03:46 PM, Borislav Petkov wrote: On Wed, Sep 06, 2017 at 03:38:38PM -0500, Brijesh Singh wrote: This bit of my struggle -- tip/master is not in sync with cryptodev-2.6 [1]. Aaha. In order to expand the CCP driver we need the following commits from the cryptodev-2.6 57de3aefb73

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-07 Thread Gary R Hook
On 09/07/2017 05:19 PM, Brijesh Singh wrote: Hi Boris, On 09/07/2017 09:27 AM, Borislav Petkov wrote: ... The commit message above reads better to me as the help text than what you have here. Also, in order to make it easier for the user, I think we'll need a CONFIG_AMD_MEM_ENCRYPT_SEV or s

Re: [PATCH 6/7] crypto: ccp: no need to check return value of debugfs_create functions

2019-01-22 Thread Gary R Hook
en of a mind to kick out and not try to do any further work. But debugfs is to be treated as an exception to that paradigm? Carry on, ignore errors, don't worry about it? That said, Acked-by: Gary R Hook > > Cc: Tom Lendacky > Cc: Gary Hook > Cc: Herbert Xu > Cc: &quo

Re: [PATCH -next] crypto: ccp - Use kmemdup in ccp_copy_and_save_keypart()

2019-04-01 Thread Gary R Hook
On 3/29/19 8:43 PM, YueHaibing wrote: > Use kmemdup rather than duplicating its implementation > > Signed-off-by: YueHaibing Acked-by: Gary R Hook > --- > drivers/crypto/ccp/ccp-crypto-rsa.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git

Re: [patch] crypto: ccp - Free ccp if initialization fails

2019-06-24 Thread Gary R Hook
On 6/24/19 8:04 AM, Lendacky, Thomas wrote: > On 6/23/19 2:18 PM, David Rientjes wrote: >> If ccp_dev_init() fails, kfree() the allocated ccp since it will otherwise >> be leaked. > > Not needed. It's allocated with devm_kzalloc(), so it won't be leaked. > >

Re: [PATCH 0/3] Clean up crypto documentation

2019-06-24 Thread Gary R Hook
On 6/24/19 2:30 PM, Joe Perches wrote: > On Mon, 2019-06-24 at 19:07 +, Hook, Gary wrote: >> Tidy up the crypto documentation by filling in some variable >> descriptions, make some grammatical corrections, and enhance >> formatting. > > While this seems generally OK, please try not to make the

<    1   2   3   >