mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/3] cryptodev update
@ 2026-02-22 15:17 Ladislav Michl
  2026-02-22 15:18 ` [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1 Ladislav Michl
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ladislav Michl @ 2026-02-22 15:17 UTC (permalink / raw)
  To: ptxdist

A small update of cryptodev package consisting of one imported fix
from upstream and most importantly moving package to platform.
I guess it should be alway done this way. Cryptodev is linux module
and should depend on Linux kernel, however it currently depends on
Linux kernel tools (unfortunately both are using PTXCONF_KERNEL
symbol, so it remained unnoticed)

Ladislav Michl (3):
  cryptodev: fix compilation with Linux-6.18-rc1
  cryptodev: move cryptodev kernel module to platform
  cryptodev: simplify rules

 .../0004-Fix-build-for-Linux-6.18-rc1.patch   | 50 +++++++++++++++++++
 patches/cryptodev-linux-1.14/series           |  3 +-
 {rules => platforms}/cryptodev.in             |  2 +-
 rules/cryptodev-api.in                        |  1 -
 rules/cryptodev-api.make                      |  1 +
 rules/cryptodev.make                          |  9 ++--
 6 files changed, 57 insertions(+), 9 deletions(-)
 create mode 100644 patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
 rename {rules => platforms}/cryptodev.in (89%)

-- 
2.47.3




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1
  2026-02-22 15:17 [ptxdist] [PATCH 0/3] cryptodev update Ladislav Michl
@ 2026-02-22 15:18 ` Ladislav Michl
  2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich
  2026-02-22 15:19 ` [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform Ladislav Michl
  2026-02-22 15:19 ` [ptxdist] [PATCH 3/3] cryptodev: simplify rules Ladislav Michl
  2 siblings, 1 reply; 7+ messages in thread
From: Ladislav Michl @ 2026-02-22 15:18 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@triops.cz>

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 .../0004-Fix-build-for-Linux-6.18-rc1.patch   | 50 +++++++++++++++++++
 patches/cryptodev-linux-1.14/series           |  3 +-
 2 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch

