From patchwork Fri Mar 31 05:18:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9655769 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 40DA5601D2 for ; Fri, 31 Mar 2017 09:14:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2864728615 for ; Fri, 31 Mar 2017 09:14:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C70D28646; Fri, 31 Mar 2017 09:14:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDE6D28615 for ; Fri, 31 Mar 2017 09:14:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F278DC20809F; Fri, 31 Mar 2017 09:14:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F278DC20809F Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F278DC20809F Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kiSsFTsg" Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 610905DD66; Fri, 31 Mar 2017 09:14:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 19C1018523CA; Fri, 31 Mar 2017 09:14:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2V5JAkv003625 for ; Fri, 31 Mar 2017 01:19:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id C90AF827A8; Fri, 31 Mar 2017 05:19:10 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BDF884941; Fri, 31 Mar 2017 05:19:04 +0000 (UTC) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 886022B9DC3; Fri, 31 Mar 2017 05:19:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 886022B9DC3 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ebiggers3@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 886022B9DC3 Received: by mail-pg0-f66.google.com with SMTP id 81so14653116pgh.3; Thu, 30 Mar 2017 22:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DgosprDvPR5iRT5sjWnH4roH5k26OaSy8HK2QZ5yqWA=; b=kiSsFTsgfvOoY0IZ2je8G9wBDNDCmy+gS0pZbbXAdmuFoEAVkWpsEOuCPAut/LrIyY mjc+yG2juifCjypFhwwCm8bMGUxdy3wXKqbyB1OnKOPTfI7NtyXzAYXzJ0TYejMXSxrU MVWpbjsNxTxfWb0qsz3adxQwq/gkFdTYYcwbyrp5OMYHrQoFFUzjP1KB3Ez81OopFifZ 0oMP1KmIBzrtLJ0B2I6z7LNifI7SuaAJLwX2xVNpf9Joa1XwYaoLOmddAzRH5IREzVLk Sy5FFjagHb4rELJPc6zuVfNjG+98tlAoj9I70NYYda/xXGZy8yYRiSBthCgamqtZeYZ8 W36w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DgosprDvPR5iRT5sjWnH4roH5k26OaSy8HK2QZ5yqWA=; b=qqwEmH47n3f7uI8AQNRAMKJysDDqxCmbCUNU/ObZ2Gp3E43Dgia3bc8jCOkKXzRDrg LZ/XVzjyD0kV2R+IJombdldRCOm84XYSOz216mwNTVM6k0JsoeNVho8+o2tEN6dFbYfa zYZMXL1GYcYzql+txu8ynrLOPgSRk3pjIvwQ5+D28JYYZwwct0G0vHYsNsrptLKUom4Q PxJh7H9ah13n/UgFW4IWcDhlguXHBxpniA+XaFYQ1ChuDd+19rE9sSyPn73L9tjUeVk2 t7FIQArRlOK7NLlR1YfS5UO/uUU7zwH5sC1EgW1mxS4TZA46MSHcbzgim7Um7sRZOz+u 4I8w== X-Gm-Message-State: AFeK/H16WI9u9LDNTKWh015VPtFKxqoKCZMhsEiYJwn/2pAmfdkDktP82sFqbUmThdWy4Q== X-Received: by 10.84.174.131 with SMTP id r3mr1323779plb.136.1490937543036; Thu, 30 Mar 2017 22:19:03 -0700 (PDT) Received: from zzz.hsd1.wa.comcast.net (c-73-239-167-150.hsd1.wa.comcast.net. [73.239.167.150]) by smtp.gmail.com with ESMTPSA id z185sm7478004pfb.6.2017.03.30.22.19.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 22:19:02 -0700 (PDT) From: Eric Biggers To: dm-devel@redhat.com Date: Thu, 30 Mar 2017 22:18:48 -0700 Message-Id: <20170331051848.7845-1-ebiggers3@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 31 Mar 2017 05:19:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 31 Mar 2017 05:19:03 +0000 (UTC) for IP:'74.125.83.66' DOMAIN:'mail-pg0-f66.google.com' HELO:'mail-pg0-f66.google.com' FROM:'ebiggers3@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.42 * (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 74.125.83.66 mail-pg0-f66.google.com 74.125.83.66 mail-pg0-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 31 Mar 2017 05:10:35 -0400 Cc: Alasdair Kergon , Mike Snitzer , Eric Biggers Subject: [dm-devel] [PATCH] dm crypt: remove obsolete references to per-CPU state X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 31 Mar 2017 09:14:13 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers dm-crypt used to use separate crypto transforms for each CPU, but this is no longer the case. To avoid confusion, fix up obsolete comments and rename setup_essiv_cpu(). Signed-off-by: Eric Biggers --- drivers/md/dm-crypt.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 389a3637ffcc..a57cb41f000e 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -191,7 +191,7 @@ static void kcryptd_queue_crypt(struct dm_crypt_io *io); static u8 *iv_of_dmreq(struct crypt_config *cc, struct dm_crypt_request *dmreq); /* - * Use this to access cipher attributes that are the same for each CPU. + * Use this to access cipher attributes that are independent of the key. */ static struct crypto_skcipher *any_tfm(struct crypt_config *cc) { @@ -310,10 +310,11 @@ static int crypt_iv_essiv_wipe(struct crypt_config *cc) return err; } -/* Set up per cpu cipher state */ -static struct crypto_cipher *setup_essiv_cpu(struct crypt_config *cc, - struct dm_target *ti, - u8 *salt, unsigned saltsize) +/* Allocate the cipher for ESSIV */ +static struct crypto_cipher *alloc_essiv_cipher(struct crypt_config *cc, + struct dm_target *ti, + const u8 *salt, + unsigned int saltsize) { struct crypto_cipher *essiv_tfm; int err; @@ -393,8 +394,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, cc->iv_gen_private.essiv.salt = salt; cc->iv_gen_private.essiv.hash_tfm = hash_tfm; - essiv_tfm = setup_essiv_cpu(cc, ti, salt, - crypto_ahash_digestsize(hash_tfm)); + essiv_tfm = alloc_essiv_cipher(cc, ti, salt, + crypto_ahash_digestsize(hash_tfm)); if (IS_ERR(essiv_tfm)) { crypt_iv_essiv_dtr(cc); return PTR_ERR(essiv_tfm);