2023-12-18 20:48:23

by Tom Zanussi

[permalink] [raw]
Subject: [PATCH 0/2] crypto: Intel Analytics Accelerator (IAA) updates

Hi Herbert,

Here are a couple patches that didn't make it into the last version of
the IAA crypto driver.

Tested using both shared and dedicated workqueues, with no problems
seen.

Thanks,

Tom

Tom Zanussi (2):
crypto: iaa - Change desc->priv to 0
crypto: iaa - Remove unneeded newline in update_max_adecomp_delay_ns()

drivers/crypto/intel/iaa/iaa_crypto_main.c | 8 ++++----
drivers/crypto/intel/iaa/iaa_crypto_stats.c | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)

--
2.34.1



2023-12-18 20:48:35

by Tom Zanussi

[permalink] [raw]
Subject: [PATCH 1/2] crypto: iaa - Change desc->priv to 0

In order for shared workqeues to work properly, desc->priv should be
set to 0 rather than 1. The need for this is described in commit
f5ccf55e1028 (dmaengine/idxd: Re-enable kernel workqueue under DMA
API), so we need to make IAA consistent with IOMMU settings, otherwise
we get:

[ 141.948389] IOMMU: dmar15: Page request in Privilege Mode
[ 141.948394] dmar15: Invalid page request: 2000026a100101 ffffb167

Dedicated workqueues ignore this field and are unaffected.

Signed-off-by: Tom Zanussi <[email protected]>
---
drivers/crypto/intel/iaa/iaa_crypto_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c
index eafa2dd7a5bb..5093361b0107 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_main.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c
@@ -484,7 +484,7 @@ static int decompress_header(struct iaa_device_compression_mode *device_mode,

desc->decompr_flags = mode->gen_decomp_table_flags;

- desc->priv = 1;
+ desc->priv = 0;

desc->completion_addr = idxd_desc->compl_dma;

@@ -1255,7 +1255,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
IDXD_OP_FLAG_RD_SRC2_AECS | IDXD_OP_FLAG_CC;
desc->opcode = IAX_OPCODE_COMPRESS;
desc->compr_flags = IAA_COMP_FLAGS;
- desc->priv = 1;
+ desc->priv = 0;

desc->src1_addr = (u64)src_addr;
desc->src1_size = slen;
@@ -1409,7 +1409,7 @@ static int iaa_compress_verify(struct crypto_tfm *tfm, struct acomp_req *req,
desc->flags = IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR | IDXD_OP_FLAG_CC;
desc->opcode = IAX_OPCODE_DECOMPRESS;
desc->decompr_flags = IAA_DECOMP_FLAGS | IAA_DECOMP_SUPPRESS_OUTPUT;
- desc->priv = 1;
+ desc->priv = 0;

desc->src1_addr = (u64)dst_addr;
desc->src1_size = *dlen;
@@ -1495,7 +1495,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
desc->opcode = IAX_OPCODE_DECOMPRESS;
desc->max_dst_size = PAGE_SIZE;
desc->decompr_flags = IAA_DECOMP_FLAGS;
- desc->priv = 1;
+ desc->priv = 0;

desc->src1_addr = (u64)src_addr;
desc->dst_addr = (u64)dst_addr;
--
2.34.1


2023-12-18 20:48:50

by Tom Zanussi

[permalink] [raw]
Subject: [PATCH 2/2] crypto: iaa - Remove unneeded newline in update_max_adecomp_delay_ns()

Remove a stray newline in update_max_adecomp_delay_ns().

Reported-by: Christophe JAILLET <[email protected]>
Signed-off-by: Tom Zanussi <[email protected]>
---
drivers/crypto/intel/iaa/iaa_crypto_stats.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/intel/iaa/iaa_crypto_stats.c b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
index 0279edc6194e..2e3b7b73af20 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_stats.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
@@ -109,7 +109,6 @@ void update_max_adecomp_delay_ns(u64 start_time_ns)
time_diff = ktime_get_ns() - start_time_ns;

if (time_diff > max_adecomp_delay_ns)
-
max_adecomp_delay_ns = time_diff;
}

--
2.34.1


2023-12-18 21:48:53

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH 1/2] crypto: iaa - Change desc->priv to 0



On 12/18/23 13:47, Tom Zanussi wrote:
> In order for shared workqeues to work properly, desc->priv should be
> set to 0 rather than 1. The need for this is described in commit
> f5ccf55e1028 (dmaengine/idxd: Re-enable kernel workqueue under DMA
> API), so we need to make IAA consistent with IOMMU settings, otherwise
> we get:
>
> [ 141.948389] IOMMU: dmar15: Page request in Privilege Mode
> [ 141.948394] dmar15: Invalid page request: 2000026a100101 ffffb167
>
> Dedicated workqueues ignore this field and are unaffected.
>
> Signed-off-by: Tom Zanussi <[email protected]>

Reviewed-by: Dave Jiang <[email protected]>