diff --git a/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
new file mode 100644
index 000000000..879f755e5
--- /dev/null
+++ b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
@@ -0,0 +1,50 @@
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 6 Sep 2025 20:36:38 +0000
+Subject: [PATCH] Fix build for Linux 6.18-rc1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's no longer required to use nth_page() when iterating pages within a
+single scatterlist entry.
+
+Note I believe this code path in `sg_advance` is currently unreachable:
+It is only called from `get_userbuf_srtp`, passing in a scatterlist
+copied from one created by `__get_userbuf`, which only generates
+entries such that `sg->offset + sg->length <= PAGE_SIZE`.
+On the other hand, this code path in `sg_advance` requires that
+`sg->offset + sg->length > sg->offset + consumed >= PAGE_SIZE`.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8f03eb5f0f91fddc9bb8563c7e82bd7d3ba1dd0
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce00897b94bc5c62fab962625efcf1ab824d3688
+
+Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
+---
+ util.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/util.c b/util.c
+index 9eba4836ba6a..d42678169b2d 100644
+--- a/util.c
++++ b/util.c
+@@ -21,6 +21,7 @@
+ 
+ #include <crypto/scatterwalk.h>
+ #include <linux/scatterlist.h>
++#include <linux/version.h>
+ #include "util.h"
+ 
+ /* These were taken from Maxim Levitsky's patch to lkml.
+@@ -44,8 +45,12 @@ struct scatterlist *sg_advance(struct scatterlist *sg, int consumed)
+ 	sg->length -= consumed;
+ 
+ 	if (sg->offset >= PAGE_SIZE) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0))
++		struct page *page = sg_page(sg) + (sg->offset / PAGE_SIZE);
++#else
+ 		struct page *page =
+ 			nth_page(sg_page(sg), sg->offset / PAGE_SIZE);
++#endif
+ 		sg_set_page(sg, page, sg->length, sg->offset % PAGE_SIZE);
+ 	}
+ 
diff --git a/patches/cryptodev-linux-1.14/series b/patches/cryptodev-linux-1.14/series
index 12704929b..d832ab663 100644
--- a/patches/cryptodev-linux-1.14/series
+++ b/patches/cryptodev-linux-1.14/series
@@ -3,4 +3,5 @@
 0001-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch
 0002-Exclude-unused-struct-since-Linux-6.5.patch
 0003-Fix-uninitialized-session-pointers.patch
-# b25ab355176e0ac9ad9433b6a050c0e4  - git-ptx-patches magic
+0004-Fix-build-for-Linux-6.18-rc1.patch
+# 3025afd546f1ec2e0afecd54c87e23d2  - git-ptx-patches magic
-- 
2.47.3




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform
  2026-02-22 15:17 [ptxdist] [PATCH 0/3] cryptodev update Ladislav Michl
  2026-02-22 15:18 ` [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1 Ladislav Michl
@ 2026-02-22 15:19 ` Ladislav Michl
  2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich
  2026-02-22 15:19 ` [ptxdist] [PATCH 3/3] cryptodev: simplify rules Ladislav Michl
  2 siblings, 1 reply; 7+ messages in thread
From: Ladislav Michl @ 2026-02-22 15:19 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@triops.cz>

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 {rules => platforms}/cryptodev.in | 2 +-
 rules/cryptodev-api.in            | 1 -
 rules/cryptodev-api.make          | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {rules => platforms}/cryptodev.in (89%)

diff --git a/rules/cryptodev.in b/platforms/cryptodev.in
similarity index 89%
rename from rules/cryptodev.in
rename to platforms/cryptodev.in
index f59d8f58c..59d4aa9f0 100644
--- a/rules/cryptodev.in
+++ b/platforms/cryptodev.in
@@ -1,4 +1,4 @@
-## SECTION=core
+## SECTION=platform_project_specific
 
 config CRYPTODEV
 	tristate
diff --git a/rules/cryptodev-api.in b/rules/cryptodev-api.in
index 86af4ed23..10a42c46d 100644
--- a/rules/cryptodev-api.in
+++ b/rules/cryptodev-api.in
@@ -2,7 +2,6 @@
 
 config CRYPTODEV_API
 	tristate
-	select CRYPTODEV	if RUNTIME
 	prompt "cryptodev API"
 	help
 	  API headers for Cryptodev-linux. This is needed to build
diff --git a/rules/cryptodev-api.make b/rules/cryptodev-api.make
index 606108bd9..762195278 100644
--- a/rules/cryptodev-api.make
+++ b/rules/cryptodev-api.make
@@ -18,6 +18,7 @@ CRYPTODEV_API_VERSION	= $(CRYPTODEV_VERSION)
 CRYPTODEV_API_MD5	= $(CRYPTODEV_MD5)
 CRYPTODEV_API		= cryptodev-api-$(CRYPTODEV_API_VERSION)
 CRYPTODEV_API_SUFFIX	= tar.gz
+CRYPTODEV_API_PATCHES	= $(CRYPTODEV)
 CRYPTODEV_API_URL	= $(CRYPTODEV_URL)
 CRYPTODEV_API_SOURCE	= $(CRYPTODEV_SOURCE)
 CRYPTODEV_API_DIR	= $(BUILDDIR)/$(CRYPTODEV_API)
-- 
2.47.3




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ptxdist] [PATCH 3/3] cryptodev: simplify rules
  2026-02-22 15:17 [ptxdist] [PATCH 0/3] cryptodev update Ladislav Michl
  2026-02-22 15:18 ` [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1 Ladislav Michl
  2026-02-22 15:19 ` [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform Ladislav Michl
@ 2026-02-22 15:19 ` Ladislav Michl
  2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich
  2 siblings, 1 reply; 7+ messages in thread
From: Ladislav Michl @ 2026-02-22 15:19 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@triops.cz>

As a header is installed in separate cryptodev-api package rules can
call kernel build system directly.

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 rules/cryptodev.make | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/rules/cryptodev.make b/rules/cryptodev.make
index 4f4f2944a..d5e34e39a 100644
--- a/rules/cryptodev.make
+++ b/rules/cryptodev.make
@@ -45,11 +45,8 @@ CRYPTODEV_WRAPPER_ACCEPT_PATHS = \
 	$(KERNEL_DIR)
 
 CRYPTODEV_MAKE_OPT = \
-	O=$(KERNEL_BUILD_DIR) \
-	$(KERNEL_BASE_OPT) \
-	KERNEL_DIR=$(KERNEL_DIR) \
-	DESTDIR=$(CRYPTODEV_PKGDIR) \
-	prefix=/usr
+	$(KERNEL_MODULE_OPT) \
+	modules
 
 # ----------------------------------------------------------------------------
 # Install
@@ -65,7 +62,7 @@ $(STATEDIR)/cryptodev.install:
 
 $(STATEDIR)/cryptodev.targetinstall:
 	@$(call targetinfo)
-	@$(call compile, CRYPTODEV, $(CRYPTODEV_MAKE_OPT) install)
+	@$(call compile, CRYPTODEV, $(CRYPTODEV_MAKE_OPT)_install)
 	@$(call touch)
 
 # vim: syntax=make
-- 
2.47.3




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] [APPLIED] cryptodev: fix compilation with Linux-6.18-rc1
  2026-02-22 15:18 ` [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1 Ladislav Michl
@ 2026-03-09  7:22   ` Michael Olbrich
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2026-03-09  7:22 UTC (permalink / raw)
  To: ptxdist; +Cc: Ladislav Michl

Thanks, applied as c7808071d1d7eee8f4fd11539e81ff45d24c9801.

Michael

[sent from post-receive hook]

On Mon, 09 Mar 2026 08:22:20 +0100, Ladislav Michl <oss-lists@triops.cz> wrote:
> Signed-off-by: Ladislav Michl <ladis@triops.cz>
> Message-Id: <aZseOz6OvD4jmTQw@lenoch>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
> new file mode 100644
> index 000000000000..879f755e585e
> --- /dev/null
> +++ b/patches/cryptodev-linux-1.14/0004-Fix-build-for-Linux-6.18-rc1.patch
> @@ -0,0 +1,50 @@
> +From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
> +Date: Sat, 6 Sep 2025 20:36:38 +0000
> +Subject: [PATCH] Fix build for Linux 6.18-rc1
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +It's no longer required to use nth_page() when iterating pages within a
> +single scatterlist entry.
> +
> +Note I believe this code path in `sg_advance` is currently unreachable:
> +It is only called from `get_userbuf_srtp`, passing in a scatterlist
> +copied from one created by `__get_userbuf`, which only generates
> +entries such that `sg->offset + sg->length <= PAGE_SIZE`.
> +On the other hand, this code path in `sg_advance` requires that
> +`sg->offset + sg->length > sg->offset + consumed >= PAGE_SIZE`.
> +
> +See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8f03eb5f0f91fddc9bb8563c7e82bd7d3ba1dd0
> +          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce00897b94bc5c62fab962625efcf1ab824d3688
> +
> +Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
> +---
> + util.c | 5 +++++
> + 1 file changed, 5 insertions(+)
> +
> +diff --git a/util.c b/util.c
> +index 9eba4836ba6a..d42678169b2d 100644
> +--- a/util.c
> ++++ b/util.c
> +@@ -21,6 +21,7 @@
> + 
> + #include <crypto/scatterwalk.h>
> + #include <linux/scatterlist.h>
> ++#include <linux/version.h>
> + #include "util.h"
> + 
> + /* These were taken from Maxim Levitsky's patch to lkml.
> +@@ -44,8 +45,12 @@ struct scatterlist *sg_advance(struct scatterlist *sg, int consumed)
> + 	sg->length -= consumed;
> + 
> + 	if (sg->offset >= PAGE_SIZE) {
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0))
> ++		struct page *page = sg_page(sg) + (sg->offset / PAGE_SIZE);
> ++#else
> + 		struct page *page =
> + 			nth_page(sg_page(sg), sg->offset / PAGE_SIZE);
> ++#endif
> + 		sg_set_page(sg, page, sg->length, sg->offset % PAGE_SIZE);
> + 	}
> + 
> diff --git a/patches/cryptodev-linux-1.14/series b/patches/cryptodev-linux-1.14/series
> index 12704929ba01..d832ab663f39 100644
> --- a/patches/cryptodev-linux-1.14/series
> +++ b/patches/cryptodev-linux-1.14/series
> @@ -3,4 +3,5 @@
>  0001-Fix-cryptodev_verbosity-sysctl-for-Linux-6.11-rc1.patch
>  0002-Exclude-unused-struct-since-Linux-6.5.patch
>  0003-Fix-uninitialized-session-pointers.patch
> -# b25ab355176e0ac9ad9433b6a050c0e4  - git-ptx-patches magic
> +0004-Fix-build-for-Linux-6.18-rc1.patch
> +# 3025afd546f1ec2e0afecd54c87e23d2  - git-ptx-patches magic



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] [APPLIED] cryptodev: move cryptodev kernel module to platform
  2026-02-22 15:19 ` [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform Ladislav Michl
@ 2026-03-09  7:22   ` Michael Olbrich
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2026-03-09  7:22 UTC (permalink / raw)
  To: ptxdist; +Cc: Ladislav Michl

Thanks, applied as 45e5b8c6ba4ebc48e282a373bc9f00b9b0bd89f4.

Michael

[sent from post-receive hook]

On Mon, 09 Mar 2026 08:22:20 +0100, Ladislav Michl <oss-lists@triops.cz> wrote:
> Signed-off-by: Ladislav Michl <ladis@triops.cz>
> Message-Id: <aZseaaVemMqQY-iT@lenoch>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/cryptodev.in b/platforms/cryptodev.in
> similarity index 89%
> rename from rules/cryptodev.in
> rename to platforms/cryptodev.in
> index f59d8f58cc88..59d4aa9f062c 100644
> --- a/rules/cryptodev.in
> +++ b/platforms/cryptodev.in
> @@ -1,4 +1,4 @@
> -## SECTION=core
> +## SECTION=platform_project_specific
>  
>  config CRYPTODEV
>  	tristate
> diff --git a/rules/cryptodev-api.in b/rules/cryptodev-api.in
> index 86af4ed2302a..10a42c46d116 100644
> --- a/rules/cryptodev-api.in
> +++ b/rules/cryptodev-api.in
> @@ -2,7 +2,6 @@
>  
>  config CRYPTODEV_API
>  	tristate
> -	select CRYPTODEV	if RUNTIME
>  	prompt "cryptodev API"
>  	help
>  	  API headers for Cryptodev-linux. This is needed to build
> diff --git a/rules/cryptodev-api.make b/rules/cryptodev-api.make
> index 606108bd97b1..762195278d2e 100644
> --- a/rules/cryptodev-api.make
> +++ b/rules/cryptodev-api.make
> @@ -18,6 +18,7 @@ CRYPTODEV_API_VERSION	= $(CRYPTODEV_VERSION)
>  CRYPTODEV_API_MD5	= $(CRYPTODEV_MD5)
>  CRYPTODEV_API		= cryptodev-api-$(CRYPTODEV_API_VERSION)
>  CRYPTODEV_API_SUFFIX	= tar.gz
> +CRYPTODEV_API_PATCHES	= $(CRYPTODEV)
>  CRYPTODEV_API_URL	= $(CRYPTODEV_URL)
>  CRYPTODEV_API_SOURCE	= $(CRYPTODEV_SOURCE)
>  CRYPTODEV_API_DIR	= $(BUILDDIR)/$(CRYPTODEV_API)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ptxdist] [APPLIED] cryptodev: simplify rules
  2026-02-22 15:19 ` [ptxdist] [PATCH 3/3] cryptodev: simplify rules Ladislav Michl
@ 2026-03-09  7:22   ` Michael Olbrich
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2026-03-09  7:22 UTC (permalink / raw)
  To: ptxdist; +Cc: Ladislav Michl

Thanks, applied as 008e89d44e4edf389ec17f1ae4d0a41b31787a4b.

Michael

[sent from post-receive hook]

On Mon, 09 Mar 2026 08:22:21 +0100, Ladislav Michl <oss-lists@triops.cz> wrote:
> As a header is installed in separate cryptodev-api package rules can
> call kernel build system directly.
> 
> Signed-off-by: Ladislav Michl <ladis@triops.cz>
> Message-Id: <aZsemdV8RhiCkBxQ@lenoch>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/cryptodev.make b/rules/cryptodev.make
> index 4f4f2944a22c..d5e34e39a4fa 100644
> --- a/rules/cryptodev.make
> +++ b/rules/cryptodev.make
> @@ -45,11 +45,8 @@ CRYPTODEV_WRAPPER_ACCEPT_PATHS = \
>  	$(KERNEL_DIR)
>  
>  CRYPTODEV_MAKE_OPT = \
> -	O=$(KERNEL_BUILD_DIR) \
> -	$(KERNEL_BASE_OPT) \
> -	KERNEL_DIR=$(KERNEL_DIR) \
> -	DESTDIR=$(CRYPTODEV_PKGDIR) \
> -	prefix=/usr
> +	$(KERNEL_MODULE_OPT) \
> +	modules
>  
>  # ----------------------------------------------------------------------------
>  # Install
> @@ -65,7 +62,7 @@ $(STATEDIR)/cryptodev.install:
>  
>  $(STATEDIR)/cryptodev.targetinstall:
>  	@$(call targetinfo)
> -	@$(call compile, CRYPTODEV, $(CRYPTODEV_MAKE_OPT) install)
> +	@$(call compile, CRYPTODEV, $(CRYPTODEV_MAKE_OPT)_install)
>  	@$(call touch)
>  
>  # vim: syntax=make



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-09  7:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-22 15:17 [ptxdist] [PATCH 0/3] cryptodev update Ladislav Michl
2026-02-22 15:18 ` [ptxdist] [PATCH 1/3] cryptodev: fix compilation with Linux-6.18-rc1 Ladislav Michl
2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich
2026-02-22 15:19 ` [ptxdist] [PATCH 2/3] cryptodev: move cryptodev kernel module to platform Ladislav Michl
2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich
2026-02-22 15:19 ` [ptxdist] [PATCH 3/3] cryptodev: simplify rules Ladislav Michl
2026-03-09  7:22   ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox