Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1672349 > unrolled thread
| Started by | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| First post | 2017-06-22 09:10 +0200 |
| Last post | 2017-06-22 10:40 +0200 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13 Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-22 09:10 +0200
[PATCH 2/7] staging: ccree: register setkey for none hash macs Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-22 09:10 +0200
[PATCH 4/7] staging: ccree: remove unused function Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-22 09:10 +0200
Re: [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13 Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-22 09:20 +0200
Re: [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13 Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-22 10:30 +0200
Re: [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13 Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-22 10:40 +0200
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-06-22 09:10 +0200 |
| Subject | [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13 |
| Message-ID | <tV4pz-1l7-5@gated-at.bofh.it> |
An assortment of bug fixes and staging TODO items. Highlights includes the driver passing crypto testmgr boot tests and support of multiple HW revs. without build time changes. Gilad Ben-Yossef (7): staging: ccree: fix hash import/export staging: ccree: register setkey for none hash macs staging: ccree: add support for older HW revisions staging: ccree: remove unused function staging: ccree: add clock management support staging: ccree: add DT bus coherency detection staging: ccree: use signal safe completion wait drivers/staging/ccree/Kconfig | 7 +- drivers/staging/ccree/Makefile | 2 +- drivers/staging/ccree/cc_crypto_ctx.h | 16 -- drivers/staging/ccree/cc_hw_queue_defs.h | 14 +- drivers/staging/ccree/cc_regs.h | 7 +- drivers/staging/ccree/dx_crys_kernel.h | 1 + drivers/staging/ccree/dx_host.h | 3 + drivers/staging/ccree/dx_reg_common.h | 2 - drivers/staging/ccree/ssi_aead.c | 36 ++- drivers/staging/ccree/ssi_buffer_mgr.c | 37 +-- drivers/staging/ccree/ssi_cipher.c | 27 +- drivers/staging/ccree/ssi_config.h | 20 -- drivers/staging/ccree/ssi_driver.c | 170 +++++++++--- drivers/staging/ccree/ssi_driver.h | 32 ++- drivers/staging/ccree/ssi_fips_ll.c | 59 +++-- drivers/staging/ccree/ssi_hash.c | 441 ++++++++++++++++++------------- drivers/staging/ccree/ssi_hash.h | 12 +- drivers/staging/ccree/ssi_pm.c | 13 +- drivers/staging/ccree/ssi_pm_ext.c | 60 ----- drivers/staging/ccree/ssi_pm_ext.h | 33 --- drivers/staging/ccree/ssi_request_mgr.c | 22 +- drivers/staging/ccree/ssi_sram_mgr.c | 15 +- 22 files changed, 564 insertions(+), 465 deletions(-) delete mode 100644 drivers/staging/ccree/ssi_pm_ext.c delete mode 100644 drivers/staging/ccree/ssi_pm_ext.h -- 2.1.4
[toc] | [next] | [standalone]
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-06-22 09:10 +0200 |
| Subject | [PATCH 2/7] staging: ccree: register setkey for none hash macs |
| Message-ID | <tV4pB-1l7-33@gated-at.bofh.it> |
| In reply to | #1672349 |
Fix a bug where the transformation init code did
not register a setkey method for none hash based MACs.
Fixes commit 50cfbbb7e627 ("staging: ccree: add ahash support").
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
drivers/staging/ccree/ssi_hash.c | 83 ++++++++++++++++++++--------------------
1 file changed, 42 insertions(+), 41 deletions(-)
diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c
index c39e3be..f52e1af 100644
--- a/drivers/staging/ccree/ssi_hash.c
+++ b/drivers/staging/ccree/ssi_hash.c
@@ -1874,8 +1874,8 @@ static int ssi_ahash_setkey(struct crypto_ahash *ahash,
struct ssi_hash_template {
char name[CRYPTO_MAX_ALG_NAME];
char driver_name[CRYPTO_MAX_ALG_NAME];
- char hmac_name[CRYPTO_MAX_ALG_NAME];
- char hmac_driver_name[CRYPTO_MAX_ALG_NAME];
+ char mac_name[CRYPTO_MAX_ALG_NAME];
+ char mac_driver_name[CRYPTO_MAX_ALG_NAME];
unsigned int blocksize;
bool synchronize;
struct ahash_alg template_ahash;
@@ -1894,8 +1894,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "sha1",
.driver_name = "sha1-dx",
- .hmac_name = "hmac(sha1)",
- .hmac_driver_name = "hmac-sha1-dx",
+ .mac_name = "hmac(sha1)",
+ .mac_driver_name = "hmac-sha1-dx",
.blocksize = SHA1_BLOCK_SIZE,
.synchronize = false,
.template_ahash = {
@@ -1919,8 +1919,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "sha256",
.driver_name = "sha256-dx",
- .hmac_name = "hmac(sha256)",
- .hmac_driver_name = "hmac-sha256-dx",
+ .mac_name = "hmac(sha256)",
+ .mac_driver_name = "hmac-sha256-dx",
.blocksize = SHA256_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -1943,8 +1943,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "sha224",
.driver_name = "sha224-dx",
- .hmac_name = "hmac(sha224)",
- .hmac_driver_name = "hmac-sha224-dx",
+ .mac_name = "hmac(sha224)",
+ .mac_driver_name = "hmac-sha224-dx",
.blocksize = SHA224_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -1968,8 +1968,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "sha384",
.driver_name = "sha384-dx",
- .hmac_name = "hmac(sha384)",
- .hmac_driver_name = "hmac-sha384-dx",
+ .mac_name = "hmac(sha384)",
+ .mac_driver_name = "hmac-sha384-dx",
.blocksize = SHA384_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -1992,8 +1992,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "sha512",
.driver_name = "sha512-dx",
- .hmac_name = "hmac(sha512)",
- .hmac_driver_name = "hmac-sha512-dx",
+ .mac_name = "hmac(sha512)",
+ .mac_driver_name = "hmac-sha512-dx",
.blocksize = SHA512_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -2017,8 +2017,8 @@ static struct ssi_hash_template driver_hash[] = {
{
.name = "md5",
.driver_name = "md5-dx",
- .hmac_name = "hmac(md5)",
- .hmac_driver_name = "hmac-md5-dx",
+ .mac_name = "hmac(md5)",
+ .mac_driver_name = "hmac-md5-dx",
.blocksize = MD5_HMAC_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -2039,8 +2039,8 @@ static struct ssi_hash_template driver_hash[] = {
.inter_digestsize = MD5_DIGEST_SIZE,
},
{
- .name = "xcbc(aes)",
- .driver_name = "xcbc-aes-dx",
+ .mac_name = "xcbc(aes)",
+ .mac_driver_name = "xcbc-aes-dx",
.blocksize = AES_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -2062,8 +2062,8 @@ static struct ssi_hash_template driver_hash[] = {
},
#if SSI_CC_HAS_CMAC
{
- .name = "cmac(aes)",
- .driver_name = "cmac-aes-dx",
+ .mac_name = "cmac(aes)",
+ .mac_driver_name = "cmac-aes-dx",
.blocksize = AES_BLOCK_SIZE,
.template_ahash = {
.init = ssi_ahash_init,
@@ -2106,9 +2106,9 @@ ssi_hash_create_alg(struct ssi_hash_template *template, bool keyed)
if (keyed) {
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
- template->hmac_name);
+ template->mac_name);
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
- template->hmac_driver_name);
+ template->mac_driver_name);
} else {
halg->setkey = NULL;
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
@@ -2297,32 +2297,33 @@ int ssi_hash_alloc(struct ssi_drvdata *drvdata)
/* ahash registration */
for (alg = 0; alg < ARRAY_SIZE(driver_hash); alg++) {
struct ssi_hash_alg *t_alg;
+ int hw_mode = driver_hash[alg].hw_mode;
/* register hmac version */
+ t_alg = ssi_hash_create_alg(&driver_hash[alg], true);
+ if (IS_ERR(t_alg)) {
+ rc = PTR_ERR(t_alg);
+ SSI_LOG_ERR("%s alg allocation failed\n",
+ driver_hash[alg].driver_name);
+ goto fail;
+ }
+ t_alg->drvdata = drvdata;
- if ((((struct ssi_hash_template *)&driver_hash[alg])->hw_mode != DRV_CIPHER_XCBC_MAC) &&
- (((struct ssi_hash_template *)&driver_hash[alg])->hw_mode != DRV_CIPHER_CMAC)) {
- t_alg = ssi_hash_create_alg(&driver_hash[alg], true);
- if (IS_ERR(t_alg)) {
- rc = PTR_ERR(t_alg);
- SSI_LOG_ERR("%s alg allocation failed\n",
- driver_hash[alg].driver_name);
- goto fail;
- }
- t_alg->drvdata = drvdata;
-
- rc = crypto_register_ahash(&t_alg->ahash_alg);
- if (unlikely(rc)) {
- SSI_LOG_ERR("%s alg registration failed\n",
- driver_hash[alg].driver_name);
- kfree(t_alg);
- goto fail;
- } else {
- list_add_tail(&t_alg->entry,
- &hash_handle->hash_list);
- }
+ rc = crypto_register_ahash(&t_alg->ahash_alg);
+ if (unlikely(rc)) {
+ SSI_LOG_ERR("%s alg registration failed\n",
+ driver_hash[alg].driver_name);
+ kfree(t_alg);
+ goto fail;
+ } else {
+ list_add_tail(&t_alg->entry,
+ &hash_handle->hash_list);
}
+ if ((hw_mode == DRV_CIPHER_XCBC_MAC) ||
+ (hw_mode == DRV_CIPHER_CMAC))
+ continue;
+
/* register hash version */
t_alg = ssi_hash_create_alg(&driver_hash[alg], false);
if (IS_ERR(t_alg)) {
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-06-22 09:10 +0200 |
| Subject | [PATCH 4/7] staging: ccree: remove unused function |
| Message-ID | <tV4pB-1l7-35@gated-at.bofh.it> |
| In reply to | #1672349 |
The function set_ack_last was not used anywhere. Remove it.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
drivers/staging/ccree/cc_hw_queue_defs.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h
index c730c3c..ac0eb97 100644
--- a/drivers/staging/ccree/cc_hw_queue_defs.h
+++ b/drivers/staging/ccree/cc_hw_queue_defs.h
@@ -226,18 +226,6 @@ static inline void set_queue_last_ind_bit(struct cc_hw_desc *pdesc)
}
/*
- * Signs the end of HW descriptors flow by asking for completion ack,
- * and release the HW engines
- *
- * @pdesc: pointer HW descriptor struct
- */
-static inline void set_ack_last(struct cc_hw_desc *pdesc)
-{
- pdesc->word[3] |= FIELD_PREP(WORD3_QUEUE_LAST_IND, 1);
- pdesc->word[4] |= FIELD_PREP(WORD4_ACK_NEEDED, 1);
-}
-
-/*
* Set the DIN field of a HW descriptors
*
* @pdesc: pointer HW descriptor struct
--
2.1.4
[toc] | [prev] | [next] | [standalone]
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-06-22 09:20 +0200 |
| Message-ID | <tV4zf-1oP-5@gated-at.bofh.it> |
| In reply to | #1672349 |
On Thu, Jun 22, 2017 at 10:07 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote: > An assortment of bug fixes and staging TODO items. > Highlights includes the driver passing crypto testmgr boot tests > and support of multiple HW revs. without build time changes. > > Gilad Ben-Yossef (7): > staging: ccree: fix hash import/export > staging: ccree: register setkey for none hash macs > staging: ccree: add support for older HW revisions > staging: ccree: remove unused function > staging: ccree: add clock management support > staging: ccree: add DT bus coherency detection > staging: ccree: use signal safe completion wait One additional note: the patch set is on top of the current staging-next which is d06838de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with the coding style clean up patches from Jhin-Ming if you take them. If you wish me to merge this patch set on top those just let me know. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-06-22 10:30 +0200 |
| Message-ID | <tV5F0-26c-25@gated-at.bofh.it> |
| In reply to | #1672353 |
On Thu, Jun 22, 2017 at 10:14:08AM +0300, Gilad Ben-Yossef wrote: > On Thu, Jun 22, 2017 at 10:07 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote: > > An assortment of bug fixes and staging TODO items. > > Highlights includes the driver passing crypto testmgr boot tests > > and support of multiple HW revs. without build time changes. > > > > Gilad Ben-Yossef (7): > > staging: ccree: fix hash import/export > > staging: ccree: register setkey for none hash macs > > staging: ccree: add support for older HW revisions > > staging: ccree: remove unused function > > staging: ccree: add clock management support > > staging: ccree: add DT bus coherency detection > > staging: ccree: use signal safe completion wait > > One additional note: the patch set is on top of the current staging-next which > is d06838de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with > the coding style clean up patches from Jhin-Ming if you take them. > > If you wish me to merge this patch set on top those just let me know. > Yes. Those are fine and will be merged most likely. It's strictly first in, first out. regards, dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Date | 2017-06-22 10:40 +0200 |
| Message-ID | <tV5OG-29T-21@gated-at.bofh.it> |
| In reply to | #1672412 |
On Thu, Jun 22, 2017 at 11:28 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote: > On Thu, Jun 22, 2017 at 10:14:08AM +0300, Gilad Ben-Yossef wrote: >> On Thu, Jun 22, 2017 at 10:07 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote: >> > An assortment of bug fixes and staging TODO items. >> > Highlights includes the driver passing crypto testmgr boot tests >> > and support of multiple HW revs. without build time changes. >> > >> > Gilad Ben-Yossef (7): >> > staging: ccree: fix hash import/export >> > staging: ccree: register setkey for none hash macs >> > staging: ccree: add support for older HW revisions >> > staging: ccree: remove unused function >> > staging: ccree: add clock management support >> > staging: ccree: add DT bus coherency detection >> > staging: ccree: use signal safe completion wait >> >> One additional note: the patch set is on top of the current staging-next which >> is d06838de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with >> the coding style clean up patches from Jhin-Ming if you take them. >> >> If you wish me to merge this patch set on top those just let me know. >> > > Yes. Those are fine and will be merged most likely. It's strictly > first in, first out. Sure. I'll send an updated patch on top of those then. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web