Received: by 10.223.164.221 with SMTP id h29csp1192710wrb; Sun, 22 Oct 2017 00:28:24 -0700 (PDT) X-Received: by 10.99.52.194 with SMTP id b185mr8566455pga.170.1508657304484; Sun, 22 Oct 2017 00:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508657304; cv=none; d=google.com; s=arc-20160816; b=0Q0N5D2N3VjZUx62kNQvpUV7//c6FkNKxtqlsl8X6ssrggi7IFpADTGrhbyA5v7WaV Dey4Jku9B1344fIkfSIAr3tEI9BqsWEq+nUyyafgpVumjiL/lhZtnrCT86dMCCEGioaF tFIKMKYGjfHGHxxw9K6GiBTjNEuEvr3kJh8woAMXoraHzE6AciZvH+Nrmr9UgZJ4Sf7J n9c9PRgo+Qi6gFt4FVv/hx7C9xxbpk3aygvP3qaAdjTdtxY9vwOzFmmOJc6rPreacr2r XdXO4HVC1FLaHpyg/1O9efavqzmPiy1fmyn0qzO62aayj8wTeXvrOWHre5o6WNAyBmIF RtOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KgdcSpz+houK6JmJGrgkM/JpT8UbkJomCd8uItx4Mbc=; b=Ym5zb273d+Avh0PVuN/uErzVK4uErplqb2DxJO0WQP2Nm7+BqfvhpwJTlUVWgA1HK8 xvb9UiN5AC3iUFSNjdF9quDZ06xzcpaLWZ1/E/KEtVMHhgqnTaDK335/E6FbZBQhg4SB kdmMalJVCmVrFohJiOok6Yj+ZmPPoAHkIMwN+Hfvqy7M7SQzzDoCx3ZR/pcnqdpPUp9L XWj7ERgEzatk86ynw8mAH0W9zZkZLUsxD3ME2e2PFsSa59KiYLK/V4Z3TS0wdKxg90Qr 0zeqGAWuG7keUgKjK9TlgRNP2O9r5ffiOq+biRFcv075eDGPt5YwddN5opmX7BJ02e8w CHnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AMf/yBgF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si3191083pgt.161.2017.10.22.00.27.48; Sun, 22 Oct 2017 00:28:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AMf/yBgF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbdJVH1G (ORCPT + 99 others); Sun, 22 Oct 2017 03:27:06 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:47574 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdJVH1E (ORCPT ); Sun, 22 Oct 2017 03:27:04 -0400 Received: by mail-wm0-f67.google.com with SMTP id t69so4222056wmt.2; Sun, 22 Oct 2017 00:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KgdcSpz+houK6JmJGrgkM/JpT8UbkJomCd8uItx4Mbc=; b=AMf/yBgF+Avv4+AEoy+t6BpL4UwUcXf79LwYQw6eWCofXo8PZJNETRuVdl238+NCeS /kCxAqe+dNF1lixZ0HZfRuB0+C089eJNwqHDFHhBXBkiaIf4FIRemuHgOFVFxlDWDnzG oY2aM1GZKbPC6Vv9kG5jPwpWE8V2v1uPuyHLR27vFFSBqIl2Ibsc2ws777NyDZYkuGc9 3q8XVXJKnkJAC8E4XUdb1YIq9Lo7jxitqAT4HCVUZb51t59Wcn3dRNo6WQquvcYR/Skw dY9aKOHTFfrwI/N7+EBKYYGUUpL1SiwncaCz+Nz2uqsoLIvYd8PtcqwaIp4Nb6pmPjTe uzIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KgdcSpz+houK6JmJGrgkM/JpT8UbkJomCd8uItx4Mbc=; b=aFsO+6lhxRCUj9N8mwwiSmf7xkYFRoZ1u5TEL93OMFvcYqRHPPKq0VTxkeiCZy8fQB blJU5Ss1Fbi7jhYiH91GolwjF0vhFU3k8gdnFgv99NxBw8QZA+07DVB4ETyuYgJOYPZU pWRH6IFtLBZq6qDaNt+bwYlPHwYm35Vxtspk3TCVM954OidIGdrWylOxvQ/MCCLMZUwO SeHqUcUR3JZehX7IxTgk8Bgr2EteIt2woF1l4bRP+WPjvY1xg5m1JuYRRs1gEUOWeohP Tu8HPlZoBnBlyFUv1vsfgUhmRs9M/Q4x2VmtwD7Ags1f8BBq5yLygBfybcx2LLG0n+Bj vVfg== X-Gm-Message-State: AMCzsaXkz8ZfCVExWNiCwGgY7099OQUCPXzSOSvr1e4I8+XqaFl5yvSD I3swWemryHYGan12dywsErd8h6u3 X-Google-Smtp-Source: ABhQp+QTAuaY0k6gLsT9EmjqpurWvntwMEoGeAcmzQkkkqdY6ATiP03kBXujeu38fJ45qS47yTXN3A== X-Received: by 10.80.141.79 with SMTP id t15mr1261409edt.70.1508657222874; Sun, 22 Oct 2017 00:27:02 -0700 (PDT) Received: from Red ([2a01:cb1d:16e:1300:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id d12sm4806814eda.27.2017.10.22.00.27.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2017 00:27:02 -0700 (PDT) Date: Sun, 22 Oct 2017 09:26:59 +0200 From: Corentin Labbe To: Fabien Dessenne Cc: Herbert Xu , "David S . Miller" , Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre Torgue , linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lionel Debieve , Benjamin Gaignard , Ludovic Barre Subject: Re: [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module Message-ID: <20171022072659.GB8489@Red> References: <1508425830-13565-1-git-send-email-fabien.dessenne@st.com> <1508425830-13565-3-git-send-email-fabien.dessenne@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1508425830-13565-3-git-send-email-fabien.dessenne@st.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > --- > 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 From 1581700133755457320@xxx Thu Oct 19 15:26:33 +0000 2017 X-GM-THRID: 1581700133755457320 X-Gmail-Labels: Inbox,Category Forums