Re: [Part2 PATCH v6 14/38] crypto: ccp: Implement SEV_FACTORY_RESET ioctl command

2017-10-24 Thread Gary R Hook
y Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Improvements-by: Borislav Petkov Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 28 +++- 1 file changed, 27

Re: [Part2 PATCH v6.1 18/38] crypto: ccp: Implement SEV_PEK_CSR ioctl command

2017-10-24 Thread Gary R Hook
Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Brijesh Singh --- Acked-by: Gary R Hook Changes since v6: * when sev_do_cmd() and sev_platform_shutdown() fails then propogate the error status code from sev_do_cmd() because i

Re: [Part2 PATCH v6.1 20/38] crypto: ccp: Implement SEV_PDH_CERT_EXPORT ioctl command

2017-10-24 Thread Gary R Hook
ndacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- Changes since v6: * when sev_do_cmd() and sev_platform_shutdown() fails then propogate the error status code from sev_do_cmd() beca

Re: [Part2 PATCH v6.1 19/38] crypto: ccp: Implement SEV_PEK_CERT_IMPORT ioctl command

2017-10-24 Thread Gary R Hook
Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- Changes since v6: * when sev_do_cmd() and sev_platform_shutdown() fails then propogate the error status code from sev_do_cmd() because it c

Re: [Part2 PATCH v6.1 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-24 Thread Gary R Hook
Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- Changes since v6: * when sev_do_cmd() and sev_platform_shutdown() fails then propogate the error status code from sev_do_cmd() because it c

Re: [Part2 PATCH v6 15/38] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-24 Thread Gary R Hook
y Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Improvements-by: Borislav Petkov Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 24 1 file changed, 24

Re: [Part2 PATCH v8 12/38] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-11-07 Thread Gary R Hook
rčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Improvements-by: Borislav Petkov Signed-off-by: Brijesh Singh Reviewed-by: Borislav Petkov Acked-by: Gary R Hook --- dri

Re: [Part2 PATCH v8 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-11-07 Thread Gary R Hook
vger.kernel.org Cc: linux-ker...@vger.kernel.org Improvements-by: Borislav Petkov Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 344 +++ drivers/crypto/ccp/psp-dev.h | 24 +++ drivers/crypto/ccp/sp-dev.c |

Re: [Part2 PATCH v8 14/38] crypto: ccp: Implement SEV_FACTORY_RESET ioctl command

2017-11-07 Thread Gary R Hook
y Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Improvements-by: Borislav Petkov Signed-off-by: Brijesh Singh Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 77 +++- 1 fi

[PATCH] hwrng: Clean up RNG list when last hwrng is unregisterd

2017-12-12 Thread Gary R Hook
ct. Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current") Signed-off-by: Gary R Hook --- drivers/char/hw_random/core.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c in

[PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2017-12-15 Thread Gary R Hook
ct. Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current") Signed-off-by: Gary R Hook --- Changes since v1: fix misspelled word in subject drivers/char/hw_random/core.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/char/h

Re: [PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2017-12-19 Thread Gary R Hook
On 12/17/2017 03:49 AM, PrasannaKumar Muralidharan wrote: On 17 December 2017 at 14:53, PrasannaKumar Muralidharan wrote: Hi Gary, Some minor comments below. On 16 December 2017 at 01:25, Gary R Hook wrote: Commit 142a27f0a731 added support for a "best" RNG, and in doing so in

[PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-20 Thread Gary R Hook
support PPR for a particular endpoint device. Please see https://support.amd.com/TechDocs/48882_IOMMU.pdf for this revision of the AMD IOMMU specification. Signed-off-by: Gary R Hook --- drivers/iommu/amd_iommu.c | 20 +++- drivers/iommu/amd_iommu_types.h |2 ++ 2 files

Re: [PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-20 Thread Gary R Hook
Please ignore; sent to the wrong list. Mea culpa. On 12/20/2017 10:57 AM, Gary R Hook wrote: The AMD IOMMU specification Rev 3.00 (December 2016) introduces a new Enhanced PPR Handling Support (EPHSup) bit in the MMIO register offset 0030h (IOMMU Extended Feature Register). When EPHSup=1, the

[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

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

2016-03-14 Thread Gary R Hook
On 03/11/2016 08:22 PM, Herbert Xu wrote: On Fri, Mar 11, 2016 at 10:40:11AM -0600, Gary R Hook wrote: @@ -128,14 +128,14 @@ static struct ccp_device *ccp_get_device(void) */ read_lock_irqsave(&ccp_unit_lock, flags); if (!list_empty(&c

[PATCH] crypto: ccp - fix lock acquisition code

2016-03-19 Thread Gary R Hook
This patch simplifies an unneeded read-write lock. 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 index 336e5b7..4dbc187 100644 --- a/drivers

Re: [PATCH] MAINTAINERS: Add a new maintainer for the CCP driver

2016-03-28 Thread Gary R Hook
On 03/21/2016 11:43 AM, Tom Lendacky wrote: Gary will be taking over future development of the CCP driver, so add him as a co-maintainer of the driver. Signed-off-by: Tom Lendacky --- MAINTAINERS |1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 30aca4a..

[PATCH] crypto: ccp - Register the CCP as a DMA resource

2016-04-04 Thread Gary R Hook
The CCP has the ability to provide DMA services to the kernel using pass-through mode of the device. Register these services as general purpose DMA channels. --- drivers/crypto/ccp/Kconfig |1 drivers/crypto/ccp/Makefile|6 drivers/crypto/ccp/ccp-dev-v3.c| 13 + dri

Re: [PATCH] crypto: ccp - Register the CCP as a DMA resource

2016-04-05 Thread Gary R Hook
On 04/04/2016 04:47 PM, Tom Lendacky wrote: On 04/04/2016 03:50 PM, Gary R Hook wrote: The CCP has the ability to provide DMA services to the kernel using pass-through mode of the device. Register these services as general purpose DMA channels. --- You're missing a cc: to David Mille

[PATCH v2] crypto: ccp - Register the CCP as a DMA resource

2016-04-05 Thread Gary R Hook
/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c new file mode 100644 index 000..94f77b0 --- /dev/null +++ b/drivers/crypto/ccp/ccp-dmaengine.c @@ -0,0 +1,727 @@ +/* + * AMD Cryptographic Coprocessor (CCP) driver + * + * Copyright (C) 2016 Advanced Micro Devices, Inc. + * + * Author: Ga

[PATCH v3] crypto: ccp - Register the CCP as a DMA resource

2016-04-18 Thread Gary R Hook
/unregister calls are properly ordered - Verified all changed files are listed in the diffstat - Undo some superfluous changes - Added a cc: Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Kconfig |1 drivers/crypto/ccp/Makefile|6 drivers/crypto/ccp/ccp-dev-v3.c| 11

[PATCH] crypto: ccp - Ensure all dependencies are specified

2016-04-20 Thread Gary R Hook
A DMA_ENGINE requires DMADEVICES in Kconfig Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/Kconfig b/drivers/crypto/ccp/Kconfig index 79cabfb..2238f77 100644 --- a/drivers/crypto/ccp/Kconfig +++ b/drivers

Re: [cryptodev:master 56/59] warning: (RAPIDIO_DMA_ENGINE && ..) selects DMA_ENGINE which has unmet direct dependencies (DMADEVICES)

2016-04-20 Thread Gary R Hook
On 04/20/2016 05:35 AM, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: 21ec757d2dd8650f978d27ad53cb1fcca8bb5e2b commit: 58ea8abf490415c390e0cc671e875510c9b66318 [56/59] crypto: ccp - Register the CCP as a DMA resource co

Re: [PATCH] crypto: constify ccp_actions structure

2016-05-02 Thread Gary R Hook
On 05/01/2016 06:52 AM, Julia Lawall wrote: The ccp_actions structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Gary Hook --- drivers/crypto/ccp/ccp-dev-v3.c |2 +- drivers/crypto/ccp/ccp-dev.h|2 +-

Typos and RSA

2016-05-17 Thread Gary R Hook
I am working on hooking up RSA functionality to the akcipher API. It appears that no other code, to date, uses this API. Can anyone confirm or deny that conclusion? I have questions about invoking akcipher transform functions, and can find no information about specifics that vex me. If there is

Re: Typos and RSA

2016-05-17 Thread Gary R Hook
Thanks so much. There are exactly 3 references to that symbol (in my freshly pulled copy of cryptodev-2.6). testmgr.c precipitates my questions, and public_key.c doesn't actually provide any content in the source input buffer, neither modulus nor plaintext. Thus, it doesn't clarify things eit

Re: Typos and RSA

2016-05-18 Thread Gary R Hook
Ah enlightenment can be such an uncomfortable thing... On 05/17/2016 05:56 PM, Stephan Mueller wrote: Am Dienstag, 17. Mai 2016, 17:46:44 schrieb Gary R Hook: Hi Gary, Thanks so much. There are exactly 3 references to that symbol (in my freshly pulled copy of cryptodev-2.6). testmgr.c

Re: IV generation in cryptographic driver in AEAD

2016-05-20 Thread Gary R Hook
On 05/19/2016 11:19 PM, Herbert Xu wrote: Denis B wrote: My algs struct now looks like this: static struct crypto_alg pp_crypto_algs[] = { { .cra_name = "authenc(hmac(sha256),cbc(aes))", .cra_driver_name = "pp_crypto_cbc_hmac_sha256", .cra_priority = 1, /**TODO set to high

Re: IV generation in cryptographic driver in AEAD

2016-05-23 Thread Gary R Hook
On 05/20/2016 06:31 PM, Herbert Xu wrote: On Fri, May 20, 2016 at 10:50:38AM -0500, Gary R Hook wrote: Why is (or should) setting geniv (be) required? crypto_givcipher_default() appears to call crypto_default_geniv() if the geniv member is NULL. That function returns "eseqiv" o

Re: padata - is serial actually serial?

2016-06-15 Thread Gary R Hook
On 06/15/2016 06:52 AM, Steffen Klassert wrote: Hi Jason. On Tue, Jun 14, 2016 at 11:00:54PM +0200, Jason A. Donenfeld wrote: Hi Steffen & Folks, I submit a job to padata_do_parallel(). When the parallel() function triggers, I do some things, and then call padata_do_serial(). Finally the seria

Re: Encryption output buffer description in algif_aead.c file

2016-06-24 Thread Gary R Hook
On 06/24/2016 07:01 AM, Stephan Mueller wrote: Am Freitag, 24. Juni 2016, 17:24:02 schrieb Harsh Jain: Hi Harsh, 379 * The memory structure for cipher operation has the following 380 * structure: 381 * AEAD encryption input: assoc data || plaintext 382

[PATCH] crypto: ccp - Fix non-conforming comment style

2016-07-26 Thread Gary R Hook
Adhere to the cryptodev comment convention. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h index bd41ffce..5fbee638 100644

[PATCH 00/10] Enablement of a v5 CCP

2016-07-26 Thread Gary R Hook
The following series updates the CCP driver to support both current and new cryptographic coprocessor models. Refactor code to further separate device-specific code from driver logic, then add equivalent support for the new device version. --- Gary R Hook (10): crypto: ccp - Abstract PCI

[PATCH 01/10] crypto: ccp - Abstract PCI info for the CCP

2016-07-26 Thread Gary R Hook
Device-specific values for the BAR and offset should be found in the version data structure. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |3 +++ drivers/crypto/ccp/ccp-dev.h|3 +++ drivers/crypto/ccp/ccp-pci.c| 15 +++ 3 files changed, 13

[PATCH 02/10] crypto: ccp - Shorten the fields of the action structure

2016-07-26 Thread Gary R Hook
Use more concise field names; "perform_" is too verbose. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 12 ++-- drivers/crypto/ccp/ccp-dev.h| 12 ++-- drivers/crypto/ccp/ccp-ops.c| 21 +++-- 3 files changed, 23 inserti

[PATCH 03/10] crypto: ccp - Refactoring: symbol cleanup

2016-07-26 Thread Gary R Hook
be added to the actions structure. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 32 ++--- drivers/crypto/ccp/ccp-dev.c|7 + drivers/crypto/ccp/ccp-dev.h| 43 +++--- drivers/crypto/ccp/ccp-ops.c| 266 --- 4 files changed

[PATCH 05/10] crypto: ccp - Refactor code supporting the CCP's RNG

2016-07-26 Thread Gary R Hook
Make the RNG support code common (where possible) in preparation for adding a v5 device. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 51 --- drivers/crypto/ccp/ccp-dev.c| 28 + drivers/crypto/ccp/ccp-dev.h

[PATCH 07/10] crypto: ccp - Let a v5 CCP provide the same function as v3

2016-07-26 Thread Gary R Hook
Enable equivalent function on a v5 CCP. Add support for a version 5 CCP which enables AES/XTS/SHA services. Also, more work on the data structures to virtualize functionality. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/Makefile |1 drivers/crypto/ccp/ccp-crypto-sha.c | 18

[PATCH 09/10] crypto: ccp - Enable DMA service on a v5 CCP

2016-07-26 Thread Gary R Hook
Every CCP is capable of providing general DMA services. Register the device as a provider. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |8 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index

[PATCH 04/10] crypto: ccp - Refactor the storage block allocation code

2016-07-26 Thread Gary R Hook
managed differently. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 52 +++ drivers/crypto/ccp/ccp-dev.h| 74 +++ drivers/crypto/ccp/ccp-ops.c| 52 ++- 3 files changed, 98 insertions

[PATCH 06/10] crypto: ccp - Refactor code to enable checks for queue space.

2016-07-26 Thread Gary R Hook
Available queue space is used to decide (by counting free slots) if we have to put a command on hold or if it can be sent to the engine immediately. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |8 +++- drivers/crypto/ccp/ccp-dev.h|1 + drivers/crypto/ccp/ccp

[PATCH 10/10] crypto: ccp - Enable use of the additional CCP

2016-07-26 Thread Gary R Hook
. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 37 - drivers/crypto/ccp/ccp-dev.h|8 drivers/crypto/ccp/ccp-pci.c|2 ++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b

[PATCH 08/10] crypto: ccp - Add support for the RNG in a version 5 CCP

2016-07-26 Thread Gary R Hook
Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 13 - drivers/crypto/ccp/ccp-dev-v5.c |7 +++ drivers/crypto/ccp/ccp-dev.c| 23 +++ drivers/crypto/ccp/ccp-dev.h|2 ++ 4 files changed, 36 insertions(+), 9 deletions(-) diff

testmgr.h

2016-08-09 Thread Gary R Hook
Q: Is there a policy (de facto or otherwise) on adding tests to testmgr.h? Two cases: 1) Tests from the NIST document(s) on various ciphers and hashes wherein we add to an existing set of tests? For example, 3DES ECB mode, or AES GCM? I suppose this question is really about, "how much is enough?"

Re: RSA key size not allowed in FIPS

2016-08-09 Thread Gary R Hook
On 08/09/2016 09:10 AM, Tapas Sarangi wrote: Ps : I could not send any attachment, is it possible to send attachment to this mailing list ? Pretty sure that's frowned upon. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.ker

Re: [cryptodev:master 17/45] drivers/crypto/ccp/ccp-dev-v5.c:838:3: error: label 'e_hwrng' used but not defined

2016-08-10 Thread Gary R Hook
A patch for this will be submitted shortly. On 08/10/2016 10:30 AM, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: 47856204146ba6fd0f198dbb23c4ed7ad1c3fd99 commit: 99d90b2ebd8b327c0c496798db99009b30c70945 [17/45] crypto:

[PATCH] crypto: CCP - build error: label 'e_hwrng' undefined

2016-08-10 Thread Gary R Hook
Fix goto target for when registration fails Reported-by: kbuild test robot Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index 4086714

D'oh! (Re: robot build error)

2016-08-11 Thread Gary R Hook
Please ignore this patch. [PATCH] crypto: CCP - build error: label 'e_hwrng' undefined Gary R Hook Wed, 10 Aug 2016 12:27:28 -0700 Fix goto target for when registration fails Reported-by: kbuild test robot Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |2

Re: [PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset

2016-09-19 Thread Gary R Hook
->tx_desc, &chan->dma_chan); desc->tx_desc.flags = flags; desc->tx_desc.tx_submit = ccp_tx_submit; Acked-by: Gary R Hook -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] crypto: ccp - Fix return value check in ccp_dmaengine_register()

2016-09-19 Thread Gary R Hook
if (!dma_desc_cache_name) return -ENOMEM; ccp->dma_desc_cache = kmem_cache_create(dma_desc_cache_name, sizeof(struct ccp_dma_desc), Acked-by: Gary R Hook -- To unsubscribe from this list: send the line "unsubscribe linux-crypto&q

[PATCH] crypto: ccp - Assign DMA commands to the channel's CCP

2017-03-10 Thread Gary R Hook
From: Gary R Hook The CCP driver generally uses a round-robin approach when assigning operations to available CCPs. For the DMA engine, however, the DMA mappings of the SGs are associated with a specific CCP. When an IOMMU is enabled, the IOMMU is programmed based on this specific device. If

Re: [PATCH] crypto: ccp - Assign DMA commands to the channel's CCP

2017-03-13 Thread Gary R Hook
On 03/03/2017 7:15 AM, Stephan Mueller wrote: Am Donnerstag, 2. März 2017, 22:26:54 CET schrieb Gary R Hook: Hi Gary, Thanks for your comments, Stephan. > A version 5 device provides the primitive commands > required for AES GCM. This patch adds support for > en/decryption. >

Re: [PATCH V2 2/3] crypto: ccp - Enable support for AES GCM on v5 CCPs

2017-03-14 Thread Gary R Hook
On 03/14/2017 02:17 AM, Stephan Müller wrote: Am Montag, 13. März 2017, 20:35:07 CET schrieb Gary R Hook: Hi Gary, Is it acceptable to snip stuff out? Most of this code seems irrelevant to this discussion On 03/03/2017 7:15 AM, Stephan Mueller wrote: > Am Donnerstag, 2. März 2

[PATCH V3 1/3] crypto: ccp - Add SHA-2 384- and 512-bit support

2017-03-15 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 V3 2/3] crypto: ccp - Enable 3DES function on v5 CCPs

2017-03-15 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 | 22

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

2017-03-15 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 V3 0/3] Support new function in new CCPs

2017-03-15 Thread Gary R Hook
to the current repo Changes from V1: - Ensure the patches build correctly --- Gary R Hook (3): crypto: ccp - Add SHA-2 384- and 512-bit support crypto: ccp - Enable 3DES function on v5 CCPs crypto: ccp - Enable support for AES GCM on v5 CCPs drivers/crypto/ccp/Makefile

[PATCH] crypto: ccp - Make some CCP DMA channels private

2017-03-23 Thread Gary R Hook
a device level, reserve the "other" (secondary) CCP channels as private. Add a module parameter that allows for override, to be applied to all channels on all devices. CC: # 4.10.x- Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c|1 + drivers/crypto/ccp

[PATCH] crypto: ccp - Remove redundant cpu-to-le32 macros

2017-03-28 Thread Gary R Hook
Endianness is dealt with when the command descriptor is copied into the command queue. Remove any occurrences of cpu_to_le32() found elsewhere. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff

Re: [PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Gary R Hook
Ack. Didn't reply all Sorry, Arnd. There was a krobot warning about this and I submitted a patch just now. (I thought) my mistake was (in this function) not handling the structure elements in the same manner as other functions. My patch rectifies that. On 03/28/2017 04:58 AM, Arnd Bergmann

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 04:58 AM, Arnd Bergmann wrote:> The newly added AES GCM implementation uses one of the largest stack frames in the kernel, around 1KB on normal 64-bit kernels, and 1.6KB when CONFIG_KASAN is enabled: drivers/crypto/ccp/ccp-ops.c: In function 'ccp_run_aes_gcm_cmd': drivers/crypto/cc

Re: [PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Gary R Hook
On 03/28/2017 09:59 AM, Arnd Bergmann wrote: On Tue, Mar 28, 2017 at 4:08 PM, Gary R Hook wrote: In fact, the use of bit fields in hardware defined data structures is not portable to start with, so until all these bit fields get replaced by something else, the driver cannot work on big-endian

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 10:10 AM, Arnd Bergmann wrote: On Tue, Mar 28, 2017 at 4:15 PM, Gary R Hook wrote: On 03/28/2017 04:58 AM, Arnd Bergmann wrote:> The newly added AES GCM implementation uses one of the largest stack frames diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-de

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 10:10 AM, Arnd Bergmann wrote: -}; +} __packed __aligned(4); My gcc 4.8 doesn't understand __aligned(). Shouldn't we use #pragma(4) here? That is odd, the __aligned() macro gets defined for all compiler versions in linux/compiler.h, and the aligned attribute should work for all

[PATCH V2] crypto: ccp - Rearrange structure members to minimize size

2017-03-28 Thread Gary R Hook
The AES GCM function (in ccp-ops) requires a fair amount of stack space, which elicits a complaint when KASAN is enabled. Rearranging and packing a few structures eliminates the warning. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h |8 1 file changed, 4 insertions

[PATCH 0/2] Interrupt management fixes

2017-04-12 Thread Gary R Hook
The following series implements... Correct the driver to attend only to interrupt bits that are relevant, and ensure that interrupts are managed properly at module unload. --- Gary R Hook (2): crypto: ccp - Use only the relevant interrupt bits crypto: ccp - Disable interrupts early

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

2017-04-12 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. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h |5 ++--- 1 file changed, 2 insertions(+), 3 deletions

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

2017-04-12 Thread Gary R Hook
From: Gary R Hook Ensure that we disable interrupts first when shutting down the driver. 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/ccp/ccp-dev-v5.c

[PATCH V2 0/2] Interrupt management fixes

2017-04-13 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 V1: - Changed the #define to "SUPPORTED_INTERRUPTS" --- Gary R Hook (2): crypto: ccp - Use only the relevant interrupt bits c

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

2017-04-13 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. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c |9 + drivers/crypto/ccp/ccp-dev.h|5

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

2017-04-13 Thread Gary R Hook
From: Gary R Hook Ensure that we disable interrupts first when shutting down the driver. 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/ccp/ccp-dev-v5.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

<    1   2   3   >