Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7708425ybi; Wed, 5 Jun 2019 23:44:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB5hRj674oDzYepdFQnnEUWlbdZJQv78AC/xsTehomAbz/CmHgmuPAhfyp7WXZMAgUzFJK X-Received: by 2002:a17:902:988a:: with SMTP id s10mr49149294plp.304.1559803441287; Wed, 05 Jun 2019 23:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559803441; cv=none; d=google.com; s=arc-20160816; b=UmAZ4W31L5KvSdx+cAbnRJrrNaoFDHEPDRANfs8ICLRUq6F0mSD52xVKmuCB5Tz9WH fjR7IsXXR+Qvjaltj9ZOilOP84K7URNDHviv5/qqJNHsFSxyoZVD+0IqXHWPn7PgnlEk kx4JeMBDY3Ps90ZjaOa8u3/dzRe+xnTqjXmDiGvoxEX7Y9rhqieHmsZIR5LBnulXTk5l GOIcTBhSUg8b2eZdEU8xXPwRUsVFZtTa0gAezb1repPP5q5yaC9Z46zPqO21dhGZTT1Y z0R9xbTnNKoUpGIFKUCtXBqOBtsC7/Z6Dy9BXh9l5HJkWmxvC01uAbAvtf8rCGS7D6vd NwWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fAmwhrw558wPfYHxjN+8HYUKXtrdMSbO0EAw2Cpf0/Y=; b=dJ99/EcSwTOiRivxzFI07E/Gmj7GS09j2cejjB6I8a15XBKN+xWK7lbI/BB1EtuFfT CzNNfMXFDdHEtTI6/EDeld+Vhec5KIwZd1pgViIDhQXqOFWK9rF8KSuuPastXiqKH0aL oa0UAJaY4OGQC9FPMrROAXIPrh97tqjiHokfsyjDs6m7+SPlvEavohISRsnun7+/ZHJ+ j7u63yqnKiRpcWJdzqeGi83tIG5P+oM2BrDA+IqPAy/a+TzRXLjYp27p4u74c7e2sgg3 swvICiPfaQ2xG2T1qjUX2JMwwXxtoU0zR2oZ/xG9F8HXRi56dTt4AN3nGWsP8YXzwg8Z PABw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y2RWECTN; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33si1011115plc.283.2019.06.05.23.43.47; Wed, 05 Jun 2019 23:44:01 -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=@linaro.org header.s=google header.b=Y2RWECTN; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725769AbfFFGnJ (ORCPT + 99 others); Thu, 6 Jun 2019 02:43:09 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:53550 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFGnB (ORCPT ); Thu, 6 Jun 2019 02:43:01 -0400 Received: by mail-it1-f195.google.com with SMTP id m187so1502115ite.3 for ; Wed, 05 Jun 2019 23:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fAmwhrw558wPfYHxjN+8HYUKXtrdMSbO0EAw2Cpf0/Y=; b=Y2RWECTNdkv+bdqw56t/foazdmSKW9C7UxFQGxElH4MDqQBFAo0IvyTHLt9KdqZg1X Q/QIt1+bxXD+WNT5G3hLKNVmPxusK2ThjQQJ9BxejHuN0tvOTSu3/UHYf/4JfxMpEKME 65oaStHZ6AKM/54UQy6jDVNNsG5GKYIwb6vbkowvq7TtLf6k+ib4vBSoHlXOMC8U7gPR DqAoyLvIebgUjw1Xu5iVpyp7QMPNRJvk2iJID9gxT1F+hKuCZPvz+ncNiAQWwmADxY7Z ACC5BZ9iMQD148kDb59+r9Rc23mHRrpir2NUmfLhL6EY4cD9GExP80lO3aVxaKDjA37A iAgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fAmwhrw558wPfYHxjN+8HYUKXtrdMSbO0EAw2Cpf0/Y=; b=R52iAXWYXfZICCN0TjI3bFzXc+QpJoLxKefuFN95uUwYFDq/nhON1DScxIvB5VDEZD OzecQ4fBa1DmrOsupbtSxWrcBqbSs9dSPHbawUgLJiZmRz2okXPYZSvYrzS0T/O4Nv4i FGCNZvit+rftFslKLUakJELTz7DXhfZGHFBZ6CUJMUOg3ry3HS0JQW5PXtrTgf7S4p+H kWv+2iW3m4pHboiAW9rEiJosa3YstUKaCKei4xoQVDFYGp+0FZVcTVJ17vYOlPFadNGO aFe9t1e+JLxa+BfH9nr+YVdlPdt8kzf8Mf6KqmP9jJRbapz6B+c6G5DXtZRBKZ54C6qb USjQ== X-Gm-Message-State: APjAAAXbOut0yCoQpLtftG7Lq2nzWAjYqWRfhoxcg7ZYxidGTrAiNmXA LZI3FgQ9Pq29r5K+9M7FslM4SUxFLCSs7cbHrGulVg== X-Received: by 2002:a02:ce37:: with SMTP id v23mr29258959jar.2.1559803380499; Wed, 05 Jun 2019 23:43:00 -0700 (PDT) MIME-Version: 1.0 References: <20190529202728.GA35103@gmail.com> <20190530133427.qrwjzctac2x6nsby@gondor.apana.org.au> <20190530142734.qlhgzeal22zxfhk5@gondor.apana.org.au> <20190606063724.n77z7gaf32tmyxng@gondor.apana.org.au> In-Reply-To: <20190606063724.n77z7gaf32tmyxng@gondor.apana.org.au> From: Ard Biesheuvel Date: Thu, 6 Jun 2019 08:42:46 +0200 Message-ID: Subject: Re: [PATCH] crypto: gcm - fix cacheline sharing To: Herbert Xu Cc: Iuliana Prodan , Eric Biggers , "David S. Miller" , Horia Geanta , Sascha Hauer , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Kernel Mailing List , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 6 Jun 2019 at 08:37, Herbert Xu wrote: > > On Thu, May 30, 2019 at 04:31:09PM +0200, Ard Biesheuvel wrote: > > > > This might work: > > > > diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c > > index c0ece44f303b..3d313d2a279a 100644 > > --- a/drivers/crypto/caam/caamalg.c > > +++ b/drivers/crypto/caam/caamalg.c > > @@ -1661,7 +1661,8 @@ static int aead_decrypt(struct aead_request *req) > > * allocate and map the skcipher extended descriptor for skcipher > > */ > > static struct skcipher_edesc *skcipher_edesc_alloc(struct > > skcipher_request *req, > > - int desc_bytes) > > + int desc_bytes, > > + u8 const *input_iv) > > { > > struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); > > struct caam_ctx *ctx = crypto_skcipher_ctx(skcipher); > > @@ -1745,7 +1746,7 @@ static struct skcipher_edesc > > *skcipher_edesc_alloc(struct skcipher_request *req, > > /* Make sure IV is located in a DMAable area */ > > if (ivsize) { > > iv = (u8 *)edesc->hw_desc + desc_bytes + sec4_sg_bytes; > > - memcpy(iv, req->iv, ivsize); > > + memcpy(iv, input_iv, ivsize); > > > > iv_dma = dma_map_single(jrdev, iv, ivsize, DMA_TO_DEVICE); > > if (dma_mapping_error(jrdev, iv_dma)) { > > Hi Ard: > > I presume you will be submitting this patch at some point? When > you do please base it on top of your other one which I'm about to > merge. > I'm not sure I follow. Do you want a better fix for the CBC output IV going forward? Or is this about other modes?