summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYongxin Liu <yongxin.liu@windriver.com>2021-04-12 16:24:38 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2021-04-14 13:30:21 +0800
commit1c4d15f46f2377e9525ec3741b5e23db64bfc7ae (patch)
tree181b11c4dd51889e522210784ed3b5346a418375
parentba8f6ba46896eab6653a5aa9b4e8dd94e3440c7b (diff)
downloadmeta-intel-qat-1c4d15f46f2377e9525ec3741b5e23db64bfc7ae.tar.gz
qat17: update to version 1.7.l.4.12.0-00011
Removed patches: qat17_4.7.0-00006-Drop-pr_warning-definition.patch qat17_4.7.0-00006-Link-driver-with-object-files.patch qat17_4.7.0-00006-Switch-to-skcipher-API.patch qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch use-CC-for-LD.patch Renamed and rebased patches: qat16_2.3.0-34-qat-fix-for-cross-compilation-issue.patch => 0001-qat-fix-for-cross-compilation-issue.patch qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch => 0002-qat-remove-local-path-from-makefile.patch qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch => 0003-qat-override-CC-LD-AR-only-when-it-is-not-define.patch qat17_0.6.0-1-qat-update-KDIR-for-cross-compilation.patch => 0004-update-KDIR-for-cross-compilation.patch qat17_0.8.0-37-qat-added-include-dir-path.patch => 0005-Added-include-dir-path.patch qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch => 0006-qat-add-install-target-and-add-folder.patch qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch => 0007-qat-use-static-lib-for-linking-under-cpa-sample-code.patch qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch => 0008-qat-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch => 0009-crypto-qat-Silence-smp_processor_id-warning.patch qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch => 0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch qat17_4.7.0-00006-qat17-use-namespace-CRYPTO_INTERNAL.patch => 0011-qat17-use-namespace-CRYPTO_INTERNAL.patch Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--recipes-extended/qat/files/0001-qat-fix-for-cross-compilation-issue.patch61
-rw-r--r--recipes-extended/qat/files/0002-qat-remove-local-path-from-makefile.patch (renamed from recipes-extended/qat/files/qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch)8
-rw-r--r--recipes-extended/qat/files/0003-qat-override-CC-LD-AR-only-when-it-is-not-define.patch (renamed from recipes-extended/qat/files/qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch)15
-rw-r--r--recipes-extended/qat/files/0004-update-KDIR-for-cross-compilation.patch (renamed from recipes-extended/qat/files/qat17_0.6.0-1-qat-update-KDIR-for-cross-compilation.patch)17
-rw-r--r--recipes-extended/qat/files/0005-Added-include-dir-path.patch (renamed from recipes-extended/qat/files/qat17_0.8.0-37-qat-added-include-dir-path.patch)18
-rw-r--r--recipes-extended/qat/files/0006-qat-add-install-target-and-add-folder.patch (renamed from recipes-extended/qat/files/qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch)16
-rw-r--r--recipes-extended/qat/files/0007-qat-use-static-lib-for-linking-under-cpa-sample-code.patch (renamed from recipes-extended/qat/files/qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch)31
-rw-r--r--recipes-extended/qat/files/0008-qat-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch (renamed from recipes-extended/qat/files/qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch)8
-rw-r--r--recipes-extended/qat/files/0009-crypto-qat-Silence-smp_processor_id-warning.patch (renamed from recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch)8
-rw-r--r--recipes-extended/qat/files/0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch (renamed from recipes-extended/qat/files/qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch)40
-rw-r--r--recipes-extended/qat/files/0011-qat17-use-namespace-CRYPTO_INTERNAL.patch (renamed from recipes-extended/qat/files/qat17_4.7.0-00006-qat17-use-namespace-CRYPTO_INTERNAL.patch)28
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-Drop-pr_warning-definition.patch31
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-Link-driver-with-object-files.patch91
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-Switch-to-skcipher-API.patch1158
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch32
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch96
-rw-r--r--recipes-extended/qat/files/qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch35
-rw-r--r--recipes-extended/qat/files/use-CC-for-LD.patch17
-rw-r--r--recipes-extended/qat/qat17_4.12.0-00011.bb (renamed from recipes-extended/qat/qat17_4.7.0-00006.bb)63
19 files changed, 170 insertions, 1603 deletions
diff --git a/recipes-extended/qat/files/0001-qat-fix-for-cross-compilation-issue.patch b/recipes-extended/qat/files/0001-qat-fix-for-cross-compilation-issue.patch
new file mode 100644
index 0000000..45689a9
--- /dev/null
+++ b/recipes-extended/qat/files/0001-qat-fix-for-cross-compilation-issue.patch
@@ -0,0 +1,61 @@
1From 563cc2fc8d1b120a63aa9d157effed04d39bd58f Mon Sep 17 00:00:00 2001
2From: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com>
3Date: Mon, 6 Jul 2015 15:57:20 +0800
4Subject: [PATCH 01/11] qat: fix for cross-compilation issue
5
6Upstream-Status: Inappropriate [Configuration]
7
8Ensure that we are not using host compiler.
9
10Signed-off-by: venkatasubramanian pattu <venkatasubramanianx.pattu@intel.com>
11Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
12[YL: modified for patching to qat17_4.12.0-00011]
13Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
14---
15 quickassist/lookaside/access_layer/src/sample_code/functional/common.mk | 2 +-
16 .../access_layer/src/sample_code/functional/dc/dc_dp_sample/Makefile | 2 +-
17 quickassist/lookaside/access_layer/src/sample_code/performance/Makefile | 2 +-
18 3 files changed, 3 insertions(+), 3 deletions(-)
19
20diff --git a/quickassist/lookaside/access_layer/src/sample_code/functional/common.mk b/quickassist/lookaside/access_layer/src/sample_code/functional/common.mk
21index 8c2fa3c..9402873 100644
22--- a/quickassist/lookaside/access_layer/src/sample_code/functional/common.mk
23+++ b/quickassist/lookaside/access_layer/src/sample_code/functional/common.mk
24@@ -150,7 +150,7 @@ ifeq ($(ICP_OS_LEVEL),user_space)
25 ############################################################
26
27 ifneq ($(PREBUILD_BINS),0)
28- ADDITIONAL_OBJECTS += -L/usr/Lib -L$(ICP_BUILD_OUTPUT)
29+ ADDITIONAL_OBJECTS += -L$(ICP_BUILD_OUTPUT)
30
31 ifeq ($(WITH_UPSTREAM),1)
32 ifeq ($(WITH_ICP_TARGET),1)
33diff --git a/quickassist/lookaside/access_layer/src/sample_code/functional/dc/dc_dp_sample/Makefile b/quickassist/lookaside/access_layer/src/sample_code/functional/dc/dc_dp_sample/Makefile
34index 7a4d593..06cbc3d 100644
35--- a/quickassist/lookaside/access_layer/src/sample_code/functional/dc/dc_dp_sample/Makefile
36+++ b/quickassist/lookaside/access_layer/src/sample_code/functional/dc/dc_dp_sample/Makefile
37@@ -70,7 +70,7 @@ ifeq ($(ICP_OS_LEVEL),user_space)
38 # Build user space executible
39 #
40 ############################################################
41-ADDITIONAL_OBJECTS += -L/usr/Lib -lpthread -lcrypto
42+ADDITIONAL_OBJECTS += -lpthread -lcrypto
43
44 USER_SOURCE_FILES += ../../common/cpa_sample_utils.c cpa_dc_dp_sample.c
45 USER_SOURCE_FILES += cpa_dc_dp_sample_user.c
46diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
47index 4b6857f..3914c1b 100644
48--- a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
49+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
50@@ -341,7 +341,7 @@ endif
51
52
53
54-ADDITIONAL_OBJECTS += -L/Lib -lpthread
55+ADDITIONAL_OBJECTS += -lpthread
56 ADDITIONAL_OBJECTS += -lcrypto
57 ifeq ($(WITH_UPSTREAM),1)
58 ifeq ($(OS),linux)
59--
602.14.5
61
diff --git a/recipes-extended/qat/files/qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch b/recipes-extended/qat/files/0002-qat-remove-local-path-from-makefile.patch
index 96791cb..f3aa726 100644
--- a/recipes-extended/qat/files/qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch
+++ b/recipes-extended/qat/files/0002-qat-remove-local-path-from-makefile.patch
@@ -1,7 +1,7 @@
1From 1e29afc0e69fb9118cb0dcb924cdffa9db730572 Mon Sep 17 00:00:00 2001 1From b71895c04981f59bf90de608c08ca389b65ad5e9 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anujx.mittal@intel.com> 2From: Anuj Mittal <anujx.mittal@intel.com>
3Date: Wed, 8 Jul 2015 11:11:32 +0800 3Date: Wed, 8 Jul 2015 11:11:32 +0800
4Subject: [PATCH] qat: remove local path from makefile 4Subject: [PATCH 02/11] qat: remove local path from makefile
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
@@ -13,7 +13,7 @@ Signed-off-by: Anuj Mittal <anujx.mittal@intel.com>
13 1 file changed, 1 insertion(+), 2 deletions(-) 13 1 file changed, 1 insertion(+), 2 deletions(-)
14 14
15diff --git a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 15diff --git a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
16index f7f18a5..e8c9f18 100644 16index c1504e1..7a27739 100644
17--- a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 17--- a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
18+++ b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 18+++ b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
19@@ -46,8 +46,7 @@ 19@@ -46,8 +46,7 @@
@@ -27,5 +27,5 @@ index f7f18a5..e8c9f18 100644
27 -I$(OSAL_DIR)/include \ 27 -I$(OSAL_DIR)/include \
28 -I$(OSAL_DIR)/src/linux/user_space/include 28 -I$(OSAL_DIR)/src/linux/user_space/include
29-- 29--
302.14.4 302.14.5
31 31
diff --git a/recipes-extended/qat/files/qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch b/recipes-extended/qat/files/0003-qat-override-CC-LD-AR-only-when-it-is-not-define.patch
index a25fdae..f3b8fe6 100644
--- a/recipes-extended/qat/files/qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch
+++ b/recipes-extended/qat/files/0003-qat-override-CC-LD-AR-only-when-it-is-not-define.patch
@@ -1,7 +1,7 @@
1From b21929c42aca4bc80f6c48b5ac31bf20165b2f3e Mon Sep 17 00:00:00 2001 1From 0a881aefea89006f21b82fcafc5a422b04fc0c9a Mon Sep 17 00:00:00 2001
2From: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com> 2From: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com>
3Date: Fri, 25 Mar 2016 18:02:37 +0800 3Date: Mon, 12 Apr 2021 08:40:47 +0800
4Subject: [PATCH] qat: override CC LD AR only when it is not define 4Subject: [PATCH 03/11] qat: override CC LD AR only when it is not define
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
@@ -14,7 +14,7 @@ Signed-off-by: Rahul Kumar Gupta <rahul.kumarxx.gupta@intel.com>
14 1 file changed, 3 insertions(+), 3 deletions(-) 14 1 file changed, 3 insertions(+), 3 deletions(-)
15 15
16diff --git a/quickassist/build_system/build_files/Core/ia.mk b/quickassist/build_system/build_files/Core/ia.mk 16diff --git a/quickassist/build_system/build_files/Core/ia.mk b/quickassist/build_system/build_files/Core/ia.mk
17index 4a4d123..f9aca23 100755 17index 230ee0f..f6fc755 100644
18--- a/quickassist/build_system/build_files/Core/ia.mk 18--- a/quickassist/build_system/build_files/Core/ia.mk
19+++ b/quickassist/build_system/build_files/Core/ia.mk 19+++ b/quickassist/build_system/build_files/Core/ia.mk
20@@ -67,9 +67,9 @@ 20@@ -67,9 +67,9 @@
@@ -29,6 +29,7 @@ index 4a4d123..f9aca23 100755
29+AR ?= $(CROSS_COMPILE)ar 29+AR ?= $(CROSS_COMPILE)ar
30 else 30 else
31 $(error MACHINE is undefined. Please set your target i.e. x86_64 \ 31 $(error MACHINE is undefined. Please set your target i.e. x86_64 \
32 "-> setenv MACHINE x86_64 or export MACHINE=x86_64") 32 "-> setenv MACHINE x86_64 or export MACHINE=x86_64")
33-- 33--
341.9.1 342.14.5
35
diff --git a/recipes-extended/qat/files/qat17_0.6.0-1-qat-update-KDIR-for-cross-compilation.patch b/recipes-extended/qat/files/0004-update-KDIR-for-cross-compilation.patch
index 78fc44b..8812a96 100644
--- a/recipes-extended/qat/files/qat17_0.6.0-1-qat-update-KDIR-for-cross-compilation.patch
+++ b/recipes-extended/qat/files/0004-update-KDIR-for-cross-compilation.patch
@@ -1,7 +1,7 @@
1From ae306d58c1bfc3d1c01d0e54ecfbfbbce39a0d4e Mon Sep 17 00:00:00 2001 1From 2d73ce79ef1b05d11868c89f0095ce5920171593 Mon Sep 17 00:00:00 2001
2From: "Tan, Raymond" <raymond.tan@intel.com> 2From: "Tan, Raymond" <raymond.tan@intel.com>
3Date: Wed, 30 May 2018 22:17:58 +0800 3Date: Wed, 30 May 2018 22:17:58 +0800
4Subject: [PATCH] update KDIR for cross-compilation 4Subject: [PATCH 04/11] update KDIR for cross-compilation
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
@@ -14,12 +14,12 @@ Signed-off-by: Tan, Raymond <raymond.tan@intel.com>
14 1 file changed, 3 insertions(+), 3 deletions(-) 14 1 file changed, 3 insertions(+), 3 deletions(-)
15 15
16diff --git a/quickassist/qat/Makefile b/quickassist/qat/Makefile 16diff --git a/quickassist/qat/Makefile b/quickassist/qat/Makefile
17index ab9a381..8608378 100644 17index b31829a..2e490ba 100644
18--- a/quickassist/qat/Makefile 18--- a/quickassist/qat/Makefile
19+++ b/quickassist/qat/Makefile 19+++ b/quickassist/qat/Makefile
20@@ -61,13 +61,13 @@ $(info Compiling with Heartbeat Failure Simulation feature) 20@@ -63,13 +63,13 @@ $(info Compiling with Heartbeat Failure Simulation feature)
21 endif 21 endif
22 22
23 ifeq ($(KERNELRELEASE),) 23 ifeq ($(KERNELRELEASE),)
24-KDIR ?= $(INSTALL_MOD_PATH)/lib/modules/$(shell uname -r)/build 24-KDIR ?= $(INSTALL_MOD_PATH)/lib/modules/$(shell uname -r)/build
25-ifneq ($(shell if [ -e $(KDIR)/include/config/auto.conf ]; then echo 1; fi),1) 25-ifneq ($(shell if [ -e $(KDIR)/include/config/auto.conf ]; then echo 1; fi),1)
@@ -32,7 +32,8 @@ index ab9a381..8608378 100644
32-include $(KDIR)/include/config/auto.conf 32-include $(KDIR)/include/config/auto.conf
33+include $(KERNEL_BUILDDIR)/include/config/auto.conf 33+include $(KERNEL_BUILDDIR)/include/config/auto.conf
34 INSTALL_FW_PATH ?= $(INSTALL_MOD_PATH)/lib/firmware 34 INSTALL_FW_PATH ?= $(INSTALL_MOD_PATH)/lib/firmware
35 35
36 default: modules 36 default: modules
37-- 37--
381.9.1 382.14.5
39
diff --git a/recipes-extended/qat/files/qat17_0.8.0-37-qat-added-include-dir-path.patch b/recipes-extended/qat/files/0005-Added-include-dir-path.patch
index 431d5f7..237abb6 100644
--- a/recipes-extended/qat/files/qat17_0.8.0-37-qat-added-include-dir-path.patch
+++ b/recipes-extended/qat/files/0005-Added-include-dir-path.patch
@@ -1,28 +1,28 @@
1From bb3de86f5511d25dffb1722f9c82379c91a3bb16 Mon Sep 17 00:00:00 2001 1From 667d9fd3542fbeedadf949143e2abf3776cf2336 Mon Sep 17 00:00:00 2001
2From: "Goh, Wen Sen" <wen.sen.goh@intel.com> 2From: "Goh, Wen Sen" <wen.sen.goh@intel.com>
3Date: Tue, 24 May 2016 16:05:12 +0800 3Date: Tue, 24 May 2016 16:05:12 +0800
4Subject: [PATCH] Added include dir path 4Subject: [PATCH 05/11] Added include dir path
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
8Make sure that we point to the correct include path to the local 8Make sure that we point to the correct include path to the local
9headers 9headers
10
11--- 10---
12 quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk | 1 + 11 quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk | 1 +
13 1 file changed, 1 insertion(+) 12 1 file changed, 1 insertion(+)
14 13
15diff --git a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 14diff --git a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
16index 493d6e9..67b252a 100755 15index 7a27739..2f935ec 100644
17--- a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 16--- a/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
18+++ b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk 17+++ b/quickassist/build_system/build_files/env_files/linux_2.6_user_space.mk
19@@ -84,6 +84,7 @@ INCLUDES+=-I$(API_DIR) \ 18@@ -59,6 +59,7 @@ INCLUDES+=-I$(API_DIR) \
20 19
21 EXTRA_CFLAGS += $(cmd_line_cflags) 20 EXTRA_CFLAGS += $(cmd_line_cflags)
22 EXTRA_CFLAGS += -fno-strict-aliasing 21 EXTRA_CFLAGS += -fno-strict-aliasing
23+EXTRA_CFLAGS += $(INCLUDES) 22+EXTRA_CFLAGS += $(INCLUDES)
24 EXTRA_LDFLAGS +=-whole-archive 23 EXTRA_LDFLAGS +=-whole-archive
25 24
26 ifeq ($(ARCH), i386) 25 ifeq ($(ARCH), i386)
27-- 26--
282.8.3 272.14.5
28
diff --git a/recipes-extended/qat/files/qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch b/recipes-extended/qat/files/0006-qat-add-install-target-and-add-folder.patch
index a810cfc..62d25e0 100644
--- a/recipes-extended/qat/files/qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch
+++ b/recipes-extended/qat/files/0006-qat-add-install-target-and-add-folder.patch
@@ -1,23 +1,22 @@
1From a94af9df0fa6f2c41efaf7ef6c17d0e5bb8aa80d Mon Sep 17 00:00:00 2001 1From fc2ae28063d10721282a4e6009cec9143ce37c80 Mon Sep 17 00:00:00 2001
2From: "Tan, Raymond" <raymond.tan@intel.com> 2From: "Tan, Raymond" <raymond.tan@intel.com>
3Date: Mon, 4 Jun 2018 09:26:33 +0800 3Date: Mon, 4 Jun 2018 09:26:33 +0800
4Subject: [PATCH] qat-add-install-target-and-add-folder 4Subject: [PATCH 06/11] qat-add-install-target-and-add-folder
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
8Modify Makefile to add install target and add folder 8Modify Makefile to add install target and add folder
9 9
10Signed-off-by: Tan, Raymond <raymond.tan@intel.com> 10Signed-off-by: Tan, Raymond <raymond.tan@intel.com>
11
12--- 11---
13 quickassist/Makefile | 25 ++++++++++++++++++++++--- 12 quickassist/Makefile | 25 ++++++++++++++++++++++---
14 1 file changed, 22 insertions(+), 3 deletions(-) 13 1 file changed, 22 insertions(+), 3 deletions(-)
15 14
16diff --git a/quickassist/Makefile b/quickassist/Makefile 15diff --git a/quickassist/Makefile b/quickassist/Makefile
17index 93990f2..70a4353 100644 16index 558f85d..4cc0f2b 100644
18--- a/quickassist/Makefile 17--- a/quickassist/Makefile
19+++ b/quickassist/Makefile 18+++ b/quickassist/Makefile
20@@ -97,6 +97,7 @@ ICP_BUILD_OUTPUT?=build_$(DATE) 19@@ -96,6 +96,7 @@ ICP_BUILD_OUTPUT?=build_$(DATE)
21 ICP_TOP_ENV=$(ICP_BUILDSYSTEM_PATH)/build_files/env_files/ 20 ICP_TOP_ENV=$(ICP_BUILDSYSTEM_PATH)/build_files/env_files/
22 export ICP_ACCEL_INC=YES 21 export ICP_ACCEL_INC=YES
23 LAC_LIB_DIR=$(LAC_PATH)/build/libs 22 LAC_LIB_DIR=$(LAC_PATH)/build/libs
@@ -25,7 +24,7 @@ index 93990f2..70a4353 100644
25 24
26 #Release Package build steps 25 #Release Package build steps
27 ALL_TARGETS = lac_user lac_kernel 26 ALL_TARGETS = lac_user lac_kernel
28@@ -114,10 +115,14 @@ all: $(ALL_TARGETS) 27@@ -113,10 +114,14 @@ all: $(ALL_TARGETS)
29 28
30 user: lac_lib_dir libosal_user lac_user 29 user: lac_lib_dir libosal_user lac_user
31 30
@@ -42,7 +41,7 @@ index 93990f2..70a4353 100644
42 41
43 # 42 #
44 # Common memory driver 43 # Common memory driver
45@@ -200,8 +205,22 @@ ifeq ($(ICP_NO_CLEAN),) 44@@ -199,8 +204,22 @@ ifeq ($(ICP_NO_CLEAN),)
46 endif 45 endif
47 46
48 47
@@ -66,3 +65,6 @@ index 93990f2..70a4353 100644
66 65
67 lac_lib_dir: clean 66 lac_lib_dir: clean
68 test -d $(LAC_LIB_DIR) || mkdir -p $(LAC_LIB_DIR); 67 test -d $(LAC_LIB_DIR) || mkdir -p $(LAC_LIB_DIR);
68--
692.14.5
70
diff --git a/recipes-extended/qat/files/qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch b/recipes-extended/qat/files/0007-qat-use-static-lib-for-linking-under-cpa-sample-code.patch
index f786a10..fc8828e 100644
--- a/recipes-extended/qat/files/qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch
+++ b/recipes-extended/qat/files/0007-qat-use-static-lib-for-linking-under-cpa-sample-code.patch
@@ -1,7 +1,7 @@
1From 026fd275834ac4e345464c8ce2b0163d052d0262 Mon Sep 17 00:00:00 2001 1From 54d537415c88b52c6cc682db17ecd0b6c077a8bf Mon Sep 17 00:00:00 2001
2From: "Tan, Raymond" <raymond.tan@intel.com> 2From: "Tan, Raymond" <raymond.tan@intel.com>
3Date: Wed, 30 May 2018 13:27:03 +0800 3Date: Mon, 12 Apr 2021 08:52:17 +0800
4Subject: [PATCH] qat-use-static-lib-for-linking-under-cpa-sample-code 4Subject: [PATCH 07/11] qat-use-static-lib-for-linking-under-cpa-sample-code
5 5
6Upstream-Status: Inappropriate [Configuration] 6Upstream-Status: Inappropriate [Configuration]
7 7
@@ -14,17 +14,18 @@ Signed-off-by: Tan, Raymond <raymond.tan@intel.com>
14 1 file changed, 1 insertion(+), 1 deletion(-) 14 1 file changed, 1 insertion(+), 1 deletion(-)
15 15
16diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile 16diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
17index 3a0fb37..5b7b3fa 100644 17index 3914c1b..a22e366 100644
18--- a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile 18--- a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
19+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile 19+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
20@@ -209,7 +209,7 @@ ifeq ($(WITH_CMDRV),1) 20@@ -319,7 +319,7 @@ ifneq ($(PREBUILD_BINS),0)
21 ifeq ($(WITH_ICP_TARGET),1) 21 ifeq ($(WITH_ICP_TARGET),1)
22 ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libqae_mem.a 22 ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libqae_mem.a
23 else 23 else
24- ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv_s.so 24- ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv_s.so
25+ ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv.a 25+ ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv.a
26 endif 26 endif
27 endif 27 endif
28 #endif 28 #endif
29-- 29--
301.9.1 302.14.5
31
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch b/recipes-extended/qat/files/0008-qat-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch
index 6af5a6a..b511473 100644
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch
+++ b/recipes-extended/qat/files/0008-qat-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch
@@ -1,7 +1,7 @@
1From bf4053e4685bbbf84e6f91d18809dbf4487d03d9 Mon Sep 17 00:00:00 2001 1From 315838f92b83da62afd2800b57eddd03d0cfde58 Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com> 2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Wed, 25 Nov 2020 07:58:07 +0800 3Date: Wed, 25 Nov 2020 07:58:07 +0800
4Subject: [PATCH] qat: overwrite KBUILD_BUILTIN in kernel's Makefile 4Subject: [PATCH 08/11] qat: overwrite KBUILD_BUILTIN in kernel's Makefile
5 5
6Since kernel v5.10-rc1, commit 6212804f2d78 ("kbuild: do not create 6Since kernel v5.10-rc1, commit 6212804f2d78 ("kbuild: do not create
7built-in objects for external module builds"), QAT static libraries 7built-in objects for external module builds"), QAT static libraries
@@ -16,7 +16,7 @@ Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk b/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk 18diff --git a/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk b/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk
19index a692b37..302ae19 100644 19index 71bbeb7..8a5cfbc 100644
20--- a/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk 20--- a/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk
21+++ b/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk 21+++ b/quickassist/build_system/build_files/OS/linux_2.6_kernel_space_rules.mk
22@@ -72,7 +72,7 @@ endif 22@@ -72,7 +72,7 @@ endif
@@ -29,5 +29,5 @@ index a692b37..302ae19 100644
29 test -f lib.a && (ar -t lib.a | xargs ar -rcsD $(LIB_STATIC)); \ 29 test -f lib.a && (ar -t lib.a | xargs ar -rcsD $(LIB_STATIC)); \
30 test -f $(LIB_STATIC) && mv -f $(LIB_STATIC) $($(PROG_ACY)_FINAL_OUTPUT_DIR)/$(LIB_STATIC); \ 30 test -f $(LIB_STATIC) && mv -f $(LIB_STATIC) $($(PROG_ACY)_FINAL_OUTPUT_DIR)/$(LIB_STATIC); \
31-- 31--
322.14.4 322.14.5
33 33
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch b/recipes-extended/qat/files/0009-crypto-qat-Silence-smp_processor_id-warning.patch
index 262651f..d619cc3 100644
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch
+++ b/recipes-extended/qat/files/0009-crypto-qat-Silence-smp_processor_id-warning.patch
@@ -1,7 +1,7 @@
1From 21b67ec634271aafd73cffb3e73c0ba494dce3cd Mon Sep 17 00:00:00 2001 1From a79112f8673c3d4912bb28592e64a90f237a31e5 Mon Sep 17 00:00:00 2001
2From: Alexander Sverdlin <alexander.sverdlin@nokia.com> 2From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
3Date: Tue, 23 Jul 2019 07:24:01 +0000 3Date: Tue, 23 Jul 2019 07:24:01 +0000
4Subject: [PATCH] crypto: qat - Silence smp_processor_id() warning 4Subject: [PATCH 09/11] crypto: qat - Silence smp_processor_id() warning
5 5
6It seems that smp_processor_id() is only used for a best-effort 6It seems that smp_processor_id() is only used for a best-effort
7load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible 7load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible
@@ -55,7 +55,7 @@ Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
55 1 file changed, 1 insertion(+), 1 deletion(-) 55 1 file changed, 1 insertion(+), 1 deletion(-)
56 56
57diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h 57diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h
58index 08e3519..87dd5f1 100644 58index 8d57925..38bad69 100644
59--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h 59--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h
60+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h 60+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h
61@@ -100,7 +100,7 @@ struct service_hndl { 61@@ -100,7 +100,7 @@ struct service_hndl {
@@ -68,5 +68,5 @@ index 08e3519..87dd5f1 100644
68 68
69 int adf_service_register(struct service_hndl *service); 69 int adf_service_register(struct service_hndl *service);
70-- 70--
712.14.4 712.14.5
72 72
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch b/recipes-extended/qat/files/0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch
index cf22fa1..b86d1db 100644
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch
+++ b/recipes-extended/qat/files/0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch
@@ -1,8 +1,8 @@
1From f27fe17a282206b6d4e8c3ad8d5aac8757f38ab5 Mon Sep 17 00:00:00 2001 1From c9e04ec8d8be3a1f21a5bdc6c5c79f50191d57dd Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com> 2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Thu, 28 Jan 2021 13:07:59 +0800 3Date: Thu, 28 Jan 2021 13:07:59 +0800
4Subject: [PATCH] qat: include sha1.h and sha2.h instead of sha.h in kernel 4Subject: [PATCH 10/11] qat: include sha1.h and sha2.h instead of sha.h in
5 v5.11 5 kernel v5.11
6 6
7In kernel commit a24d22b225ce ("crypto: sha - split sha.h into sha1.h and sha2.h"), 7In kernel commit a24d22b225ce ("crypto: sha - split sha.h into sha1.h and sha2.h"),
8<crypto/sha.h> was split into two headers <crypto/sha1.h> and <crypto/sha2.h>. 8<crypto/sha.h> was split into two headers <crypto/sha1.h> and <crypto/sha2.h>.
@@ -11,17 +11,17 @@ Upstream-Status: Inappropriate [Code released in tarball form only]
11 11
12Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> 12Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
13--- 13---
14 quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c | 5 +++++ 14 quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c | 5 +++++
15 .../utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c | 7 +++++-- 15 .../utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c | 5 +++++
16 2 files changed, 10 insertions(+), 2 deletions(-) 16 2 files changed, 10 insertions(+)
17 17
18diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c 18diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
19index c4edb3c..a7961a4 100644 19index 37ac11e..08680ca 100644
20--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c 20--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
21+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c 21+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
22@@ -50,7 +50,12 @@ 22@@ -52,7 +52,12 @@
23 #include <linux/crypto.h>
24 #include <crypto/internal/aead.h> 23 #include <crypto/internal/aead.h>
24 #include <crypto/internal/skcipher.h>
25 #include <crypto/aes.h> 25 #include <crypto/aes.h>
26+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)) 26+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
27+#include <crypto/sha1.h> 27+#include <crypto/sha1.h>
@@ -33,27 +33,19 @@ index c4edb3c..a7961a4 100644
33 #include <crypto/algapi.h> 33 #include <crypto/algapi.h>
34 #include <crypto/authenc.h> 34 #include <crypto/authenc.h>
35diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 35diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
36index 92ee35b..483aef2 100644 36index 9d2e85c..de24fa0 100644
37--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 37--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
38+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 38+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
39@@ -66,15 +66,18 @@ 39@@ -69,7 +69,12 @@
40 40 #include <linux/version.h>
41 #include "Osal.h" 41 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
42 #include <linux/crypto.h> 42 #include <crypto/internal/hash.h>
43-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
44+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)) 43+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
45+#include <crypto/sha1.h> 44+#include <crypto/sha1.h>
46+#include <crypto/sha2.h> 45+#include <crypto/sha2.h>
47+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) 46+#else
48 #include <crypto/sha.h> 47 #include <crypto/sha.h>
49 #else 48+#endif
50 #include <linux/cryptohash.h>
51+#include <crypto/sha.h>
52 #endif
53 #include <linux/version.h>
54 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
55 #include <crypto/internal/hash.h>
56-#include <crypto/sha.h>
57 49
58 #define OSAL_MAX_SHASH_DECSIZE 512 50 #define OSAL_MAX_SHASH_DECSIZE 512
59 51
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-qat17-use-namespace-CRYPTO_INTERNAL.patch b/recipes-extended/qat/files/0011-qat17-use-namespace-CRYPTO_INTERNAL.patch
index a4fad3c..1a7a647 100644
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-qat17-use-namespace-CRYPTO_INTERNAL.patch
+++ b/recipes-extended/qat/files/0011-qat17-use-namespace-CRYPTO_INTERNAL.patch
@@ -1,7 +1,7 @@
1From 3b45583612822851a0841cff8381d8795c831a23 Mon Sep 17 00:00:00 2001 1From 9b2b7a79fc9d9323fe9ec44de7619ea175c45bc1 Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com> 2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Tue, 23 Mar 2021 09:31:25 +0000 3Date: Tue, 23 Mar 2021 09:31:25 +0000
4Subject: [PATCH] qat17: use namespace CRYPTO_INTERNAL 4Subject: [PATCH 11/11] qat17: use namespace CRYPTO_INTERNAL
5 5
6Due to kernel commit 0eb76ba29d16 ("crypto: remove cipher routines from 6Due to kernel commit 0eb76ba29d16 ("crypto: remove cipher routines from
7public crypto API") in v5.12-rc1, some crypto APIs are exported into a new 7public crypto API") in v5.12-rc1, some crypto APIs are exported into a new
@@ -11,12 +11,12 @@ Upstream-Status: Inappropriate [Code released in tarball form only]
11 11
12Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> 12Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
13--- 13---
14 quickassist/lookaside/access_layer/src/linux/icp_qa_module.c | 3 +++ 14 quickassist/lookaside/access_layer/src/linux/icp_qa_module.c | 3 +++
15 .../osal/src/linux/kernel_space/OsalCryptoInterface.c | 5 +++++ 15 .../utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c | 5 +++++
16 2 files changed, 8 insertions(+) 16 2 files changed, 8 insertions(+)
17 17
18diff --git a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c 18diff --git a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c
19index c9c6946..a9dd704 100644 19index 413eb07..f3a371e 100644
20--- a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c 20--- a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c
21+++ b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c 21+++ b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c
22@@ -120,3 +120,6 @@ module_exit(kapi_mod_exit); 22@@ -120,3 +120,6 @@ module_exit(kapi_mod_exit);
@@ -27,21 +27,21 @@ index c9c6946..a9dd704 100644
27+MODULE_IMPORT_NS(CRYPTO_INTERNAL); 27+MODULE_IMPORT_NS(CRYPTO_INTERNAL);
28+#endif 28+#endif
29diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 29diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
30index 483aef2..a150a86 100644 30index de24fa0..96c29c0 100644
31--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 31--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
32+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c 32+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
33@@ -66,6 +66,11 @@ 33@@ -75,6 +75,11 @@
34 34 #else
35 #include "Osal.h" 35 #include <crypto/sha.h>
36 #include <linux/crypto.h> 36 #endif
37+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)) 37+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0))
38+#include <crypto/internal/cipher.h> 38+#include <crypto/internal/cipher.h>
39+#include <linux/module.h> 39+#include <linux/module.h>
40+MODULE_IMPORT_NS(CRYPTO_INTERNAL); 40+MODULE_IMPORT_NS(CRYPTO_INTERNAL);
41+#endif 41+#endif
42 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)) 42
43 #include <crypto/sha1.h> 43 #define OSAL_MAX_SHASH_DECSIZE 512
44 #include <crypto/sha2.h> 44
45-- 45--
462.29.2 462.14.5
47 47
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-Drop-pr_warning-definition.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-Drop-pr_warning-definition.patch
deleted file mode 100644
index 6b816df..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-Drop-pr_warning-definition.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 058673d6798b835dce7f27fe172b7727bbaf30cf Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Wed, 15 Jan 2020 15:25:15 +0000
4Subject: [PATCH] qat: Drop pr_warning definition
5
6In mainline kernel commit 61ff72f40168 ("printk: Drop pr_warning
7definition"), pr_warning was dropped.
8
9Upstream-Status: Inappropriate [Code released in tarball form only]
10
11Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
12---
13 quickassist/utilities/libusdm_drv/linux/include/qae_mem_utils.h | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/quickassist/utilities/libusdm_drv/linux/include/qae_mem_utils.h b/quickassist/utilities/libusdm_drv/linux/include/qae_mem_utils.h
17index f4a56dc..d88e762 100644
18--- a/quickassist/utilities/libusdm_drv/linux/include/qae_mem_utils.h
19+++ b/quickassist/utilities/libusdm_drv/linux/include/qae_mem_utils.h
20@@ -93,7 +93,7 @@ MALLOC_DECLARE(M_QAE_MEM);
21
22 #define mm_info(...) pr_info(USDM_MOD __VA_ARGS__)
23
24-#define mm_warning(...) pr_warning(USDM_MOD __VA_ARGS__)
25+#define mm_warning(...) pr_warn(USDM_MOD __VA_ARGS__)
26
27 /*define types which need to vary between 32 and 64 bit*/
28 #define QAE_PAGE_SHIFT 12
29--
302.24.1
31
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-Link-driver-with-object-files.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-Link-driver-with-object-files.patch
deleted file mode 100644
index 0780426..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-Link-driver-with-object-files.patch
+++ /dev/null
@@ -1,91 +0,0 @@
1From 555a4b3605e983e492f8c67e38a094933bc7efcd Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Mon, 6 Jan 2020 09:26:39 +0800
4Subject: [PATCH] qat: Link driver with object files instead of archived files
5
6Due to mainline kernel commit 69ea912fda7 ("kbuild: remove unneeded
7link_multi_deps"), modules cannot link *.a archives. So change .a to
8.o files.
9
10Upstream-Status: Inappropriate [Temporary workaround for kernel later than
11v4.19-rc3]
12
13Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
14
15---
16 quickassist/Makefile | 2 ++
17 .../lookaside/access_layer/src/Makefile | 21 +++++++++----------
18 2 files changed, 12 insertions(+), 11 deletions(-)
19
20diff --git a/quickassist/Makefile b/quickassist/Makefile
21index 70a4353..5f6ee46 100644
22--- a/quickassist/Makefile
23+++ b/quickassist/Makefile
24@@ -154,6 +154,7 @@ libosal_kernel: clean output_dir lac_lib_dir
25 echo ; echo 'Copying OSAL library';
26 cp $(OSAL_PATH)/src/linux/kernel_space/build/linux_2.6/kernel_space/libosal.a $(ICP_BUILD_OUTPUT)/libosal_kernel.a;
27 cp $(OSAL_PATH)/src/linux/kernel_space/build/linux_2.6/kernel_space/libosal.a $(LAC_LIB_DIR)/;
28+ cp $(OSAL_PATH)/src/linux/kernel_space/build/linux_2.6/kernel_space/*.o $(LAC_LIB_DIR)/;
29
30
31 #build linux qat_direct layer
32@@ -169,6 +170,7 @@ qat_kernel: clean output_dir lac_lib_dir libosal_kernel cmn_ko
33 echo ; echo 'Copying qat_kernel library';
34 cp $(KERNEL_PATH)/src/build/linux_2.6/kernel_space/libadf_kernel.a $(ICP_BUILD_OUTPUT)/;
35 cp $(KERNEL_PATH)/src/build/linux_2.6/kernel_space/libadf_kernel.a $(LAC_LIB_DIR)/;
36+ cp $(KERNEL_PATH)/src/build/linux_2.6/kernel_space/*.o $(LAC_LIB_DIR)/;
37
38
39 lac_user: clean output_dir qat_direct libosal_user cmn_user cmn_ko
40diff --git a/quickassist/lookaside/access_layer/src/Makefile b/quickassist/lookaside/access_layer/src/Makefile
41index cc8cf2f..b8ec93c 100644
42--- a/quickassist/lookaside/access_layer/src/Makefile
43+++ b/quickassist/lookaside/access_layer/src/Makefile
44@@ -112,13 +112,13 @@ LIB_STATIC=$(OUTPUT_NAME).a
45 LIB_SHARED=$(OUTPUT_NAME).so
46
47 # add the path and list of source libraries,
48-ADDITIONAL_KERNEL_LIBS= common/utils/$(ICP_BUILD_OUTPUT_DIR)/utils.a \
49- common/ctrl/$(ICP_BUILD_OUTPUT_DIR)/init.a \
50- common/compression/$(ICP_BUILD_OUTPUT_DIR)/compression.a
51+ADDITIONAL_KERNEL_LIBS= common/utils/$(ICP_BUILD_OUTPUT_DIR)/*.o \
52+ common/ctrl/$(ICP_BUILD_OUTPUT_DIR)/*.o \
53+ common/compression/$(ICP_BUILD_OUTPUT_DIR)/*.o
54 ifndef ICP_DC_ONLY
55-ADDITIONAL_KERNEL_LIBS += common/crypto/sym/$(ICP_BUILD_OUTPUT_DIR)/sym.a \
56- common/crypto/sym/qat/$(ICP_BUILD_OUTPUT_DIR)/sym_qat.a \
57- common/crypto/sym/key/$(ICP_BUILD_OUTPUT_DIR)/sym_key.a
58+ADDITIONAL_KERNEL_LIBS += common/crypto/sym/$(ICP_BUILD_OUTPUT_DIR)/*.o \
59+ common/crypto/sym/qat/$(ICP_BUILD_OUTPUT_DIR)/*.o \
60+ common/crypto/sym/key/$(ICP_BUILD_OUTPUT_DIR)/*.o
61 ifeq ($(ICP_OS_LEVEL), user_space)
62 ADDITIONAL_KERNEL_LIBS += common/crypto/asym/pke_common/$(ICP_BUILD_OUTPUT_DIR)/pke_common.a \
63 common/crypto/asym/diffie_hellman/$(ICP_BUILD_OUTPUT_DIR)/diffie_hellman.a \
64@@ -128,14 +128,14 @@ ADDITIONAL_KERNEL_LIBS += common/crypto/asym/pke_common/$(ICP_BUILD_OUTPUT_DIR)/
65 common/crypto/asym/large_number/$(ICP_BUILD_OUTPUT_DIR)/ln.a \
66 common/crypto/asym/ecc/$(ICP_BUILD_OUTPUT_DIR)/elliptic_curve.a
67 else
68-ADDITIONAL_KERNEL_LIBS += common/stubs/$(ICP_BUILD_OUTPUT_DIR)/lib_lac_stubs.a
69+ADDITIONAL_KERNEL_LIBS += common/stubs/$(ICP_BUILD_OUTPUT_DIR)/*.o
70 endif
71 else
72 ifeq ($(ICP_OS_LEVEL), kernel_space)
73-ADDITIONAL_KERNEL_LIBS += common/stubs/$(ICP_BUILD_OUTPUT_DIR)/lib_lac_stubs.a
74+ADDITIONAL_KERNEL_LIBS += common/stubs/$(ICP_BUILD_OUTPUT_DIR)/*.o
75 endif
76 endif
77-ADDITIONAL_KERNEL_LIBS += common/qat_comms/$(ICP_BUILD_OUTPUT_DIR)/qat_comms.a
78+ADDITIONAL_KERNEL_LIBS += common/qat_comms/$(ICP_BUILD_OUTPUT_DIR)/*.o
79
80 ifeq ($(ICP_OS_LEVEL), user_space)
81 ifdef KPT
82@@ -145,8 +145,7 @@ endif
83 endif
84
85 ifeq ($(ICP_OS_LEVEL), kernel_space)
86- ADDITIONAL_OBJECTS = ../build/libs/libadf_kernel.a
87- ADDITIONAL_OBJECTS += ../build/libs/libosal.a
88+ ADDITIONAL_OBJECTS += ../build/libs/*.o
89 endif
90
91 ifeq ($(ICP_OS_LEVEL), user_space)
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-Switch-to-skcipher-API.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-Switch-to-skcipher-API.patch
deleted file mode 100644
index aa2f890..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-Switch-to-skcipher-API.patch
+++ /dev/null
@@ -1,1158 +0,0 @@
1From d12ae3d48d429e24ad4b0f219a16e09af8da3b1a Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Thu, 28 Jan 2021 10:02:22 +0000
4Subject: [PATCH] qat: Switch to skcipher API
5
6The patch is derived from mainline kernel commit 7fe948a52287
7("crypto: qat - switch to skcipher API").
8
9Upstream-Status: Inappropriate [Code released in tarball form only]
10
11Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
12---
13 .../drivers/crypto/qat/qat_common/qat_algs.c | 674 ++++++++++--------
14 .../crypto/qat/qat_common/qat_crypto.h | 6 +-
15 2 files changed, 394 insertions(+), 286 deletions(-)
16
17diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
18index a7961a4..f600ad3 100644
19--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
20+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
21@@ -49,6 +49,7 @@
22 #include <linux/slab.h>
23 #include <linux/crypto.h>
24 #include <crypto/internal/aead.h>
25+#include <crypto/internal/skcipher.h>
26 #include <crypto/aes.h>
27 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
28 #include <crypto/sha1.h>
29@@ -57,6 +58,7 @@
30 #include <crypto/sha.h>
31 #endif
32 #include <crypto/hash.h>
33+#include <crypto/hmac.h>
34 #include <crypto/algapi.h>
35 #include <crypto/authenc.h>
36 #include <linux/dma-mapping.h>
37@@ -118,11 +120,16 @@ struct qat_alg_aead_ctx {
38 struct crypto_shash *hash_tfm;
39 enum icp_qat_hw_auth_algo qat_hash_alg;
40 struct qat_crypto_instance *inst;
41- char ipad[SHA512_BLOCK_SIZE];
42+ union {
43+ struct sha1_state sha1;
44+ struct sha256_state sha256;
45+ struct sha512_state sha512;
46+ };
47+ char ipad[SHA512_BLOCK_SIZE]; /* sufficient for SHA-1/SHA-256 as well */
48 char opad[SHA512_BLOCK_SIZE];
49 };
50
51-struct qat_alg_ablkcipher_ctx {
52+struct qat_alg_skcipher_ctx {
53 struct icp_qat_hw_cipher_algo_blk *enc_cd;
54 struct icp_qat_hw_cipher_algo_blk *dec_cd;
55 dma_addr_t enc_cd_paddr;
56@@ -130,7 +137,7 @@ struct qat_alg_ablkcipher_ctx {
57 struct icp_qat_fw_la_bulk_req enc_fw_req;
58 struct icp_qat_fw_la_bulk_req dec_fw_req;
59 struct qat_crypto_instance *inst;
60- struct crypto_tfm *tfm;
61+ struct crypto_skcipher *tfm;
62 };
63
64 static int qat_get_inter_state_size(enum icp_qat_hw_auth_algo qat_hash_alg)
65@@ -154,9 +161,6 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
66 unsigned int auth_keylen)
67 {
68 SHASH_DESC_ON_STACK(shash, ctx->hash_tfm);
69- struct sha1_state sha1;
70- struct sha256_state sha256;
71- struct sha512_state sha512;
72 int block_size = crypto_shash_blocksize(ctx->hash_tfm);
73 int digest_size = crypto_shash_digestsize(ctx->hash_tfm);
74 __be32 *hash_state_out;
75@@ -165,7 +169,6 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
76
77 memset(ctx->ipad, 0, block_size);
78 memset(ctx->opad, 0, block_size);
79- memset(shash, 0, sizeof(struct shash_desc));
80 shash->tfm = ctx->hash_tfm;
81
82 if (auth_keylen > block_size) {
83@@ -183,8 +186,8 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
84 for (i = 0; i < block_size; i++) {
85 char *ipad_ptr = ctx->ipad + i;
86 char *opad_ptr = ctx->opad + i;
87- *ipad_ptr ^= 0x36;
88- *opad_ptr ^= 0x5C;
89+ *ipad_ptr ^= HMAC_IPAD_VALUE;
90+ *opad_ptr ^= HMAC_OPAD_VALUE;
91 }
92
93 if (crypto_shash_init(shash))
94@@ -198,22 +201,22 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
95
96 switch (ctx->qat_hash_alg) {
97 case ICP_QAT_HW_AUTH_ALGO_SHA1:
98- if (crypto_shash_export(shash, &sha1))
99+ if (crypto_shash_export(shash, &ctx->sha1))
100 return -EFAULT;
101 for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
102- *hash_state_out = cpu_to_be32(*(sha1.state + i));
103+ *hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
104 break;
105 case ICP_QAT_HW_AUTH_ALGO_SHA256:
106- if (crypto_shash_export(shash, &sha256))
107+ if (crypto_shash_export(shash, &ctx->sha256))
108 return -EFAULT;
109 for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
110- *hash_state_out = cpu_to_be32(*(sha256.state + i));
111+ *hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
112 break;
113 case ICP_QAT_HW_AUTH_ALGO_SHA512:
114- if (crypto_shash_export(shash, &sha512))
115+ if (crypto_shash_export(shash, &ctx->sha512))
116 return -EFAULT;
117 for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
118- *hash512_state_out = cpu_to_be64(*(sha512.state + i));
119+ *hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);
120 break;
121 default:
122 return -EFAULT;
123@@ -234,22 +237,22 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
124
125 switch (ctx->qat_hash_alg) {
126 case ICP_QAT_HW_AUTH_ALGO_SHA1:
127- if (crypto_shash_export(shash, &sha1))
128+ if (crypto_shash_export(shash, &ctx->sha1))
129 return -EFAULT;
130 for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
131- *hash_state_out = cpu_to_be32(*(sha1.state + i));
132+ *hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
133 break;
134 case ICP_QAT_HW_AUTH_ALGO_SHA256:
135- if (crypto_shash_export(shash, &sha256))
136+ if (crypto_shash_export(shash, &ctx->sha256))
137 return -EFAULT;
138 for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
139- *hash_state_out = cpu_to_be32(*(sha256.state + i));
140+ *hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
141 break;
142 case ICP_QAT_HW_AUTH_ALGO_SHA512:
143- if (crypto_shash_export(shash, &sha512))
144+ if (crypto_shash_export(shash, &ctx->sha512))
145 return -EFAULT;
146 for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
147- *hash512_state_out = cpu_to_be64(*(sha512.state + i));
148+ *hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);
149 break;
150 default:
151 return -EFAULT;
152@@ -259,7 +262,24 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
153 return 0;
154 }
155
156-static void qat_alg_init_common_hdr(struct icp_qat_fw_comn_req_hdr *header)
157+static void qat_alg_init_hdr_iv_updt(struct icp_qat_fw_comn_req_hdr *header)
158+{
159+ ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(header->serv_specif_flags,
160+ ICP_QAT_FW_CIPH_IV_64BIT_PTR);
161+ ICP_QAT_FW_LA_UPDATE_STATE_SET(header->serv_specif_flags,
162+ ICP_QAT_FW_LA_UPDATE_STATE);
163+}
164+
165+static void qat_alg_init_hdr_no_iv_updt(struct icp_qat_fw_comn_req_hdr *header)
166+{
167+ ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(header->serv_specif_flags,
168+ ICP_QAT_FW_CIPH_IV_16BYTE_DATA);
169+ ICP_QAT_FW_LA_UPDATE_STATE_SET(header->serv_specif_flags,
170+ ICP_QAT_FW_LA_NO_UPDATE_STATE);
171+}
172+
173+static void qat_alg_init_common_hdr(struct icp_qat_fw_comn_req_hdr *header,
174+ int aead)
175 {
176 header->hdr_flags =
177 ICP_QAT_FW_COMN_HDR_FLAGS_BUILD(ICP_QAT_FW_COMN_REQ_FLAG_SET);
178@@ -269,12 +289,12 @@ static void qat_alg_init_common_hdr(struct icp_qat_fw_comn_req_hdr *header)
179 QAT_COMN_PTR_TYPE_SGL);
180 ICP_QAT_FW_LA_PARTIAL_SET(header->serv_specif_flags,
181 ICP_QAT_FW_LA_PARTIAL_NONE);
182- ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(header->serv_specif_flags,
183- ICP_QAT_FW_CIPH_IV_16BYTE_DATA);
184+ if (aead)
185+ qat_alg_init_hdr_no_iv_updt(header);
186+ else
187+ qat_alg_init_hdr_iv_updt(header);
188 ICP_QAT_FW_LA_PROTO_SET(header->serv_specif_flags,
189 ICP_QAT_FW_LA_NO_PROTO);
190- ICP_QAT_FW_LA_UPDATE_STATE_SET(header->serv_specif_flags,
191- ICP_QAT_FW_LA_NO_UPDATE_STATE);
192 }
193
194 static int qat_alg_aead_init_enc_session(struct crypto_aead *aead_tfm,
195@@ -309,7 +329,7 @@ static int qat_alg_aead_init_enc_session(struct crypto_aead *aead_tfm,
196 return -EFAULT;
197
198 /* Request setup */
199- qat_alg_init_common_hdr(header);
200+ qat_alg_init_common_hdr(header, 1);
201 header->service_cmd_id = ICP_QAT_FW_LA_CMD_CIPHER_HASH;
202 ICP_QAT_FW_LA_DIGEST_IN_BUFFER_SET(header->serv_specif_flags,
203 ICP_QAT_FW_LA_DIGEST_IN_BUFFER);
204@@ -396,7 +416,7 @@ static int qat_alg_aead_init_dec_session(struct crypto_aead *aead_tfm,
205 return -EFAULT;
206
207 /* Request setup */
208- qat_alg_init_common_hdr(header);
209+ qat_alg_init_common_hdr(header, 1);
210 header->service_cmd_id = ICP_QAT_FW_LA_CMD_HASH_CIPHER;
211 ICP_QAT_FW_LA_DIGEST_IN_BUFFER_SET(header->serv_specif_flags,
212 ICP_QAT_FW_LA_DIGEST_IN_BUFFER);
213@@ -450,17 +470,17 @@ static int qat_alg_aead_init_dec_session(struct crypto_aead *aead_tfm,
214 return 0;
215 }
216
217-static void qat_alg_ablkcipher_init_com(struct qat_alg_ablkcipher_ctx *ctx,
218- struct icp_qat_fw_la_bulk_req *req,
219- struct icp_qat_hw_cipher_algo_blk *cd,
220- const uint8_t *key, unsigned int keylen)
221+static void qat_alg_skcipher_init_com(struct qat_alg_skcipher_ctx *ctx,
222+ struct icp_qat_fw_la_bulk_req *req,
223+ struct icp_qat_hw_cipher_algo_blk *cd,
224+ const uint8_t *key, unsigned int keylen)
225 {
226 struct icp_qat_fw_comn_req_hdr_cd_pars *cd_pars = &req->cd_pars;
227 struct icp_qat_fw_comn_req_hdr *header = &req->comn_hdr;
228 struct icp_qat_fw_cipher_cd_ctrl_hdr *cd_ctrl = (void *)&req->cd_ctrl;
229
230 memcpy(cd->aes.key, key, keylen);
231- qat_alg_init_common_hdr(header);
232+ qat_alg_init_common_hdr(header, 0);
233 header->service_cmd_id = ICP_QAT_FW_LA_CMD_CIPHER;
234 cd_pars->u.s.content_desc_params_sz =
235 sizeof(struct icp_qat_hw_cipher_algo_blk) >> 3;
236@@ -472,28 +492,28 @@ static void qat_alg_ablkcipher_init_com(struct qat_alg_ablkcipher_ctx *ctx,
237 ICP_QAT_FW_COMN_NEXT_ID_SET(cd_ctrl, ICP_QAT_FW_SLICE_DRAM_WR);
238 }
239
240-static void qat_alg_ablkcipher_init_enc(struct qat_alg_ablkcipher_ctx *ctx,
241- int alg, const uint8_t *key,
242- unsigned int keylen, int mode)
243+static void qat_alg_skcipher_init_enc(struct qat_alg_skcipher_ctx *ctx,
244+ int alg, const uint8_t *key,
245+ unsigned int keylen, int mode)
246 {
247 struct icp_qat_hw_cipher_algo_blk *enc_cd = ctx->enc_cd;
248 struct icp_qat_fw_la_bulk_req *req = &ctx->enc_fw_req;
249 struct icp_qat_fw_comn_req_hdr_cd_pars *cd_pars = &req->cd_pars;
250
251- qat_alg_ablkcipher_init_com(ctx, req, enc_cd, key, keylen);
252+ qat_alg_skcipher_init_com(ctx, req, enc_cd, key, keylen);
253 cd_pars->u.s.content_desc_addr = ctx->enc_cd_paddr;
254 enc_cd->aes.cipher_config.val = QAT_AES_HW_CONFIG_ENC(alg, mode);
255 }
256
257-static void qat_alg_ablkcipher_init_dec(struct qat_alg_ablkcipher_ctx *ctx,
258- int alg, const uint8_t *key,
259- unsigned int keylen, int mode)
260+static void qat_alg_skcipher_init_dec(struct qat_alg_skcipher_ctx *ctx,
261+ int alg, const uint8_t *key,
262+ unsigned int keylen, int mode)
263 {
264 struct icp_qat_hw_cipher_algo_blk *dec_cd = ctx->dec_cd;
265 struct icp_qat_fw_la_bulk_req *req = &ctx->dec_fw_req;
266 struct icp_qat_fw_comn_req_hdr_cd_pars *cd_pars = &req->cd_pars;
267
268- qat_alg_ablkcipher_init_com(ctx, req, dec_cd, key, keylen);
269+ qat_alg_skcipher_init_com(ctx, req, dec_cd, key, keylen);
270 cd_pars->u.s.content_desc_addr = ctx->dec_cd_paddr;
271
272 if (mode != ICP_QAT_HW_CIPHER_CTR_MODE)
273@@ -553,86 +573,110 @@ static int qat_alg_aead_init_sessions(struct crypto_aead *tfm, const u8 *key,
274 if (qat_alg_aead_init_dec_session(tfm, alg, &keys, mode))
275 goto error;
276
277+ memzero_explicit(&keys, sizeof(keys));
278 return 0;
279 bad_key:
280 crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
281+ memzero_explicit(&keys, sizeof(keys));
282 return -EINVAL;
283 error:
284+ memzero_explicit(&keys, sizeof(keys));
285 return -EFAULT;
286 }
287
288-static int qat_alg_ablkcipher_init_sessions(struct qat_alg_ablkcipher_ctx *ctx,
289- const uint8_t *key,
290- unsigned int keylen,
291- int mode)
292+static int qat_alg_skcipher_init_sessions(struct qat_alg_skcipher_ctx *ctx,
293+ const uint8_t *key,
294+ unsigned int keylen,
295+ int mode)
296 {
297 int alg;
298
299 if (qat_alg_validate_key(keylen, &alg, mode))
300 goto bad_key;
301
302- qat_alg_ablkcipher_init_enc(ctx, alg, key, keylen, mode);
303- qat_alg_ablkcipher_init_dec(ctx, alg, key, keylen, mode);
304+ qat_alg_skcipher_init_enc(ctx, alg, key, keylen, mode);
305+ qat_alg_skcipher_init_dec(ctx, alg, key, keylen, mode);
306 return 0;
307 bad_key:
308- crypto_tfm_set_flags(ctx->tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
309+ crypto_skcipher_set_flags(ctx->tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
310 return -EINVAL;
311 }
312
313-static int qat_alg_aead_setkey(struct crypto_aead *tfm, const uint8_t *key,
314+static int qat_alg_aead_rekey(struct crypto_aead *tfm, const uint8_t *key,
315+ unsigned int keylen)
316+{
317+ struct qat_alg_aead_ctx *ctx = crypto_aead_ctx(tfm);
318+
319+ memset(ctx->enc_cd, 0, sizeof(*ctx->enc_cd));
320+ memset(ctx->dec_cd, 0, sizeof(*ctx->dec_cd));
321+ memset(&ctx->enc_fw_req, 0, sizeof(ctx->enc_fw_req));
322+ memset(&ctx->dec_fw_req, 0, sizeof(ctx->dec_fw_req));
323+
324+ return qat_alg_aead_init_sessions(tfm, key, keylen,
325+ ICP_QAT_HW_CIPHER_CBC_MODE);
326+}
327+
328+static int qat_alg_aead_newkey(struct crypto_aead *tfm, const uint8_t *key,
329 unsigned int keylen)
330 {
331 struct qat_alg_aead_ctx *ctx = crypto_aead_ctx(tfm);
332+ struct qat_crypto_instance *inst = NULL;
333+ int node = get_current_node();
334 struct device *dev;
335+ int ret;
336
337- if (ctx->enc_cd) {
338- /* rekeying */
339- dev = &GET_DEV(ctx->inst->accel_dev);
340- memset(ctx->enc_cd, 0, sizeof(*ctx->enc_cd));
341- memset(ctx->dec_cd, 0, sizeof(*ctx->dec_cd));
342- memset(&ctx->enc_fw_req, 0, sizeof(ctx->enc_fw_req));
343- memset(&ctx->dec_fw_req, 0, sizeof(ctx->dec_fw_req));
344- } else {
345- /* new key */
346- int node = get_current_node();
347- struct qat_crypto_instance *inst =
348- qat_crypto_get_instance_node(node);
349- if (!inst) {
350- return -EINVAL;
351- }
352-
353- dev = &GET_DEV(inst->accel_dev);
354- ctx->inst = inst;
355- ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
356- &ctx->enc_cd_paddr,
357- GFP_ATOMIC);
358- if (!ctx->enc_cd) {
359- return -ENOMEM;
360- }
361- ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
362- &ctx->dec_cd_paddr,
363- GFP_ATOMIC);
364- if (!ctx->dec_cd) {
365- goto out_free_enc;
366- }
367+ inst = qat_crypto_get_instance_node(node);
368+ if (!inst)
369+ return -EINVAL;
370+ dev = &GET_DEV(inst->accel_dev);
371+ ctx->inst = inst;
372+ ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
373+ &ctx->enc_cd_paddr,
374+ GFP_ATOMIC);
375+ if (!ctx->enc_cd) {
376+ ret = -ENOMEM;
377+ goto out_free_inst;
378 }
379- if (qat_alg_aead_init_sessions(tfm, key, keylen,
380- ICP_QAT_HW_CIPHER_CBC_MODE))
381+ ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
382+ &ctx->dec_cd_paddr,
383+ GFP_ATOMIC);
384+ if (!ctx->dec_cd) {
385+ ret = -ENOMEM;
386+ goto out_free_enc;
387+ }
388+
389+ ret = qat_alg_aead_init_sessions(tfm, key, keylen,
390+ ICP_QAT_HW_CIPHER_CBC_MODE);
391+ if (ret)
392 goto out_free_all;
393
394 return 0;
395
396 out_free_all:
397- memzero_explicit(ctx->dec_cd, sizeof(struct qat_alg_cd));
398+ memset(ctx->dec_cd, 0, sizeof(struct qat_alg_cd));
399 dma_free_coherent(dev, sizeof(struct qat_alg_cd),
400 ctx->dec_cd, ctx->dec_cd_paddr);
401 ctx->dec_cd = NULL;
402 out_free_enc:
403- memzero_explicit(ctx->enc_cd, sizeof(struct qat_alg_cd));
404+ memset(ctx->enc_cd, 0, sizeof(struct qat_alg_cd));
405 dma_free_coherent(dev, sizeof(struct qat_alg_cd),
406 ctx->enc_cd, ctx->enc_cd_paddr);
407 ctx->enc_cd = NULL;
408- return -ENOMEM;
409+out_free_inst:
410+ ctx->inst = NULL;
411+ qat_crypto_put_instance(inst);
412+ return ret;
413+}
414+
415+static int qat_alg_aead_setkey(struct crypto_aead *tfm, const uint8_t *key,
416+ unsigned int keylen)
417+{
418+ struct qat_alg_aead_ctx *ctx = crypto_aead_ctx(tfm);
419+
420+ if (ctx->enc_cd)
421+ return qat_alg_aead_rekey(tfm, key, keylen);
422+ else
423+ return qat_alg_aead_newkey(tfm, key, keylen);
424 }
425
426 static void qat_alg_free_bufl(struct qat_crypto_instance *inst,
427@@ -680,8 +724,7 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
428 dma_addr_t blp;
429 dma_addr_t bloutp = 0;
430 struct scatterlist *sg;
431- size_t sz_out, sz = sizeof(struct qat_alg_buf_list) +
432- ((1 + n) * sizeof(struct qat_alg_buf));
433+ size_t sz_out, sz = struct_size(bufl, bufers, n + 1);
434
435 if (unlikely(!n))
436 return -EINVAL;
437@@ -693,7 +736,7 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
438
439 blp = dma_map_single(dev, bufl, sz, DMA_TO_DEVICE);
440 if (unlikely(dma_mapping_error(dev, blp)))
441- goto err;
442+ goto err_in;
443
444 for_each_sg(sgl, sg, n, i) {
445 int y = sg_nctr;
446@@ -706,7 +749,7 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
447 DMA_BIDIRECTIONAL);
448 bufl->bufers[y].len = sg->length;
449 if (unlikely(dma_mapping_error(dev, bufl->bufers[y].addr)))
450- goto err;
451+ goto err_in;
452 sg_nctr++;
453 }
454 bufl->num_bufs = sg_nctr;
455@@ -718,16 +761,15 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
456 struct qat_alg_buf *bufers;
457
458 n = sg_nents(sglout);
459- sz_out = sizeof(struct qat_alg_buf_list) +
460- ((1 + n) * sizeof(struct qat_alg_buf));
461+ sz_out = struct_size(buflout, bufers, n + 1);
462 sg_nctr = 0;
463 buflout = kzalloc_node(sz_out, GFP_ATOMIC,
464 dev_to_node(&GET_DEV(inst->accel_dev)));
465 if (unlikely(!buflout))
466- goto err;
467+ goto err_in;
468 bloutp = dma_map_single(dev, buflout, sz_out, DMA_TO_DEVICE);
469 if (unlikely(dma_mapping_error(dev, bloutp)))
470- goto err;
471+ goto err_out;
472 bufers = buflout->bufers;
473 for_each_sg(sglout, sg, n, i) {
474 int y = sg_nctr;
475@@ -739,7 +781,7 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
476 sg->length,
477 DMA_BIDIRECTIONAL);
478 if (unlikely(dma_mapping_error(dev, bufers[y].addr)))
479- goto err;
480+ goto err_out;
481 bufers[y].len = sg->length;
482 sg_nctr++;
483 }
484@@ -754,8 +796,20 @@ static int qat_alg_sgl_to_bufl(struct qat_crypto_instance *inst,
485 qat_req->buf.sz_out = 0;
486 }
487 return 0;
488-err:
489- dev_err(dev, "Failed to map buf for dma\n");
490+
491+err_out:
492+ n = sg_nents(sglout);
493+ for (i = 0; i < n; i++)
494+ if (!dma_mapping_error(dev, buflout->bufers[i].addr))
495+ dma_unmap_single(dev, buflout->bufers[i].addr,
496+ buflout->bufers[i].len,
497+ DMA_BIDIRECTIONAL);
498+ if (!dma_mapping_error(dev, bloutp))
499+ dma_unmap_single(dev, bloutp, sz_out, DMA_TO_DEVICE);
500+ kfree(buflout);
501+
502+err_in:
503+ n = sg_nents(sgl);
504 for (i = 0; i < n; i++)
505 if (!dma_mapping_error(dev, bufl->bufers[i].addr))
506 dma_unmap_single(dev, bufl->bufers[i].addr,
507@@ -765,17 +819,8 @@ err:
508 if (!dma_mapping_error(dev, blp))
509 dma_unmap_single(dev, blp, sz, DMA_TO_DEVICE);
510 kfree(bufl);
511- if (sgl != sglout && buflout) {
512- n = sg_nents(sglout);
513- for (i = 0; i < n; i++)
514- if (!dma_mapping_error(dev, buflout->bufers[i].addr))
515- dma_unmap_single(dev, buflout->bufers[i].addr,
516- buflout->bufers[i].len,
517- DMA_BIDIRECTIONAL);
518- if (!dma_mapping_error(dev, bloutp))
519- dma_unmap_single(dev, bloutp, sz_out, DMA_TO_DEVICE);
520- kfree(buflout);
521- }
522+
523+ dev_err(dev, "Failed to map buf for dma\n");
524 return -ENOMEM;
525 }
526
527@@ -794,19 +839,25 @@ static void qat_aead_alg_callback(struct icp_qat_fw_la_resp *qat_resp,
528 areq->base.complete(&areq->base, res);
529 }
530
531-static void qat_ablkcipher_alg_callback(struct icp_qat_fw_la_resp *qat_resp,
532- struct qat_crypto_request *qat_req)
533+static void qat_skcipher_alg_callback(struct icp_qat_fw_la_resp *qat_resp,
534+ struct qat_crypto_request *qat_req)
535 {
536- struct qat_alg_ablkcipher_ctx *ctx = qat_req->ablkcipher_ctx;
537+ struct qat_alg_skcipher_ctx *ctx = qat_req->skcipher_ctx;
538 struct qat_crypto_instance *inst = ctx->inst;
539- struct ablkcipher_request *areq = qat_req->ablkcipher_req;
540+ struct skcipher_request *sreq = qat_req->skcipher_req;
541 uint8_t stat_filed = qat_resp->comn_resp.comn_status;
542+ struct device *dev = &GET_DEV(ctx->inst->accel_dev);
543 int res = 0, qat_res = ICP_QAT_FW_COMN_RESP_CRYPTO_STAT_GET(stat_filed);
544
545 qat_alg_free_bufl(inst, qat_req);
546 if (unlikely(qat_res != ICP_QAT_FW_COMN_STATUS_FLAG_OK))
547 res = -EINVAL;
548- areq->base.complete(&areq->base, res);
549+
550+ memcpy(sreq->iv, qat_req->iv, AES_BLOCK_SIZE);
551+ dma_free_coherent(dev, AES_BLOCK_SIZE, qat_req->iv,
552+ qat_req->iv_paddr);
553+
554+ sreq->base.complete(&sreq->base, res);
555 }
556
557 void qat_alg_callback(void *resp)
558@@ -828,7 +879,7 @@ static int qat_alg_aead_dec(struct aead_request *areq)
559 struct icp_qat_fw_la_auth_req_params *auth_param;
560 struct icp_qat_fw_la_bulk_req *msg;
561 int digst_size = crypto_aead_authsize(aead_tfm);
562- int ret;
563+ int ret, ctr = 0;
564
565 ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
566 if (unlikely(ret))
567@@ -849,13 +900,14 @@ static int qat_alg_aead_dec(struct aead_request *areq)
568 auth_param = (void *)((uint8_t *)cipher_param + sizeof(*cipher_param));
569 auth_param->auth_off = 0;
570 auth_param->auth_len = areq->assoclen + cipher_param->cipher_length;
571-
572 do {
573 ret = adf_send_message(ctx->inst->sym_tx, (uint32_t *)msg);
574- if (ret)
575- cond_resched();
576- } while (ret == -EAGAIN);
577+ } while (ret == -EAGAIN && ctr++ < 10);
578
579+ if (ret == -EAGAIN) {
580+ qat_alg_free_bufl(ctx->inst, qat_req);
581+ return -EBUSY;
582+ }
583 return -EINPROGRESS;
584 }
585
586@@ -869,7 +921,7 @@ static int qat_alg_aead_enc(struct aead_request *areq)
587 struct icp_qat_fw_la_auth_req_params *auth_param;
588 struct icp_qat_fw_la_bulk_req *msg;
589 uint8_t *iv = areq->iv;
590- int ret;
591+ int ret, ctr = 0;
592
593 ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
594 if (unlikely(ret))
595@@ -895,159 +947,230 @@ static int qat_alg_aead_enc(struct aead_request *areq)
596
597 do {
598 ret = adf_send_message(ctx->inst->sym_tx, (uint32_t *)msg);
599- if (ret)
600- cond_resched();
601- } while (ret == -EAGAIN);
602+ } while (ret == -EAGAIN && ctr++ < 10);
603
604+ if (ret == -EAGAIN) {
605+ qat_alg_free_bufl(ctx->inst, qat_req);
606+ return -EBUSY;
607+ }
608 return -EINPROGRESS;
609 }
610
611-static int qat_alg_ablkcipher_setkey(struct crypto_ablkcipher *tfm,
612- const u8 *key, unsigned int keylen,
613- int mode)
614+static int qat_alg_skcipher_rekey(struct qat_alg_skcipher_ctx *ctx,
615+ const u8 *key, unsigned int keylen,
616+ int mode)
617 {
618- struct qat_alg_ablkcipher_ctx *ctx = crypto_ablkcipher_ctx(tfm);
619- struct device *dev;
620+ memset(ctx->enc_cd, 0, sizeof(*ctx->enc_cd));
621+ memset(ctx->dec_cd, 0, sizeof(*ctx->dec_cd));
622+ memset(&ctx->enc_fw_req, 0, sizeof(ctx->enc_fw_req));
623+ memset(&ctx->dec_fw_req, 0, sizeof(ctx->dec_fw_req));
624
625- if (ctx->enc_cd) {
626- /* rekeying */
627- dev = &GET_DEV(ctx->inst->accel_dev);
628- memset(ctx->enc_cd, 0, sizeof(*ctx->enc_cd));
629- memset(ctx->dec_cd, 0, sizeof(*ctx->dec_cd));
630- memset(&ctx->enc_fw_req, 0, sizeof(ctx->enc_fw_req));
631- memset(&ctx->dec_fw_req, 0, sizeof(ctx->dec_fw_req));
632- } else {
633- /* new key */
634- int node = get_current_node();
635- struct qat_crypto_instance *inst =
636- qat_crypto_get_instance_node(node);
637- if (!inst)
638- return -EINVAL;
639+ return qat_alg_skcipher_init_sessions(ctx, key, keylen, mode);
640+}
641+
642+static int qat_alg_skcipher_newkey(struct qat_alg_skcipher_ctx *ctx,
643+ const u8 *key, unsigned int keylen,
644+ int mode)
645+{
646+ struct qat_crypto_instance *inst = NULL;
647+ struct device *dev;
648+ int node = get_current_node();
649+ int ret;
650
651- dev = &GET_DEV(inst->accel_dev);
652- ctx->inst = inst;
653- ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
654- &ctx->enc_cd_paddr,
655- GFP_ATOMIC);
656- if (!ctx->enc_cd)
657- return -ENOMEM;
658- ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
659- &ctx->dec_cd_paddr,
660- GFP_ATOMIC);
661- if (!ctx->dec_cd)
662- goto out_free_enc;
663+ inst = qat_crypto_get_instance_node(node);
664+ if (!inst)
665+ return -EINVAL;
666+ dev = &GET_DEV(inst->accel_dev);
667+ ctx->inst = inst;
668+ ctx->enc_cd = dma_alloc_coherent(dev, sizeof(*ctx->enc_cd),
669+ &ctx->enc_cd_paddr,
670+ GFP_ATOMIC);
671+ if (!ctx->enc_cd) {
672+ ret = -ENOMEM;
673+ goto out_free_instance;
674+ }
675+ ctx->dec_cd = dma_alloc_coherent(dev, sizeof(*ctx->dec_cd),
676+ &ctx->dec_cd_paddr,
677+ GFP_ATOMIC);
678+ if (!ctx->dec_cd) {
679+ ret = -ENOMEM;
680+ goto out_free_enc;
681 }
682- if (qat_alg_ablkcipher_init_sessions(ctx, key, keylen, mode))
683+
684+ ret = qat_alg_skcipher_init_sessions(ctx, key, keylen, mode);
685+ if (ret)
686 goto out_free_all;
687
688 return 0;
689
690 out_free_all:
691- memzero_explicit(ctx->dec_cd, sizeof(*ctx->dec_cd));
692+ memset(ctx->dec_cd, 0, sizeof(*ctx->dec_cd));
693 dma_free_coherent(dev, sizeof(*ctx->dec_cd),
694 ctx->dec_cd, ctx->dec_cd_paddr);
695 ctx->dec_cd = NULL;
696 out_free_enc:
697- memzero_explicit(ctx->enc_cd, sizeof(*ctx->enc_cd));
698+ memset(ctx->enc_cd, 0, sizeof(*ctx->enc_cd));
699 dma_free_coherent(dev, sizeof(*ctx->enc_cd),
700 ctx->enc_cd, ctx->enc_cd_paddr);
701 ctx->enc_cd = NULL;
702- return -ENOMEM;
703+out_free_instance:
704+ ctx->inst = NULL;
705+ qat_crypto_put_instance(inst);
706+ return ret;
707 }
708
709-static int qat_alg_ablkcipher_cbc_setkey(struct crypto_ablkcipher *tfm,
710- const u8 *key, unsigned int keylen)
711+static int qat_alg_skcipher_setkey(struct crypto_skcipher *tfm,
712+ const u8 *key, unsigned int keylen,
713+ int mode)
714 {
715- return qat_alg_ablkcipher_setkey(tfm, key, keylen,
716- ICP_QAT_HW_CIPHER_CBC_MODE);
717+ struct qat_alg_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
718+
719+ if (ctx->enc_cd)
720+ return qat_alg_skcipher_rekey(ctx, key, keylen, mode);
721+ else
722+ return qat_alg_skcipher_newkey(ctx, key, keylen, mode);
723+}
724+
725+static int qat_alg_skcipher_cbc_setkey(struct crypto_skcipher *tfm,
726+ const u8 *key, unsigned int keylen)
727+{
728+ return qat_alg_skcipher_setkey(tfm, key, keylen,
729+ ICP_QAT_HW_CIPHER_CBC_MODE);
730 }
731
732-static int qat_alg_ablkcipher_ctr_setkey(struct crypto_ablkcipher *tfm,
733- const u8 *key, unsigned int keylen)
734+static int qat_alg_skcipher_ctr_setkey(struct crypto_skcipher *tfm,
735+ const u8 *key, unsigned int keylen)
736 {
737- return qat_alg_ablkcipher_setkey(tfm, key, keylen,
738- ICP_QAT_HW_CIPHER_CTR_MODE);
739+ return qat_alg_skcipher_setkey(tfm, key, keylen,
740+ ICP_QAT_HW_CIPHER_CTR_MODE);
741 }
742
743-static int qat_alg_ablkcipher_xts_setkey(struct crypto_ablkcipher *tfm,
744- const u8 *key, unsigned int keylen)
745+static int qat_alg_skcipher_xts_setkey(struct crypto_skcipher *tfm,
746+ const u8 *key, unsigned int keylen)
747 {
748- return qat_alg_ablkcipher_setkey(tfm, key, keylen,
749- ICP_QAT_HW_CIPHER_XTS_MODE);
750+ return qat_alg_skcipher_setkey(tfm, key, keylen,
751+ ICP_QAT_HW_CIPHER_XTS_MODE);
752 }
753
754-static int qat_alg_ablkcipher_encrypt(struct ablkcipher_request *req)
755+static int qat_alg_skcipher_encrypt(struct skcipher_request *req)
756 {
757- struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req);
758- struct crypto_tfm *tfm = crypto_ablkcipher_tfm(atfm);
759- struct qat_alg_ablkcipher_ctx *ctx = crypto_tfm_ctx(tfm);
760- struct qat_crypto_request *qat_req = ablkcipher_request_ctx(req);
761+ struct crypto_skcipher *stfm = crypto_skcipher_reqtfm(req);
762+ struct crypto_tfm *tfm = crypto_skcipher_tfm(stfm);
763+ struct qat_alg_skcipher_ctx *ctx = crypto_tfm_ctx(tfm);
764+ struct qat_crypto_request *qat_req = skcipher_request_ctx(req);
765 struct icp_qat_fw_la_cipher_req_params *cipher_param;
766 struct icp_qat_fw_la_bulk_req *msg;
767- int ret;
768+ struct device *dev = &GET_DEV(ctx->inst->accel_dev);
769+ int ret, ctr = 0;
770+
771+ if (req->cryptlen == 0)
772+ return 0;
773+
774+ qat_req->iv = dma_alloc_coherent(dev, AES_BLOCK_SIZE,
775+ &qat_req->iv_paddr, GFP_ATOMIC);
776+ if (!qat_req->iv)
777+ return -ENOMEM;
778
779 ret = qat_alg_sgl_to_bufl(ctx->inst, req->src, req->dst, qat_req);
780- if (unlikely(ret))
781+ if (unlikely(ret)) {
782+ dma_free_coherent(dev, AES_BLOCK_SIZE, qat_req->iv,
783+ qat_req->iv_paddr);
784 return ret;
785+ }
786
787 msg = &qat_req->req;
788 *msg = ctx->enc_fw_req;
789- qat_req->ablkcipher_ctx = ctx;
790- qat_req->ablkcipher_req = req;
791- qat_req->cb = qat_ablkcipher_alg_callback;
792+ qat_req->skcipher_ctx = ctx;
793+ qat_req->skcipher_req = req;
794+ qat_req->cb = qat_skcipher_alg_callback;
795 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
796 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
797 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
798 cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
799- cipher_param->cipher_length = req->nbytes;
800+ cipher_param->cipher_length = req->cryptlen;
801 cipher_param->cipher_offset = 0;
802- memcpy(cipher_param->u.cipher_IV_array, req->info, AES_BLOCK_SIZE);
803-
804+ cipher_param->u.s.cipher_IV_ptr = qat_req->iv_paddr;
805+ memcpy(qat_req->iv, req->iv, AES_BLOCK_SIZE);
806 do {
807 ret = adf_send_message(ctx->inst->sym_tx, (uint32_t *)msg);
808- if (ret)
809- cond_resched();
810- } while (ret == -EAGAIN);
811+ } while (ret == -EAGAIN && ctr++ < 10);
812
813+ if (ret == -EAGAIN) {
814+ qat_alg_free_bufl(ctx->inst, qat_req);
815+ dma_free_coherent(dev, AES_BLOCK_SIZE, qat_req->iv,
816+ qat_req->iv_paddr);
817+ return -EBUSY;
818+ }
819 return -EINPROGRESS;
820 }
821
822-static int qat_alg_ablkcipher_decrypt(struct ablkcipher_request *req)
823+static int qat_alg_skcipher_blk_encrypt(struct skcipher_request *req)
824+{
825+ if (req->cryptlen % AES_BLOCK_SIZE != 0)
826+ return -EINVAL;
827+
828+ return qat_alg_skcipher_encrypt(req);
829+}
830+
831+static int qat_alg_skcipher_decrypt(struct skcipher_request *req)
832 {
833- struct crypto_ablkcipher *atfm = crypto_ablkcipher_reqtfm(req);
834- struct crypto_tfm *tfm = crypto_ablkcipher_tfm(atfm);
835- struct qat_alg_ablkcipher_ctx *ctx = crypto_tfm_ctx(tfm);
836- struct qat_crypto_request *qat_req = ablkcipher_request_ctx(req);
837+ struct crypto_skcipher *stfm = crypto_skcipher_reqtfm(req);
838+ struct crypto_tfm *tfm = crypto_skcipher_tfm(stfm);
839+ struct qat_alg_skcipher_ctx *ctx = crypto_tfm_ctx(tfm);
840+ struct qat_crypto_request *qat_req = skcipher_request_ctx(req);
841 struct icp_qat_fw_la_cipher_req_params *cipher_param;
842 struct icp_qat_fw_la_bulk_req *msg;
843- int ret;
844+ struct device *dev = &GET_DEV(ctx->inst->accel_dev);
845+ int ret, ctr = 0;
846+
847+ if (req->cryptlen == 0)
848+ return 0;
849+
850+ qat_req->iv = dma_alloc_coherent(dev, AES_BLOCK_SIZE,
851+ &qat_req->iv_paddr, GFP_ATOMIC);
852+ if (!qat_req->iv)
853+ return -ENOMEM;
854
855 ret = qat_alg_sgl_to_bufl(ctx->inst, req->src, req->dst, qat_req);
856- if (unlikely(ret))
857+ if (unlikely(ret)) {
858+ dma_free_coherent(dev, AES_BLOCK_SIZE, qat_req->iv,
859+ qat_req->iv_paddr);
860 return ret;
861+ }
862
863 msg = &qat_req->req;
864 *msg = ctx->dec_fw_req;
865- qat_req->ablkcipher_ctx = ctx;
866- qat_req->ablkcipher_req = req;
867- qat_req->cb = qat_ablkcipher_alg_callback;
868+ qat_req->skcipher_ctx = ctx;
869+ qat_req->skcipher_req = req;
870+ qat_req->cb = qat_skcipher_alg_callback;
871 qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
872 qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
873 qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
874 cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
875- cipher_param->cipher_length = req->nbytes;
876+ cipher_param->cipher_length = req->cryptlen;
877 cipher_param->cipher_offset = 0;
878- memcpy(cipher_param->u.cipher_IV_array, req->info, AES_BLOCK_SIZE);
879-
880+ cipher_param->u.s.cipher_IV_ptr = qat_req->iv_paddr;
881+ memcpy(qat_req->iv, req->iv, AES_BLOCK_SIZE);
882 do {
883 ret = adf_send_message(ctx->inst->sym_tx, (uint32_t *)msg);
884- if (ret)
885- cond_resched();
886- } while (ret == -EAGAIN);
887+ } while (ret == -EAGAIN && ctr++ < 10);
888
889+ if (ret == -EAGAIN) {
890+ qat_alg_free_bufl(ctx->inst, qat_req);
891+ dma_free_coherent(dev, AES_BLOCK_SIZE, qat_req->iv,
892+ qat_req->iv_paddr);
893+ return -EBUSY;
894+ }
895 return -EINPROGRESS;
896 }
897
898+static int qat_alg_skcipher_blk_decrypt(struct skcipher_request *req)
899+{
900+ if (req->cryptlen % AES_BLOCK_SIZE != 0)
901+ return -EINVAL;
902+
903+ return qat_alg_skcipher_decrypt(req);
904+}
905 static int qat_alg_aead_init(struct crypto_aead *tfm,
906 enum icp_qat_hw_auth_algo hash,
907 const char *hash_name)
908@@ -1090,30 +1213,30 @@ static void qat_alg_aead_exit(struct crypto_aead *tfm)
909
910 dev = &GET_DEV(inst->accel_dev);
911 if (ctx->enc_cd) {
912- memzero_explicit(ctx->enc_cd, sizeof(struct qat_alg_cd));
913+ memset(ctx->enc_cd, 0, sizeof(struct qat_alg_cd));
914 dma_free_coherent(dev, sizeof(struct qat_alg_cd),
915 ctx->enc_cd, ctx->enc_cd_paddr);
916 }
917 if (ctx->dec_cd) {
918- memzero_explicit(ctx->dec_cd, sizeof(struct qat_alg_cd));
919+ memset(ctx->dec_cd, 0, sizeof(struct qat_alg_cd));
920 dma_free_coherent(dev, sizeof(struct qat_alg_cd),
921 ctx->dec_cd, ctx->dec_cd_paddr);
922 }
923 qat_crypto_put_instance(inst);
924 }
925
926-static int qat_alg_ablkcipher_init(struct crypto_tfm *tfm)
927+static int qat_alg_skcipher_init_tfm(struct crypto_skcipher *tfm)
928 {
929- struct qat_alg_ablkcipher_ctx *ctx = crypto_tfm_ctx(tfm);
930+ struct qat_alg_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
931
932- tfm->crt_ablkcipher.reqsize = sizeof(struct qat_crypto_request);
933+ crypto_skcipher_set_reqsize(tfm, sizeof(struct qat_crypto_request));
934 ctx->tfm = tfm;
935 return 0;
936 }
937
938-static void qat_alg_ablkcipher_exit(struct crypto_tfm *tfm)
939+static void qat_alg_skcipher_exit_tfm(struct crypto_skcipher *tfm)
940 {
941- struct qat_alg_ablkcipher_ctx *ctx = crypto_tfm_ctx(tfm);
942+ struct qat_alg_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm);
943 struct qat_crypto_instance *inst = ctx->inst;
944 struct device *dev;
945
946@@ -1122,15 +1245,15 @@ static void qat_alg_ablkcipher_exit(struct crypto_tfm *tfm)
947
948 dev = &GET_DEV(inst->accel_dev);
949 if (ctx->enc_cd) {
950- memzero_explicit(ctx->enc_cd,
951- sizeof(struct icp_qat_hw_cipher_algo_blk));
952+ memset(ctx->enc_cd, 0,
953+ sizeof(struct icp_qat_hw_cipher_algo_blk));
954 dma_free_coherent(dev,
955 sizeof(struct icp_qat_hw_cipher_algo_blk),
956 ctx->enc_cd, ctx->enc_cd_paddr);
957 }
958 if (ctx->dec_cd) {
959- memzero_explicit(ctx->dec_cd,
960- sizeof(struct icp_qat_hw_cipher_algo_blk));
961+ memset(ctx->dec_cd, 0,
962+ sizeof(struct icp_qat_hw_cipher_algo_blk));
963 dma_free_coherent(dev,
964 sizeof(struct icp_qat_hw_cipher_algo_blk),
965 ctx->dec_cd, ctx->dec_cd_paddr);
966@@ -1192,92 +1315,75 @@ static struct aead_alg qat_aeads[] = { {
967 .maxauthsize = SHA512_DIGEST_SIZE,
968 } };
969
970-static struct crypto_alg qat_algs[] = { {
971- .cra_name = "cbc(aes)",
972- .cra_driver_name = "qat_aes_cbc",
973- .cra_priority = 4001,
974- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
975- .cra_blocksize = AES_BLOCK_SIZE,
976- .cra_ctxsize = sizeof(struct qat_alg_ablkcipher_ctx),
977- .cra_alignmask = 0,
978- .cra_type = &crypto_ablkcipher_type,
979- .cra_module = THIS_MODULE,
980- .cra_init = qat_alg_ablkcipher_init,
981- .cra_exit = qat_alg_ablkcipher_exit,
982- .cra_u = {
983- .ablkcipher = {
984- .setkey = qat_alg_ablkcipher_cbc_setkey,
985- .decrypt = qat_alg_ablkcipher_decrypt,
986- .encrypt = qat_alg_ablkcipher_encrypt,
987- .min_keysize = AES_MIN_KEY_SIZE,
988- .max_keysize = AES_MAX_KEY_SIZE,
989- .ivsize = AES_BLOCK_SIZE,
990- },
991- },
992+static struct skcipher_alg qat_skciphers[] = { {
993+ .base.cra_name = "cbc(aes)",
994+ .base.cra_driver_name = "qat_aes_cbc",
995+ .base.cra_priority = 4001,
996+ .base.cra_flags = CRYPTO_ALG_ASYNC,
997+ .base.cra_blocksize = AES_BLOCK_SIZE,
998+ .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx),
999+ .base.cra_alignmask = 0,
1000+ .base.cra_module = THIS_MODULE,
1001+
1002+ .init = qat_alg_skcipher_init_tfm,
1003+ .exit = qat_alg_skcipher_exit_tfm,
1004+ .setkey = qat_alg_skcipher_cbc_setkey,
1005+ .decrypt = qat_alg_skcipher_blk_decrypt,
1006+ .encrypt = qat_alg_skcipher_blk_encrypt,
1007+ .min_keysize = AES_MIN_KEY_SIZE,
1008+ .max_keysize = AES_MAX_KEY_SIZE,
1009+ .ivsize = AES_BLOCK_SIZE,
1010 }, {
1011- .cra_name = "ctr(aes)",
1012- .cra_driver_name = "qat_aes_ctr",
1013- .cra_priority = 4001,
1014- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1015- .cra_blocksize = AES_BLOCK_SIZE,
1016- .cra_ctxsize = sizeof(struct qat_alg_ablkcipher_ctx),
1017- .cra_alignmask = 0,
1018- .cra_type = &crypto_ablkcipher_type,
1019- .cra_module = THIS_MODULE,
1020- .cra_init = qat_alg_ablkcipher_init,
1021- .cra_exit = qat_alg_ablkcipher_exit,
1022- .cra_u = {
1023- .ablkcipher = {
1024- .setkey = qat_alg_ablkcipher_ctr_setkey,
1025- .decrypt = qat_alg_ablkcipher_decrypt,
1026- .encrypt = qat_alg_ablkcipher_encrypt,
1027- .min_keysize = AES_MIN_KEY_SIZE,
1028- .max_keysize = AES_MAX_KEY_SIZE,
1029- .ivsize = AES_BLOCK_SIZE,
1030- },
1031- },
1032+ .base.cra_name = "ctr(aes)",
1033+ .base.cra_driver_name = "qat_aes_ctr",
1034+ .base.cra_priority = 4001,
1035+ .base.cra_flags = CRYPTO_ALG_ASYNC,
1036+ .base.cra_blocksize = 1,
1037+ .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx),
1038+ .base.cra_alignmask = 0,
1039+ .base.cra_module = THIS_MODULE,
1040+
1041+ .init = qat_alg_skcipher_init_tfm,
1042+ .exit = qat_alg_skcipher_exit_tfm,
1043+ .setkey = qat_alg_skcipher_ctr_setkey,
1044+ .decrypt = qat_alg_skcipher_decrypt,
1045+ .encrypt = qat_alg_skcipher_encrypt,
1046+ .min_keysize = AES_MIN_KEY_SIZE,
1047+ .max_keysize = AES_MAX_KEY_SIZE,
1048+ .ivsize = AES_BLOCK_SIZE,
1049 }, {
1050- .cra_name = "xts(aes)",
1051- .cra_driver_name = "qat_aes_xts",
1052- .cra_priority = 4001,
1053- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
1054- .cra_blocksize = AES_BLOCK_SIZE,
1055- .cra_ctxsize = sizeof(struct qat_alg_ablkcipher_ctx),
1056- .cra_alignmask = 0,
1057- .cra_type = &crypto_ablkcipher_type,
1058- .cra_module = THIS_MODULE,
1059- .cra_init = qat_alg_ablkcipher_init,
1060- .cra_exit = qat_alg_ablkcipher_exit,
1061- .cra_u = {
1062- .ablkcipher = {
1063- .setkey = qat_alg_ablkcipher_xts_setkey,
1064- .decrypt = qat_alg_ablkcipher_decrypt,
1065- .encrypt = qat_alg_ablkcipher_encrypt,
1066- .min_keysize = 2 * AES_MIN_KEY_SIZE,
1067- .max_keysize = 2 * AES_MAX_KEY_SIZE,
1068- .ivsize = AES_BLOCK_SIZE,
1069- },
1070- },
1071+ .base.cra_name = "xts(aes)",
1072+ .base.cra_driver_name = "qat_aes_xts",
1073+ .base.cra_priority = 4001,
1074+ .base.cra_flags = CRYPTO_ALG_ASYNC,
1075+ .base.cra_blocksize = AES_BLOCK_SIZE,
1076+ .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx),
1077+ .base.cra_alignmask = 0,
1078+ .base.cra_module = THIS_MODULE,
1079+
1080+ .init = qat_alg_skcipher_init_tfm,
1081+ .exit = qat_alg_skcipher_exit_tfm,
1082+ .setkey = qat_alg_skcipher_xts_setkey,
1083+ .decrypt = qat_alg_skcipher_blk_decrypt,
1084+ .encrypt = qat_alg_skcipher_blk_encrypt,
1085+ .min_keysize = 2 * AES_MIN_KEY_SIZE,
1086+ .max_keysize = 2 * AES_MAX_KEY_SIZE,
1087+ .ivsize = AES_BLOCK_SIZE,
1088 } };
1089
1090 int qat_algs_register(void)
1091 {
1092- int ret = 0, i;
1093+ int ret = 0;
1094
1095 mutex_lock(&algs_lock);
1096 if (++active_devs != 1)
1097 goto unlock;
1098
1099- for (i = 0; i < ARRAY_SIZE(qat_algs); i++)
1100- qat_algs[i].cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC;
1101-
1102- ret = crypto_register_algs(qat_algs, ARRAY_SIZE(qat_algs));
1103+ ret = crypto_register_skciphers(qat_skciphers,
1104+ ARRAY_SIZE(qat_skciphers));
1105 if (ret)
1106 goto unlock;
1107
1108- for (i = 0; i < ARRAY_SIZE(qat_aeads); i++)
1109- qat_aeads[i].base.cra_flags = CRYPTO_ALG_ASYNC;
1110-
1111 ret = crypto_register_aeads(qat_aeads, ARRAY_SIZE(qat_aeads));
1112 if (ret)
1113 goto unreg_algs;
1114@@ -1287,7 +1393,7 @@ unlock:
1115 return ret;
1116
1117 unreg_algs:
1118- crypto_unregister_algs(qat_algs, ARRAY_SIZE(qat_algs));
1119+ crypto_unregister_skciphers(qat_skciphers, ARRAY_SIZE(qat_skciphers));
1120 goto unlock;
1121 }
1122
1123@@ -1298,7 +1404,7 @@ void qat_algs_unregister(void)
1124 goto unlock;
1125
1126 crypto_unregister_aeads(qat_aeads, ARRAY_SIZE(qat_aeads));
1127- crypto_unregister_algs(qat_algs, ARRAY_SIZE(qat_algs));
1128+ crypto_unregister_skciphers(qat_skciphers, ARRAY_SIZE(qat_skciphers));
1129
1130 unlock:
1131 mutex_unlock(&algs_lock);
1132diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_crypto.h b/quickassist/qat/drivers/crypto/qat/qat_common/qat_crypto.h
1133index dc0273f..300bb91 100644
1134--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_crypto.h
1135+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_crypto.h
1136@@ -79,15 +79,17 @@ struct qat_crypto_request {
1137 struct icp_qat_fw_la_bulk_req req;
1138 union {
1139 struct qat_alg_aead_ctx *aead_ctx;
1140- struct qat_alg_ablkcipher_ctx *ablkcipher_ctx;
1141+ struct qat_alg_skcipher_ctx *skcipher_ctx;
1142 };
1143 union {
1144 struct aead_request *aead_req;
1145- struct ablkcipher_request *ablkcipher_req;
1146+ struct skcipher_request *skcipher_req;
1147 };
1148 struct qat_crypto_request_buffs buf;
1149 void (*cb)(struct icp_qat_fw_la_resp *resp,
1150 struct qat_crypto_request *req);
1151+ void *iv;
1152+ dma_addr_t iv_paddr;
1153 };
1154
1155 #endif
1156--
11572.29.2
1158
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch
deleted file mode 100644
index dc8a53d..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From db44bce60b322754e6a8b96d93218135db00b46a Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Sun, 31 May 2020 10:56:27 +0800
4Subject: [PATCH] crypto: qat/adf_aer - Remove
5 pci_cleanup_aer_uncorrect_error_status()
6
7In kernel upstream commit 62b36c3ea664 ("PCI/AER: Remove
8pci_cleanup_aer_uncorrect_error_status() calls"), AER interfaces
9to clear error status registers were removed from device dirver.
10
11Upstream-Status: Inappropriate [Code released in tarball form only]
12
13Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
14---
15 quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c | 1 -
16 1 file changed, 1 deletion(-)
17
18diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
19index 5e98b70..3935d77 100644
20--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
21+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
22@@ -281,7 +281,6 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev)
23 pr_err("QAT: Can't find acceleration device\n");
24 return PCI_ERS_RESULT_DISCONNECT;
25 }
26- pci_cleanup_aer_uncorrect_error_status(pdev);
27 if (adf_dev_aer_schedule_reset(accel_dev, ADF_DEV_RESET_SYNC))
28 return PCI_ERS_RESULT_DISCONNECT;
29
30--
312.14.4
32
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch
deleted file mode 100644
index 0851724..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1From 75fe2382f42ac42333a28445bb54132afd9a27a1 Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Tue, 31 Mar 2020 19:44:25 +0000
4Subject: [PATCH] qat17: make it compatible with kernel 5.6
5
61) In kernel commit c766d1472c70 ("y2038: hide timeval/timespec/itimerval
7/itimerspec types"), timespec was hiden, so change timespec to timespec64.
8
92) CRYPTO_TFM_RES_BAD_KEY_LEN was removed in kernel commit 674f368a952c
10("crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN"). Add it back, since qat driver
11needs it.
12
13Upstream-Status: Inappropriate [Code released in tarball form only]
14
15Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
16---
17 .../drivers/crypto/qat/qat_common/adf_clock.c | 18 +++++++++---------
18 .../drivers/crypto/qat/qat_common/qat_algs.c | 2 ++
19 2 files changed, 11 insertions(+), 9 deletions(-)
20
21diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c
22index 8785f67..be3d9b8 100644
23--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c
24+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_clock.c
25@@ -113,7 +113,7 @@ int adf_clock_debugfs_add(struct adf_accel_dev *accel_dev)
26 #endif
27 EXPORT_SYMBOL_GPL(adf_clock_debugfs_add);
28
29-static inline s64 timespec_to_us(const struct timespec *ts)
30+static inline s64 timespec_to_us(const struct timespec64 *ts)
31 {
32 return ((s64)ts->tv_sec * USEC_PER_SEC +
33 (ts->tv_nsec + NSEC_PER_USEC / 2) / NSEC_PER_USEC);
34@@ -129,10 +129,10 @@ static inline s64 timespec_to_us(const struct timespec *ts)
35 static int measure_clock(struct adf_accel_dev *accel_dev,
36 u32 *frequency)
37 {
38- struct timespec ts1;
39- struct timespec ts2;
40- struct timespec ts3;
41- struct timespec ts4;
42+ struct timespec64 ts1;
43+ struct timespec64 ts2;
44+ struct timespec64 ts3;
45+ struct timespec64 ts4;
46 u64 delta_us = 0;
47 u64 timestamp1 = 0;
48 u64 timestamp2 = 0;
49@@ -143,13 +143,13 @@ static int measure_clock(struct adf_accel_dev *accel_dev,
50 return -EIO;
51
52 do {
53- getnstimeofday(&ts1);
54+ ktime_get_real_ts64(&ts1);
55 if (adf_get_fw_timestamp(accel_dev, &timestamp1)) {
56 dev_err(&GET_DEV(accel_dev),
57 "Failed to get fw timestamp\n");
58 return -EIO;
59 }
60- getnstimeofday(&ts2);
61+ ktime_get_real_ts64(&ts2);
62 delta_us = timespec_to_us(&ts2) - timespec_to_us(&ts1);
63 } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD &&
64 ++tries < MEASURE_CLOCK_RETRIES);
65@@ -162,13 +162,13 @@ static int measure_clock(struct adf_accel_dev *accel_dev,
66
67 tries = 0;
68 do {
69- getnstimeofday(&ts3);
70+ ktime_get_real_ts64(&ts3);
71 if (adf_get_fw_timestamp(accel_dev, &timestamp2)) {
72 dev_err(&GET_DEV(accel_dev),
73 "Failed to get fw timestamp\n");
74 return -EIO;
75 }
76- getnstimeofday(&ts4);
77+ ktime_get_real_ts64(&ts4);
78 delta_us = timespec_to_us(&ts4) - timespec_to_us(&ts3);
79 } while (delta_us > MEASURE_CLOCK_DELTA_THRESHOLD &&
80 ++tries < MEASURE_CLOCK_RETRIES);
81diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
82index c4edb3c..b509dca 100644
83--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
84+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
85@@ -73,6 +73,8 @@
86 ICP_QAT_HW_CIPHER_KEY_CONVERT, \
87 ICP_QAT_HW_CIPHER_DECRYPT)
88
89+#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
90+
91 static DEFINE_MUTEX(algs_lock);
92 static unsigned int active_devs;
93
94--
952.24.1
96
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch
deleted file mode 100644
index 27055ed..0000000
--- a/recipes-extended/qat/files/qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From fcc9a80e47f1a9945987e398626074bddfc705c0 Mon Sep 17 00:00:00 2001
2From: Yongxin Liu <yongxin.liu@windriver.com>
3Date: Fri, 24 Jul 2020 09:27:48 +0800
4Subject: [PATCH] qat: replace linux/cryptohash.h with crypto/sha.h for kernel
5 v5.8
6
7This is to accommodate kernel commit 228c4f265c6e ("crypto:
8lib/sha1 - fold linux/cryptohash.h into crypto/sha.h").
9
10Upstream-Status: Inappropriate [Code released in tarball form only]
11
12Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
13---
14 .../utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
18index 2d5b233..92ee35b 100644
19--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
20+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
21@@ -66,7 +66,11 @@
22
23 #include "Osal.h"
24 #include <linux/crypto.h>
25+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
26+#include <crypto/sha.h>
27+#else
28 #include <linux/cryptohash.h>
29+#endif
30 #include <linux/version.h>
31 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
32 #include <crypto/internal/hash.h>
33--
342.14.4
35
diff --git a/recipes-extended/qat/files/use-CC-for-LD.patch b/recipes-extended/qat/files/use-CC-for-LD.patch
deleted file mode 100644
index 36ceedf..0000000
--- a/recipes-extended/qat/files/use-CC-for-LD.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Use CC to do the linking, helps in linking with gold or bfd linker
2
3Upstream-Status: Inappropriate [OE-Specific]
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Index: QAT1.6/quickassist/build_system/build_files/OS/linux_2.6.mk
6===================================================================
7--- QAT1.6.orig/quickassist/build_system/build_files/OS/linux_2.6.mk
8+++ QAT1.6/quickassist/build_system/build_files/OS/linux_2.6.mk
9@@ -89,7 +89,7 @@ EXTRA_CFLAGS+= -Wno-div-by-zero -Wfloat-
10 endif
11
12
13-LIB_SHARED_FLAGS+=-shared -soname $(LIB_SHARED)
14+LIB_SHARED_FLAGS+=-shared -Wl,-soname,$(LIB_SHARED)
15 LIB_STATIC_FLAGS=
16 EXE_FLAGS?=
17
diff --git a/recipes-extended/qat/qat17_4.7.0-00006.bb b/recipes-extended/qat/qat17_4.12.0-00011.bb
index e9fb85d..28bcad7 100644
--- a/recipes-extended/qat/qat17_4.7.0-00006.bb
+++ b/recipes-extended/qat/qat17_4.12.0-00011.bb
@@ -12,56 +12,24 @@ PROVIDES += "virtual/qat"
12 12
13TARGET_CC_ARCH += "${LDFLAGS}" 13TARGET_CC_ARCH += "${LDFLAGS}"
14 14
15SRC_URI = "https://01.org/sites/default/files/downloads/qat1.7.l.4.7.0-00006.tar.gz;subdir=qat17 \ 15SRC_URI = "https://01.org/sites/default/files/downloads//qat1.7.l.4.12.0-00011.tar.gz;subdir=qat17 \
16 file://qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch \ 16 file://0001-qat-fix-for-cross-compilation-issue.patch \
17 file://qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch \ 17 file://0002-qat-remove-local-path-from-makefile.patch \
18 file://qat17_0.6.0-1-qat-update-KDIR-for-cross-compilation.patch \ 18 file://0003-qat-override-CC-LD-AR-only-when-it-is-not-define.patch \
19 file://qat17_0.8.0-37-qat-added-include-dir-path.patch \ 19 file://0004-update-KDIR-for-cross-compilation.patch \
20 file://qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch \ 20 file://0005-Added-include-dir-path.patch \
21 file://qat17_4.1.0-00022-qat-use-static-lib-for-linking.patch \ 21 file://0006-qat-add-install-target-and-add-folder.patch \
22 file://qat17_4.7.0-00006-Link-driver-with-object-files.patch \ 22 file://0007-qat-use-static-lib-for-linking-under-cpa-sample-code.patch \
23 file://qat17_4.7.0-00006-Drop-pr_warning-definition.patch \ 23 file://0008-qat-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch \
24 file://qat17_4.7.0-00006-Switch-to-skcipher-API.patch;apply=0 \ 24 file://0009-crypto-qat-Silence-smp_processor_id-warning.patch \
25 file://qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch;apply=0 \ 25 file://0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch \
26 file://qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch \ 26 file://0011-qat17-use-namespace-CRYPTO_INTERNAL.patch \
27 file://qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch \
28 file://qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch \
29 file://qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch \
30 file://qat17_4.7.0-00006-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch \
31 file://qat17_4.7.0-00006-qat17-use-namespace-CRYPTO_INTERNAL.patch \
32 " 27 "
33 28
34do_patch[depends] += "virtual/kernel:do_shared_workdir" 29do_configure[depends] += "virtual/kernel:do_shared_workdir"
35 30
36do_patch_append () { 31SRC_URI[md5sum] = "23d962944ae22ef14ff880fdbff4223b"
37 kernel_version = int(d.getVar("KERNEL_VERSION").split(".")[0]) 32SRC_URI[sha256sum] = "6b8d643780b2640d084f5bd50546c8dae4ae9ec50cf167660a0ebdc55619eb2e"
38 kernel_patchlevel = int(d.getVar("KERNEL_VERSION").split(".")[1])
39
40 if kernel_version >= 5 and kernel_patchlevel >= 5:
41 bb.build.exec_func('do_switch_to_skcipher_api', d)
42 if kernel_version >= 5 and kernel_patchlevel >= 6:
43 bb.build.exec_func('do_patch_for_kernel_5_6', d)
44}
45
46do_switch_to_skcipher_api () {
47 if [ ! -e ${S}/patches/qat17_4.7.0-00006-Switch-to-skcipher-API.patch.applied ]; then
48 cd "${S}"
49 patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-Switch-to-skcipher-API.patch"
50 touch ${S}/patches/qat17_4.7.0-00006-Switch-to-skcipher-API.patch.applied
51 fi
52}
53
54do_patch_for_kernel_5_6 () {
55 if [ ! -e ${S}/patches/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch.applied ]; then
56 cd "${S}"
57 patch -p1 < "${WORKDIR}/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch"
58 touch ${S}/patches/qat17_4.7.0-00006-make-it-compatible-with-kernel-5.6.patch.applied
59 fi
60}
61
62
63SRC_URI[md5sum] = "ac939b51cc8836c182e31e309c065002"
64SRC_URI[sha256sum] = "5c8bdc35fd7a42f212f1f87eb9e3d8584df7af56dae366debc487981e531fa5c"
65 33
66COMPATIBLE_MACHINE = "null" 34COMPATIBLE_MACHINE = "null"
67COMPATIBLE_HOST_x86-x32 = 'null' 35COMPATIBLE_HOST_x86-x32 = 'null'
@@ -90,6 +58,7 @@ export WITH_UPSTREAM = "1"
90export WITH_CMDRV = "1" 58export WITH_CMDRV = "1"
91export KERNEL_SOURCE_DIR = "${ICP_ROOT}/quickassist/qat/" 59export KERNEL_SOURCE_DIR = "${ICP_ROOT}/quickassist/qat/"
92export ICP_NO_CLEAN = "1" 60export ICP_NO_CLEAN = "1"
61export ICP_QDM_IOMMU = "1"
93 62
94inherit module 63inherit module
95inherit update-rc.d 64inherit update-rc.d