> ---
> drivers/crypto/intel/iaa/iaa_crypto_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c
> index eafa2dd7a5bb..5093361b0107 100644
> --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c
> +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c
> @@ -484,7 +484,7 @@ static int decompress_header(struct iaa_device_compression_mode *device_mode,
>
> desc->decompr_flags = mode->gen_decomp_table_flags;
>
> - desc->priv = 1;
> + desc->priv = 0;
>
> desc->completion_addr = idxd_desc->compl_dma;
>
> @@ -1255,7 +1255,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
> IDXD_OP_FLAG_RD_SRC2_AECS | IDXD_OP_FLAG_CC;
> desc->opcode = IAX_OPCODE_COMPRESS;
> desc->compr_flags = IAA_COMP_FLAGS;
> - desc->priv = 1;
> + desc->priv = 0;
>
> desc->src1_addr = (u64)src_addr;
> desc->src1_size = slen;
> @@ -1409,7 +1409,7 @@ static int iaa_compress_verify(struct crypto_tfm *tfm, struct acomp_req *req,
> desc->flags = IDXD_OP_FLAG_CRAV | IDXD_OP_FLAG_RCR | IDXD_OP_FLAG_CC;
> desc->opcode = IAX_OPCODE_DECOMPRESS;
> desc->decompr_flags = IAA_DECOMP_FLAGS | IAA_DECOMP_SUPPRESS_OUTPUT;
> - desc->priv = 1;
> + desc->priv = 0;
>
> desc->src1_addr = (u64)dst_addr;
> desc->src1_size = *dlen;
> @@ -1495,7 +1495,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
> desc->opcode = IAX_OPCODE_DECOMPRESS;
> desc->max_dst_size = PAGE_SIZE;
> desc->decompr_flags = IAA_DECOMP_FLAGS;
> - desc->priv = 1;
> + desc->priv = 0;
>
> desc->src1_addr = (u64)src_addr;
> desc->dst_addr = (u64)dst_addr;

2023-12-18 21:49:12

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH 2/2] crypto: iaa - Remove unneeded newline in update_max_adecomp_delay_ns()



On 12/18/23 13:47, Tom Zanussi wrote:
> Remove a stray newline in update_max_adecomp_delay_ns().
>
> Reported-by: Christophe JAILLET <[email protected]>
> Signed-off-by: Tom Zanussi <[email protected]>

Reviewed-by: Dave Jiang <[email protected]>

> ---
> drivers/crypto/intel/iaa/iaa_crypto_stats.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/intel/iaa/iaa_crypto_stats.c b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
> index 0279edc6194e..2e3b7b73af20 100644
> --- a/drivers/crypto/intel/iaa/iaa_crypto_stats.c
> +++ b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
> @@ -109,7 +109,6 @@ void update_max_adecomp_delay_ns(u64 start_time_ns)
> time_diff = ktime_get_ns() - start_time_ns;
>
> if (time_diff > max_adecomp_delay_ns)
> -
> max_adecomp_delay_ns = time_diff;
> }
>

2023-12-18 21:55:44

by Fenghua Yu

[permalink] [raw]
Subject: Re: [PATCH 1/2] crypto: iaa - Change desc->priv to 0



On 12/18/23 12:47, Tom Zanussi wrote:
> In order for shared workqeues to work properly, desc->priv should be
> set to 0 rather than 1. The need for this is described in commit
> f5ccf55e1028 (dmaengine/idxd: Re-enable kernel workqueue under DMA
> API), so we need to make IAA consistent with IOMMU settings, otherwise
> we get:
>
> [ 141.948389] IOMMU: dmar15: Page request in Privilege Mode
> [ 141.948394] dmar15: Invalid page request: 2000026a100101 ffffb167
>
> Dedicated workqueues ignore this field and are unaffected.
>
> Signed-off-by: Tom Zanussi <[email protected]>

Reviewed-by: Fenghua Yu <[email protected]>

Thanks.

-Fenghua

2023-12-18 21:56:16

by Fenghua Yu

[permalink] [raw]
Subject: Re: [PATCH 2/2] crypto: iaa - Remove unneeded newline in update_max_adecomp_delay_ns()



On 12/18/23 12:47, Tom Zanussi wrote:
> Remove a stray newline in update_max_adecomp_delay_ns().
>
> Reported-by: Christophe JAILLET <[email protected]>
> Signed-off-by: Tom Zanussi <[email protected]>

Reviewed-by: Fenghua Yu <[email protected]>

Thanks.

-Fenghua

2023-12-29 03:29:20

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/2] crypto: Intel Analytics Accelerator (IAA) updates

On Mon, Dec 18, 2023 at 02:47:13PM -0600, Tom Zanussi wrote:
> Hi Herbert,
>
> Here are a couple patches that didn't make it into the last version of
> the IAA crypto driver.
>
> Tested using both shared and dedicated workqueues, with no problems
> seen.
>
> Thanks,
>
> Tom
>
> Tom Zanussi (2):
> crypto: iaa - Change desc->priv to 0
> crypto: iaa - Remove unneeded newline in update_max_adecomp_delay_ns()
>
> drivers/crypto/intel/iaa/iaa_crypto_main.c | 8 ++++----
> drivers/crypto/intel/iaa/iaa_crypto_stats.c | 1 -
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> --
> 2.34.1

All applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt