[meta-intel] [PATCH] cryptodev-modules: Add bbappend to add patch
Saul Wold
sgw at linux.intel.com
Mon Apr 3 08:04:30 PDT 2017
This adds a patch to cryptodev-module to sync up the API change that
was added in the linux-intel kernel backport from 4.10 -> 4.9. The
patch just forces the code path to use the latest API.
This uses anon python to ensure it only applies when PREFERRED_PROVIDER
is set to linux-intel and KERNEL_VERSION is 4.9 (LTS).
Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
...1-zc-Force-4.10-get_user_pages_remote-API.patch | 29 ++++++++++++++++++++++
.../cryptodev/cryptodev-module_%.bbappend | 10 ++++++++
2 files changed, 39 insertions(+)
create mode 100644 common/recipes-kernel/cryptodev/cryptodev-module/0001-zc-Force-4.10-get_user_pages_remote-API.patch
create mode 100644 common/recipes-kernel/cryptodev/cryptodev-module_%.bbappend
diff --git a/common/recipes-kernel/cryptodev/cryptodev-module/0001-zc-Force-4.10-get_user_pages_remote-API.patch b/common/recipes-kernel/cryptodev/cryptodev-module/0001-zc-Force-4.10-get_user_pages_remote-API.patch
new file mode 100644
index 0000000..6722b8c
--- /dev/null
+++ b/common/recipes-kernel/cryptodev/cryptodev-module/0001-zc-Force-4.10-get_user_pages_remote-API.patch
@@ -0,0 +1,29 @@
+From 3fcc81ad127c267018aed96a359bbf01db1bd8ee Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw at linux.intel.com>
+Date: Sat, 1 Apr 2017 11:43:31 -0700
+Subject: [PATCH] zc: Force 4.10 get_user_pages_remote API
+
+This change forces the newer API, as the linux-intel 4.9-LTS kernel
+backported the 4.10 API change in the page handling code.
+
+Signed-off-by: Saul Wold <sgw at linux.intel.com>
+---
+ zc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/zc.c b/zc.c
+index 2f4ea99..fcd0669 100644
+--- a/zc.c
++++ b/zc.c
+@@ -67,7 +67,7 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
+ ret = get_user_pages_remote(task, mm,
+ (unsigned long)addr, pgcount, write, 0, pg, NULL);
+ # else
+-# if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0))
++# if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) & 0)
+ ret = get_user_pages_remote(task, mm,
+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
+ pg, NULL);
+--
+2.7.4
+
diff --git a/common/recipes-kernel/cryptodev/cryptodev-module_%.bbappend b/common/recipes-kernel/cryptodev/cryptodev-module_%.bbappend
new file mode 100644
index 0000000..27ae21b
--- /dev/null
+++ b/common/recipes-kernel/cryptodev/cryptodev-module_%.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+
+python() {
+ if ((d.getVar("PREFERRED_PROVIDER_virtual/kernel").startswith("linux-intel")) and
+ (d.getVar("KERNEL_VERSION").startswith("4.9"))):
+ src_uri = d.getVar("SRC_URI")
+ d.setVar("SRC_URI", src_uri +
+ " file://0001-zc-Force-4.10-get_user_pages_remote-API.patch")
+}
--
2.7.4
More information about the meta-intel
mailing list