All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Fabien Dessenne <fabien.dessenne-qxv4g6HH51o@public.gmane.org>
Cc: Herbert Xu
	<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
	"David S . Miller"
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Lionel Debieve <lionel.debieve-qxv4g6HH51o@public.gmane.org>,
	Benjamin Gaignard
	<benjamin.gaignard-qxv4g6HH51o@public.gmane.org>,
	Ludovic Barre <ludovic.barre-qxv4g6HH51o@public.gmane.org>
Subject: Re: [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module
Date: Sun, 22 Oct 2017 09:26:59 +0200	[thread overview]
Message-ID: <20171022072659.GB8489@Red> (raw)
In-Reply-To: <1508425830-13565-3-git-send-email-fabien.dessenne-qxv4g6HH51o@public.gmane.org>

On Thu, Oct 19, 2017 at 05:10:30PM +0200, Fabien Dessenne wrote:
> This module registers block cipher algorithms that make use of the
> STMicroelectronics STM32 crypto "CRYP1" hardware.
> The following algorithms are supported:
> - aes: ecb, cbc, ctr
> - des: ecb, cbc
> - tdes: ecb, cbc
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne-qxv4g6HH51o@public.gmane.org>
> ---
>  drivers/crypto/stm32/Kconfig      |    9 +
>  drivers/crypto/stm32/Makefile     |    3 +-
>  drivers/crypto/stm32/stm32-cryp.c | 1172 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 1183 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/crypto/stm32/stm32-cryp.c
> 
> diff --git a/drivers/crypto/stm32/Kconfig b/drivers/crypto/stm32/Kconfig
> +static void stm32_cryp_irq_write_block(struct stm32_cryp *cryp)
> +{
> +	unsigned int i, j;
> +	u32 *src;
> +	u8 d8[4];
> +
> +	src = sg_virt(cryp->in_sg) + _walked_in;
> +
> +	for (i = 0; i < cryp->hw_blocksize / sizeof(u32); i++) {
> +		if (likely(cryp->total_in >= sizeof(u32))) {
> +			/* Write a full u32 */
> +			stm32_cryp_write(cryp, CRYP_DIN, *src);

Hello

Try also to test your driver with userspace via AF_ALG (libkcapi is a good start).
It should probably crash here.
I have do the same on my first sunxi-ss driver and you should use kmap().

Regards
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: clabbe.montjoie@gmail.com (Corentin Labbe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module
Date: Sun, 22 Oct 2017 09:26:59 +0200	[thread overview]
Message-ID: <20171022072659.GB8489@Red> (raw)
In-Reply-To: <1508425830-13565-3-git-send-email-fabien.dessenne@st.com>

On Thu, Oct 19, 2017 at 05:10:30PM +0200, Fabien Dessenne wrote:
> This module registers block cipher algorithms that make use of the
> STMicroelectronics STM32 crypto "CRYP1" hardware.
> The following algorithms are supported:
> - aes: ecb, cbc, ctr
> - des: ecb, cbc
> - tdes: ecb, cbc
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---
>  drivers/crypto/stm32/Kconfig      |    9 +
>  drivers/crypto/stm32/Makefile     |    3 +-
>  drivers/crypto/stm32/stm32-cryp.c | 1172 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 1183 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/crypto/stm32/stm32-cryp.c
> 
> diff --git a/drivers/crypto/stm32/Kconfig b/drivers/crypto/stm32/Kconfig
> +static void stm32_cryp_irq_write_block(struct stm32_cryp *cryp)
> +{
> +	unsigned int i, j;
> +	u32 *src;
> +	u8 d8[4];
> +
> +	src = sg_virt(cryp->in_sg) + _walked_in;
> +
> +	for (i = 0; i < cryp->hw_blocksize / sizeof(u32); i++) {
> +		if (likely(cryp->total_in >= sizeof(u32))) {
> +			/* Write a full u32 */
> +			stm32_cryp_write(cryp, CRYP_DIN, *src);

Hello

Try also to test your driver with userspace via AF_ALG (libkcapi is a good start).
It should probably crash here.
I have do the same on my first sunxi-ss driver and you should use kmap().

Regards

WARNING: multiple messages have this Message-ID (diff)
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Fabien Dessenne <fabien.dessenne@st.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	linux-crypto@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Lionel Debieve <lionel.debieve@st.com>,
	Benjamin Gaignard <benjamin.gaignard@st.com>,
	Ludovic Barre <ludovic.barre@st.com>
Subject: Re: [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module
Date: Sun, 22 Oct 2017 09:26:59 +0200	[thread overview]
Message-ID: <20171022072659.GB8489@Red> (raw)
In-Reply-To: <1508425830-13565-3-git-send-email-fabien.dessenne@st.com>

On Thu, Oct 19, 2017 at 05:10:30PM +0200, Fabien Dessenne wrote:
> This module registers block cipher algorithms that make use of the
> STMicroelectronics STM32 crypto "CRYP1" hardware.
> The following algorithms are supported:
> - aes: ecb, cbc, ctr
> - des: ecb, cbc
> - tdes: ecb, cbc
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---
>  drivers/crypto/stm32/Kconfig      |    9 +
>  drivers/crypto/stm32/Makefile     |    3 +-
>  drivers/crypto/stm32/stm32-cryp.c | 1172 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 1183 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/crypto/stm32/stm32-cryp.c
> 
> diff --git a/drivers/crypto/stm32/Kconfig b/drivers/crypto/stm32/Kconfig
> +static void stm32_cryp_irq_write_block(struct stm32_cryp *cryp)
> +{
> +	unsigned int i, j;
> +	u32 *src;
> +	u8 d8[4];
> +
> +	src = sg_virt(cryp->in_sg) + _walked_in;
> +
> +	for (i = 0; i < cryp->hw_blocksize / sizeof(u32); i++) {
> +		if (likely(cryp->total_in >= sizeof(u32))) {
> +			/* Write a full u32 */
> +			stm32_cryp_write(cryp, CRYP_DIN, *src);

Hello

Try also to test your driver with userspace via AF_ALG (libkcapi is a good start).
It should probably crash here.
I have do the same on my first sunxi-ss driver and you should use kmap().

Regards

  parent reply	other threads:[~2017-10-22  7:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 15:10 [PATCH v5 0/2] STM32 CRYP crypto driver Fabien Dessenne
2017-10-19 15:10 ` Fabien Dessenne
2017-10-19 15:10 ` Fabien Dessenne
2017-10-19 15:10 ` [PATCH v5 1/2] dt-bindings: Document STM32 CRYP bindings Fabien Dessenne
2017-10-19 15:10   ` Fabien Dessenne
2017-10-19 15:10   ` Fabien Dessenne
     [not found] ` <1508425830-13565-1-git-send-email-fabien.dessenne-qxv4g6HH51o@public.gmane.org>
2017-10-19 15:10   ` [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module Fabien Dessenne
2017-10-19 15:10     ` Fabien Dessenne
2017-10-19 15:10     ` Fabien Dessenne
2017-10-19 15:10     ` Fabien Dessenne
     [not found]     ` <1508425830-13565-3-git-send-email-fabien.dessenne-qxv4g6HH51o@public.gmane.org>
2017-10-22  7:26       ` Corentin Labbe [this message]
2017-10-22  7:26         ` Corentin Labbe
2017-10-22  7:26         ` Corentin Labbe
2017-11-07 14:40         ` Fabien DESSENNE
2017-11-07 14:40           ` Fabien DESSENNE
     [not found]           ` <d924a278-90d0-969e-f1ae-a12f92e8972d-qxv4g6HH51o@public.gmane.org>
2017-11-13 10:30             ` Fabien DESSENNE
2017-11-13 10:30               ` Fabien DESSENNE
2017-11-13 10:30               ` Fabien DESSENNE
2017-11-28  9:47               ` Fabien DESSENNE
2017-11-28  9:47                 ` Fabien DESSENNE
2017-11-28  9:47                 ` Fabien DESSENNE
2017-11-29  6:29 ` [PATCH v5 0/2] STM32 CRYP crypto driver Herbert Xu
2017-11-29  6:29   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171022072659.GB8489@Red \
    --to=clabbe.montjoie-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
    --cc=benjamin.gaignard-qxv4g6HH51o@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=fabien.dessenne-qxv4g6HH51o@public.gmane.org \
    --cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lionel.debieve-qxv4g6HH51o@public.gmane.org \
    --cc=ludovic.barre-qxv4g6HH51o@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.