Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1289188ybi; Thu, 30 May 2019 15:01:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZZw1tfSmBeGgfuhK9xtaVyBITvbo1ObSY6Lhc9fH8aldEwiojYxXtZ+3YoStVqdZz75Ai X-Received: by 2002:a63:5e42:: with SMTP id s63mr5701646pgb.234.1559253673534; Thu, 30 May 2019 15:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559253673; cv=none; d=google.com; s=arc-20160816; b=0s2eBT6lnNxHe4gYhtnbQXWjPNPigsKH/MQR8u2PZVfT0aRK3T2D5ZNvMMBHpPNRDW MH05qT9k8vSGin4PsJJC9rFBi2lJla69aRRza7lkIIJQlwM0juQqUvriS85ViuOCoaGT aBO6c3ysVwOZQr6HTYNkJaBbUCSMyhkiHkJ/8tiGgNXvSogR06Zk5lqfnKiGEddYyv+y uXJn2cTq4bidLngsNtWwgZcVR+lu1zrH8MftkMZvUz6OVSpFlLzrVGL7/ZjrJELg3PDE eDk/VbJBmnguLQcIHZWzgz8iZqhjdEvFlaJbmI/ipDzv2daTLLyi3Wgb8y+lg8YyuX6a Roiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=rb7SlVs13HMhFjzgqp6Uf0KOsaQIZ0naFm1S4PgFJDw=; b=RDOQwjbJqvWxWysXv2yPS+oMs9uyhW8mwCQW60N3Ed//m0ojJrrj4TqCvx52fEvDfC C/cg/32ZiLknwQ9HuJT+SooXI/HtrbwhrQUwi3aG3qO7SV/dqryvvWJrX+dpI1Pe+NyU cb00sABRcGvwgJqlA2z3qsBIttLZJaRPB1BjYOGfjxzxx5C7+kefd6IQSpLtilYfNusY fooxP0CKSOSBSa+CUgZuI3S2KkIPSmtMouszTTx5VUDoPEOvyMnDgQhb1KakdV5MDHaW 5RJCAsNpFvVxMpGVb9+GAa4wC4O5VwO6E1IGj3kqvBspDaB/cRPgnEf+DOq2A13hDAdz m97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=OBwDK5n2; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21si4259243pfm.18.2019.05.30.15.00.50; Thu, 30 May 2019 15:01:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@nxp.com header.s=selector2 header.b=OBwDK5n2; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbfE3WAr (ORCPT + 99 others); Thu, 30 May 2019 18:00:47 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:21566 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726308AbfE3WAr (ORCPT ); Thu, 30 May 2019 18:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rb7SlVs13HMhFjzgqp6Uf0KOsaQIZ0naFm1S4PgFJDw=; b=OBwDK5n23erKtdqurAo3oc4WROwSw6qGjiXgZmlbtT4VIirTVLwHXvZzCIQ8AxvH9JQy8H79OMW4aphYFPreFw1v32l8zC8MZLphqCu0eWa8IFfEnYEvxMbvNsZJysjvNw7I31gH7B0cmwNDbTtZi29ryJjiudXjziI1Y72/Pcw= Received: from VI1PR04MB4445.eurprd04.prod.outlook.com (20.177.55.161) by VI1PR04MB3120.eurprd04.prod.outlook.com (10.170.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.16; Thu, 30 May 2019 22:00:41 +0000 Received: from VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::39fd:f3c3:46fc:f872]) by VI1PR04MB4445.eurprd04.prod.outlook.com ([fe80::39fd:f3c3:46fc:f872%7]) with mapi id 15.20.1922.021; Thu, 30 May 2019 22:00:41 +0000 From: Iuliana Prodan To: Ard Biesheuvel , Herbert Xu CC: Eric Biggers , "David S. Miller" , Horia Geanta , Sascha Hauer , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Kernel Mailing List , dl-linux-imx Subject: Re: [PATCH] crypto: gcm - fix cacheline sharing Thread-Topic: [PATCH] crypto: gcm - fix cacheline sharing Thread-Index: AQHVFkF/PjPULMOhfkiEXDJZ6fiBzQ== Date: Thu, 30 May 2019 22:00:41 +0000 Message-ID: References: <20190529202728.GA35103@gmail.com> <20190530133427.qrwjzctac2x6nsby@gondor.apana.org.au> <20190530142734.qlhgzeal22zxfhk5@gondor.apana.org.au> <20190530143438.d62y3woaogyivqpm@gondor.apana.org.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=iuliana.prodan@nxp.com; x-originating-ip: [92.121.36.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2082bcdc-facd-4552-142f-08d6e54a41d6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:VI1PR04MB3120; x-ms-traffictypediagnostic: VI1PR04MB3120: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 00531FAC2C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(376002)(366004)(396003)(346002)(54094003)(189003)(199004)(91956017)(4326008)(76116006)(44832011)(81166006)(64756008)(476003)(102836004)(6506007)(229853002)(3846002)(81156014)(478600001)(316002)(66476007)(66946007)(446003)(6116002)(76176011)(25786009)(68736007)(66556008)(8676002)(86362001)(66446008)(71200400001)(52536014)(71190400001)(486006)(53546011)(5660300002)(256004)(99286004)(74316002)(73956011)(53936002)(6246003)(66066001)(8936002)(6436002)(54906003)(2906002)(26005)(186003)(33656002)(55016002)(305945005)(14454004)(14444005)(7696005)(9686003)(7736002)(110136005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB3120;H:VI1PR04MB4445.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +nwIWaTlOJijHtCig8jeeLVG2745XxbD15US7cpL4D3U4XLtF/IOXbPfWS0nOB57MGXYom1k/dDWitrFY+ca7FuafLDVqfhrV8T1pw+1anXgfzV3L2Y3e8x1E5Nd7k8E9djlEnxjgv2BG/uk2F6q7YjYAuAihbzvqYr/MTrGnaj85kYoeMHZtiL01hwWJ1mOH9u4pY+9rEi8cxduQS+Xk6yLiVgThM+Rs4nPr1F1QKBXk3LnLiPbctQfUcc4nKsYdNxux1Zo1XMa42jltILIBtgT/6Ex69s6YuIuy8lXCdpydlcXgk6R0eUThUrPPt2sbNGECVHY0rTXfPZZUz1CcXneLnK8E59VwoPDO+Pnh+3Qw4hBHhdTv9EJP9W4uuLosMVceesA+bg4EmaEgyF0NTPVHk2+q6cPqjK9+BKm5Og= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2082bcdc-facd-4552-142f-08d6e54a41d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2019 22:00:41.3703 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iuliana.prodan@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3120 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/30/2019 6:05 PM, Ard Biesheuvel wrote:=0A= > On Thu, 30 May 2019 at 16:34, Herbert Xu wr= ote:=0A= >>=0A= >> On Thu, May 30, 2019 at 04:31:09PM +0200, Ard Biesheuvel wrote:=0A= >>>=0A= >>> This might work:=0A= >>=0A= >> Looks good to me.=0A= >>=0A= > =0A= > Thanks Herbert,=0A= > =0A= > But given your remark regarding CBC being the only algo that has this=0A= > requirement, I wonder if this might be sufficient as well.=0A= > =0A= > diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.= c=0A= > index c0ece44f303b..65b050e3742f 100644=0A= > --- a/drivers/crypto/caam/caamalg.c=0A= > +++ b/drivers/crypto/caam/caamalg.c=0A= > @@ -1844,7 +1844,7 @@ static int skcipher_decrypt(struct skcipher_request= *req)=0A= > * The crypto API expects us to set the IV (req->iv) to the last= =0A= > * ciphertext block.=0A= > */=0A= > - if (ivsize)=0A= > + if (ctx->cdata.algtype & OP_ALG_AAI_CBC)=0A= > scatterwalk_map_and_copy(req->iv, req->src, req->cryptle= n -=0A= > ivsize, ivsize, 0);=0A= > =0A= > =0A= > Iulia, Horia?=0A= > =0A= I can confirm that gcm (and ccm), with ctr-aes-caam, is passing with the = =0A= above fix.=0A= =0A= Thanks,=0A= Iulia=0A=