Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbcCGEAR (ORCPT ); Sun, 6 Mar 2016 23:00:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49094 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbcCGD7z (ORCPT ); Sun, 6 Mar 2016 22:59:55 -0500 X-AuditID: cbfec7f5-f79b16d000005389-1d-56dcfcb64a8e Subject: Re: [PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers To: Vladimir Zapolskiy , Krzysztof Kozlowski , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org References: <1457259436-32560-1-git-send-email-krzk@kernel.org> <1457259436-32560-2-git-send-email-krzk@kernel.org> <56DCD938.7090100@mleia.com> From: Krzysztof Kozlowski X-Enigmail-Draft-Status: N1110 Message-id: <56DCFCB2.2090409@samsung.com> Date: Mon, 07 Mar 2016 12:59:46 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <56DCD938.7090100@mleia.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t/xq7rb/twJMzhxTMlizvkWFovuVzIW r18YWpw/v4Hd4v69n0wWl3fNYbOYcX4fk8X/X83MDhweW1beZPLYdkDVY9OqTjaPfwunsHj0 bVnF6PF5k1wAWxSXTUpqTmZZapG+XQJXxs8Td9kKNvFWfHi7hrGB8Q1XFyMnh4SAicT5fUcY IWwxiQv31rN1MXJxCAksZZSYOOcflPOUUeLlo2/sIFXCAs4SS6ffZQVJiAi0MElM6djGAlE1 hVFixvY2VpAqNgFjic3Ll7BBzJWT6O2exAJi8wpoSTzoeMwEYrMIqEp8bd/ODGKLCkRIHO7s YoeoEZT4MfkeWD2ngKZEw8wtQDUcHMwCehL3L2qBhJkF5CU2r3nLPIFRYBaSjlkIVbOQVC1g ZF7FKJpamlxQnJSea6RXnJhbXJqXrpecn7uJERL0X3cwLj1mdYhRgINRiYfXYsntMCHWxLLi ytxDjBIczEoivK8+3gkT4k1JrKxKLcqPLyrNSS0+xCjNwaIkzjtz1/sQIYH0xJLU7NTUgtQi mCwTB6dUA6Ocu/Tvj9//Kq2qEa9lUT1gtOTC+Xlfg85sirQtV2idUinzgWH+lJ63gYLJyd47 Lt3qSi39q6IkvIivQHnq0bZkRu8dLFxPG3Vd7Pmrnjo91d18hkn5/ceHMumnmwr+FzhaTdjk UpF6b0/g4i+fgjhK1ncef/P7z5LeMh6f8nNhqs7x9rX7HyuxFGckGmoxFxUnAgAahCngdgIA AA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1663 Lines: 49 On 07.03.2016 10:28, Vladimir Zapolskiy wrote: > Hi Krzysztof, > > On 06.03.2016 12:17, Krzysztof Kozlowski wrote: >> During crypto selftests on Odroid XU3 (Exynos5422) some of the >> algorithms failed because of passing AES-block unaligned source and >> destination buffers: > > excuse my ignorance what are the crypto selftests you reference? Are they > run-time self tests run by crypto manager on algorithm registration? Yes, these tests. Disabled by CRYPTO_MANAGER_DISABLE_TESTS. > >> alg: skcipher: encryption failed on chunk test 1 for ecb-aes-s5p: ret=22 >> >> Handle such case by copying the buffers to a new aligned and contiguous >> space. > > I'm not quite convinced that a particular crypto accelerator driver > is the right place for this change, at least I don't see in the change > anything S5P-SSS specific, but it might be good to add the change. The driver sets a .cra_alignmask but docs are saying that re-alignment by crypto API might not happen. And in fact for selftets the data was coming sometimes not-aligned. On the other hand the CRYPTO_TEST was providing aligned data. > > Briefly looking at other drivers similarly atmel-* and omap-* have > slow path fallbacks, ./rockchip/rk3288_crypto_ablkcipher.c fails like > s5p-sss etc. Yes, I was kind of inspired by the omap solution. > Anyway since it is a valid improvement, please feel free to add my > > Acked-by: Vladimir Zapolskiy Thanks! Krzysztof > >> Signed-off-by: Krzysztof Kozlowski >> --- >> drivers/crypto/s5p-sss.c | 149 +++++++++++++++++++++++++++++++++++++++++++---- >> 1 file changed, 137 insertions(+), 12 deletions(-) >>