Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp962460ybm; Tue, 21 May 2019 06:37:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMJREdC3a2lDWdf0Ww0SwFErV8jQv10WFSANq4IGQF6/sPO7vWH9t17rkKzVAZHTa+zCzS X-Received: by 2002:a63:e616:: with SMTP id g22mr14733863pgh.61.1558445830065; Tue, 21 May 2019 06:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558445830; cv=none; d=google.com; s=arc-20160816; b=pVFNJbXdJsd+VguqoC5c/eqgux5KtPcU6Ys5iqGB+XqUtuermzsvEbo4xr34M8l/m2 N1TdOpX7mqJcV6BWfbnPNqsgjlxz0jyz1sNXRRzuwcC9ogeVw1jYptxFOYXmjBYZrCZu BGDnatg0DFF2GFQL6DEHGtvV/Pl6WvoAhP7Mm8q9SC7VW/eaNgSQZuqltbAjCNi87wJ0 a9rzGhS1faEvW9+BYae2KENFvWrYMSjyDkEXjiLQFXdDrSb3bRXykw39T9+oqPCIYrR8 7mC9lM51d41GD5c+ohxDRRtIA6eWx1eiYpSOZJD57HQye43FtopDoVEvNE7TE7q1i8Dp BgWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=dIcYGD04oevPJ+O9RX9tz1rHLgXACfTYanLnbPvtcUs=; b=trb7rIyovupnl6uqUP/juyPl1r9uqb01FxZPyXlSOX1Oip8DQBKc8Vq0cGS0Pf0+YP jFB5unkLxoUa9JTACIgOCRNVD2Q5+2mAh7Tc2Q/jJ9XLbzTBdn7HwTlmIs3IrCUCVOOP A7QSO71lPoyUVftZT8+a0uIQOwxYCMtLPA7mI8J3AgCDC0Nh3kG9zkh9dp9uYsA+my93 w7yV84UnaYSSPRODyIKMIWMMlegvutOX6pdn4ouOLQn5MrTPRhmv4SnHyQFT9RCE/PA5 QwI9T/suNY3NjpTNw/9bOQdg13fzP5rgwJhSOkGg3JBAolYIdm7Y+V+miR1onV9yj5LM sZnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="o/gnp2xg"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g67si9201503pgc.344.2019.05.21.06.36.54; Tue, 21 May 2019 06:37:10 -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=@c-s.fr header.s=mail header.b="o/gnp2xg"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728565AbfEUNev (ORCPT + 99 others); Tue, 21 May 2019 09:34:51 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:15725 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728487AbfEUNeT (ORCPT ); Tue, 21 May 2019 09:34:19 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 457cDn1G9tz9v2Xg; Tue, 21 May 2019 15:34:17 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=o/gnp2xg; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id wKa2lSF93ERs; Tue, 21 May 2019 15:34:17 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 457cDn0F2Jz9v2Xf; Tue, 21 May 2019 15:34:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1558445657; bh=dIcYGD04oevPJ+O9RX9tz1rHLgXACfTYanLnbPvtcUs=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=o/gnp2xgdxEIkS+KF0gdhKmotoVhGMCqmxJFaEr23rgTSu4pSQXsA41yyOvybE4eT N+imzO9FeVrOFo7cAJZFhJ+d1dNmxm/NPd9YH92l5f7xxcytPzbaIQMaOdPa4Oh15i s/AHHgoh5yn0nuJWlgaR+jtYiQIZCl5UK90QOyFo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 726468B80C; Tue, 21 May 2019 15:34:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Sym30Y13iXDc; Tue, 21 May 2019 15:34:18 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4542F8B803; Tue, 21 May 2019 15:34:18 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0C5F568458; Tue, 21 May 2019 13:34:18 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 11/15] crypto: talitos - Align SEC1 accesses to 32 bits boundaries. To: Herbert Xu , "David S. Miller" , horia.geanta@nxp.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 21 May 2019 13:34:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MPC885 reference manual states: SEC Lite-initiated 8xx writes can occur only on 32-bit-word boundaries, but reads can occur on any byte boundary. Writing back a header read from a non-32-bit-word boundary will yield unpredictable results. In order to ensure that, cra_alignmask is set to 3 for SEC1. Signed-off-by: Christophe Leroy Fixes: 9c4a79653b35 ("crypto: talitos - Freescale integrated security engine (SEC) driver") --- drivers/crypto/talitos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 7c8a3a717b91..750b0159e654 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3327,7 +3327,10 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, alg->cra_priority = t_alg->algt.priority; else alg->cra_priority = TALITOS_CRA_PRIORITY; - alg->cra_alignmask = 0; + if (has_ftr_sec1(priv)) + alg->cra_alignmask = 3; + else + alg->cra_alignmask = 0; alg->cra_ctxsize = sizeof(struct talitos_ctx); alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY; -- 2.13.3