Signed-off-by: Yongxin Liu <[email protected]>
---
 ..._PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch | 35 ++++++++++
 ...ove-reqsize-into-tfm-for-kernel-v6.2.patch | 65 +++++++++++++++++++
 recipes-extended/qat/qat17_4.20.0-00001.bb    |  2 +
 3 files changed, 102 insertions(+)
 create mode 100644 
recipes-extended/qat/files/qat17-change-PMD_PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch
 create mode 100644 
recipes-extended/qat/files/qat17-move-reqsize-into-tfm-for-kernel-v6.2.patch

diff --git 
a/recipes-extended/qat/files/qat17-change-PMD_PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch
 
b/recipes-extended/qat/files/qat17-change-PMD_PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch
new file mode 100644
index 0000000..b1e40db
--- /dev/null
+++ 
b/recipes-extended/qat/files/qat17-change-PMD_PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch
@@ -0,0 +1,35 @@
+From 5c51a64f97e1e149df206fed00f5414f73e1e07a Mon Sep 17 00:00:00 2001
+From: Yongxin Liu <[email protected]>
+Date: Wed, 1 Mar 2023 01:39:47 +0000
+Subject: [PATCH] qat17: change PMD_PAGE_SIZE to PMD_SIZE for kernel v6.2
+
+In kernel commit 82328227db8f ("x86/mm: Remove P*D_PAGE_MASK and
+P*D_PAGE_SIZE macros"), P*D_PAGE_MASK and P*D_PAGE_SIZE were removed.
+P*D_MASK and P*D_SIZE are used instead.
+
+Upstream-Status: Inappropriate [Code released in tarball form only]
+
+Signed-off-by: Yongxin Liu <[email protected]>
+---
+ .../utilities/libusdm_drv/linux/kernel_space/qae_mem_drv.c    | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git 
a/quickassist/utilities/libusdm_drv/linux/kernel_space/qae_mem_drv.c 
b/quickassist/utilities/libusdm_drv/linux/kernel_space/qae_mem_drv.c
+index 8e8d76e..ae96d3f 100644
+--- a/quickassist/utilities/libusdm_drv/linux/kernel_space/qae_mem_drv.c
++++ b/quickassist/utilities/libusdm_drv/linux/kernel_space/qae_mem_drv.c
+@@ -848,7 +848,11 @@ dev_get_user_page(struct file *fp, uint32_t cmd, unsigned 
long arg)
+     {
+        if (PageHuge(page))
+        {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0))
++           if (user_mem_info.size != PMD_SIZE)
++#else
+            if (user_mem_info.size != PMD_PAGE_SIZE)
++#endif
+            {
+                mm_err("%s:%d dev_get_user_page: user_mem_info.size is not "
+                       "equal to hugepage_size, ret=%d\n",
+-- 
+2.39.1
+
diff --git 
a/recipes-extended/qat/files/qat17-move-reqsize-into-tfm-for-kernel-v6.2.patch 
b/recipes-extended/qat/files/qat17-move-reqsize-into-tfm-for-kernel-v6.2.patch
new file mode 100644
index 0000000..9cc49ec
--- /dev/null
+++ 
b/recipes-extended/qat/files/qat17-move-reqsize-into-tfm-for-kernel-v6.2.patch
@@ -0,0 +1,65 @@
+From cee000ba295057ea8b5d93531b2896934674a7f3 Mon Sep 17 00:00:00 2001
+From: Yongxin Liu <[email protected]>
+Date: Wed, 1 Mar 2023 01:40:00 +0000
+Subject: [PATCH] qat17: move reqsize into tfm for kernel v6.2
+
+In mainline kernel commits 3e71e5b0efcc ("crypto: akcipher - Move reqsize
+into tfm") and 4d2b225a67e6 (crypto: kpp - Move reqsize into tfm),
+reqsize was moved from struct akcipher_alg and kpp_alg to tfm.
+
+Upstream-Status: Inappropriate [Code released in tarball form only]
+
+Signed-off-by: Yongxin Liu <[email protected]>
+---
+ .../drivers/crypto/qat/qat_common/qat_asym_algs.c    | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_asym_algs.c 
b/quickassist/qat/drivers/crypto/qat/qat_common/qat_asym_algs.c
+index ec410cc..359f7b1 100644
+--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_asym_algs.c
++++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_asym_algs.c
+@@ -504,6 +504,10 @@ static int qat_dh_init_tfm(struct crypto_kpp *tfm)
+       if (!inst)
+               return -EINVAL;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0))
++      kpp_set_reqsize(tfm, sizeof(struct qat_asym_request) + 64);
++#endif
++
+       ctx->p_size = 0;
+       ctx->g2 = false;
+       ctx->inst = inst;
+@@ -1252,6 +1256,10 @@ static int qat_rsa_init_tfm(struct crypto_akcipher *tfm)
+       if (!inst)
+               return -EINVAL;
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0))
++      akcipher_set_reqsize(tfm, sizeof(struct qat_asym_request) + 64);
++#endif
++
+       ctx->key_sz = 0;
+       ctx->inst = inst;
+       return 0;
+@@ -1276,7 +1284,9 @@ static struct akcipher_alg rsa = {
+       .max_size = qat_rsa_max_size,
+       .init = qat_rsa_init_tfm,
+       .exit = qat_rsa_exit_tfm,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))
+       .reqsize = sizeof(struct qat_asym_request) + 64,
++#endif
+       .base = {
+               .cra_name = "rsa",
+               .cra_driver_name = "qat-rsa",
+@@ -1294,7 +1304,9 @@ static struct kpp_alg dh = {
+       .max_size = qat_dh_max_size,
+       .init = qat_dh_init_tfm,
+       .exit = qat_dh_exit_tfm,
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0))
+       .reqsize = sizeof(struct qat_asym_request) + 64,
++#endif
+       .base = {
+               .cra_name = "dh",
+               .cra_driver_name = "qat-dh",
+-- 
+2.39.1
+
diff --git a/recipes-extended/qat/qat17_4.20.0-00001.bb 
b/recipes-extended/qat/qat17_4.20.0-00001.bb
index 3126657..ed5409c 100644
--- a/recipes-extended/qat/qat17_4.20.0-00001.bb
+++ b/recipes-extended/qat/qat17_4.20.0-00001.bb
@@ -21,6 +21,8 @@ SRC_URI = 
"https://downloadmirror.intel.com/761891/QAT.L.4.20.0-00001.tar.gz;sub
            file://0006-qat-add-install-target-and-add-folder.patch \
            
file://0001-usdm_drv-convert-mutex_lock-to-mutex_trylock-to-avio.patch \
            file://qat-remove-the-deprecated-pci-dma-compat.h-API.patch \
+           file://qat17-move-reqsize-into-tfm-for-kernel-v6.2.patch \
+           file://qat17-change-PMD_PAGE_SIZE-to-PMD_SIZE-for-kernel-v6.patch \
           "
 
 do_configure[depends] += "virtual/kernel:do_shared_workdir"
-- 
2.38.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7855): 
https://lists.yoctoproject.org/g/meta-intel/message/7855
Mute This Topic: https://lists.yoctoproject.org/mt/97309124/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to