Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp785290ybi; Thu, 30 May 2019 06:46:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqypKrfIGtxdz9P31p4mCO/5ZwrBt2uIXoJGXUuiwkIrL8rXyGNRPA5OmFptRKCzbQPyH+yK X-Received: by 2002:a17:902:e2:: with SMTP id a89mr3874076pla.210.1559223968775; Thu, 30 May 2019 06:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559223968; cv=none; d=google.com; s=arc-20160816; b=IGBJg0JQYdyhpZy3ckK9aE2nfqTO3mTZxLa+i42uWwTSYMpFDdr03jm+pz9r39RP2f agtucuZStnwnK0MISErLdfuaWle2XF0xm2nFpBrc9ZLYVDvgNNq/4TlAsY01PoU+T7yN bKU0ufjniEIXXvjU4aoC4apK3ODgWqhKFj1Kys8DuLDW3RTcQgZIvaOPdm4lu3GjvmW/ C2Pnn6tLhbB0S0Z8udu1/3t7/kSnMT1d1jwj48u+Ucc7yUs2jkEmkdXJ+qDlBhX/o04p i3uUyqeXEAjySrbVNqAUS4W20KvB/8w4aa02X94d+dUa6rOGPHc1nnqJ6u96evwejDP2 Nt7Q== 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=TNuPzzuKwevPJZO0nIXfqNwbwVit452pWgKVnnPz04c=; b=ClxUAvoo0Rm2h0PbXq9/8dUrbgMn+EzrnmiaHq+Xf7WBZ0M6ydYN1AiaozYQggq6E3 6XnNh+GrGlj/IBTsh3xAwGejyZvNg9YNf7axWN5vBdLTnIMz0Jxlq0tj8FgCwBzSiV77 RIHNfxI+ssDg+qWjVWMMaeVsQRFP6A/P4QelI4l0jI1HN1Mo3plFDP4k6x5kdIXQ7s5/ xGjQlZke/DjQwAQDRtgve1mwMRghPjS3utDHCdlemcSehXi4JHZh06G8wMJ7/2LP/fKT OqB9JCtHidlST/DzjAX1kHtE/LjR6B22TRgnyebBV5Xrkq0R4u15+JNQo3eh86VsfYtO logg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=a4w65cG1; 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 c7si2991972pgd.512.2019.05.30.06.45.53; Thu, 30 May 2019 06:46:08 -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=a4w65cG1; 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 S1726829AbfE3Npw (ORCPT + 99 others); Thu, 30 May 2019 09:45:52 -0400 Received: from mail-eopbgr20089.outbound.protection.outlook.com ([40.107.2.89]:27968 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726851AbfE3Npv (ORCPT ); Thu, 30 May 2019 09:45:51 -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=TNuPzzuKwevPJZO0nIXfqNwbwVit452pWgKVnnPz04c=; b=a4w65cG1JtTVNOGrwhcdpml1TQraoPKn0kPH4vUJZJ1JoZFDCLV6Pp9KzaKjHLIgD8z8X0HHatx0/e7n9jYXGnKZaXmBb2/WwvDRMCLSVdYjXcLpaqTYGIMtVSMlcXK0ousD9VEpu2AEApcC4oHqA5yeicBH0cODwi8Y1LF7dz4= Received: from VI1PR04MB4445.eurprd04.prod.outlook.com (20.177.55.161) by VI1PR04MB6304.eurprd04.prod.outlook.com (20.179.28.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.18; Thu, 30 May 2019 13:45:47 +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 13:45:47 +0000 From: Iuliana Prodan To: Herbert Xu CC: Ard Biesheuvel , 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 13:45:47 +0000 Message-ID: References: <1559149856-7938-1-git-send-email-iuliana.prodan@nxp.com> <20190529202728.GA35103@gmail.com> <20190530133427.qrwjzctac2x6nsby@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: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fdc518eb-467f-48d6-18bc-08d6e5051ecb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:VI1PR04MB6304; x-ms-traffictypediagnostic: VI1PR04MB6304: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 00531FAC2C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(366004)(136003)(376002)(39860400002)(346002)(189003)(199004)(55016002)(66066001)(5660300002)(6116002)(3846002)(54906003)(256004)(66446008)(8676002)(81166006)(9686003)(86362001)(64756008)(81156014)(68736007)(2906002)(25786009)(74316002)(14454004)(76176011)(52536014)(316002)(8936002)(71190400001)(446003)(99286004)(6436002)(7696005)(478600001)(6506007)(102836004)(53546011)(305945005)(4326008)(186003)(26005)(73956011)(476003)(66946007)(486006)(53936002)(71200400001)(66556008)(66476007)(6916009)(7736002)(6246003)(44832011)(229853002)(4744005)(33656002)(76116006);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB6304;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: aVa2+YfeH68Fjdmp3lt1TeFEjGJH8+w2aYa9VHrnwzb1Ci2xTZKvwxHyp6L8OWPtfWm8xx0EA4w4JU9QOukuPsF3q5BxWwicWkhfopSmObzPUKUDrmg6Rfr/ToL+GCbCjpHVWQu5Qwc5IiApxQ8aTgptR0gFxtOy8tK71IMnS3nmpe0P64QVmlf3OyUEqaHfHn77pYFDwLwfw0k9KUwoHT1AaLNjZzPH1RMtKAwlZAyfzLXgrpjnbdbcXwVcHKm7tV5JNqpXCK+W0LOR6qqkBbWkbXx/caDxm/jH+/81rhnAAFVBpUgBaml3CQA4E3a9N9ZcnE/M/z7D9/JCz7fcxiktOuvJjxplsbYO8qe5cXXWqG/HvMYjMLyDN3gkTyhOjIZorXN/6OEBSR9ekAOcbPoz8DdgnLNYq4lbfIg3CuY= 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: fdc518eb-467f-48d6-18bc-08d6e5051ecb X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2019 13:45:47.2378 (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: VI1PR04MB6304 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/30/2019 4:34 PM, Herbert Xu wrote:=0A= > On Thu, May 30, 2019 at 01:29:41PM +0000, Iuliana Prodan wrote:=0A= >>=0A= >> I've tried coping the IV before the extended descriptor allocation, but= =0A= >> is not working and to make it work will need to make more changes in=0A= >> CAAM. We need the original iv, and if we move it before=0A= >> skcipher_edesc_alloc we lose it.=0A= >> The fix exclusively in CAAM drv, to copy iv before DMA map, is more comp= lex.=0A= > =0A= > Why doesn't it work (apart from the fact that this only makes sense=0A= > for CBC and yet you're doing it for everything including CTR)?=0A= > =0A= > Cheers,=0A= > =0A= =0A= On the current structure of caamalg, to work, iv needs to be copied =0A= before memcpy(iv, req->iv, ivsize), from skcipher_edesc_alloc function. =0A= For this we need edesc, but this cannot be allocated before knowing how =0A= much memory we need. So, to make it work, we'll need to modify more in CAAM= .=0A= =0A= Thanks,=0A= Iulia=0A=