Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4305133ybc; Fri, 22 Nov 2019 00:16:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwKhJWXDgOb39RNkojkHRLiGhtrsPZ3k4f+BzFtu6Gse4m4Q80AVcKVNdATFIh+FncYp7/z X-Received: by 2002:a17:907:11cc:: with SMTP id va12mr747764ejb.164.1574410578218; Fri, 22 Nov 2019 00:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574410578; cv=none; d=google.com; s=arc-20160816; b=knIixA+pMu4F5kyqooBVQQ8LCpHZSzxuF7bTWgAmcq7j1YrjbPNDsLsjNOwntGDFnR K8FwAIdBF++mRLv7K28Cq30RQND7Dk4Vaux7x/LUxqimQJtu28HnyElyBJVgXfukZNn7 I6UIFPzhgPQO1Qlntj1RJv2g0VdfCgq3B9YeQGDD3gKCAC3A/kywppLhxAU+HfjRtBGt Eti2L9tLYlwzNDwLRxGL+oYj+9DpyRtQ7uYEiFmizbPmw1PBPFm7GKJeTlzouyyeKLbM k469Y1qin17UxlUzZ1/dKXEjDOAZKd90VM4jNGK9PM4EgFR8d24sSnja5nuR57IUjLdN pL6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=szYH21HIGCAVkKB4JS4eQDFtuknB2tHqFdiNMfYN9cs=; b=CM4+oH7dYWUXg59zLhNqgbe/iL9buhyIQaT9HTEn5PSG1hCAwSrRn9Z2kvzZf1/FvC NCuLgi2E+MwVNYr7NBAaQK3Js7OKQEwUmK8aZFAo9GoRI8E7myCwQelSJijcbtI51bzF 7srwbg0gBp1IptZhD3lZVS82V6kYn476vDLEhQiUuRFpCC2Co+Vluka19TOAinYViwRf 5WGai4gDHDHm+lojPNKfkmAUd5Cme7a+tXy7KsbQ7my7DnKpekSmmOgl8a1aXozXLi2D cHen123wYfBGiTe8e8KlzGfAFdGeaqrzvnugeYTkLe/E0/wfuBM3KEu7LOPUiD8rP3hU 4vPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si3724656eju.242.2019.11.22.00.15.43; Fri, 22 Nov 2019 00:16:18 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbfKVINm (ORCPT + 99 others); Fri, 22 Nov 2019 03:13:42 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:43464 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbfKVINl (ORCPT ); Fri, 22 Nov 2019 03:13:41 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1iY44S-0007hc-MT; Fri, 22 Nov 2019 16:13:40 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1iY44Q-0004u8-Ip; Fri, 22 Nov 2019 16:13:38 +0800 Date: Fri, 22 Nov 2019 16:13:38 +0800 From: Herbert Xu To: Harald Freudenberger Cc: linux-crypto@vger.kernel.org, ebiggers@kernel.org, heiko.carstens@de.ibm.com, gor@linux.ibm.com Subject: Re: [PATCH 2/3] s390/crypto: Rework on paes implementation Message-ID: <20191122081338.6bdjevtyttpdzzwl@gondor.apana.org.au> References: <20191113105523.8007-1-freude@linux.ibm.com> <20191113105523.8007-3-freude@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113105523.8007-3-freude@linux.ibm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Nov 13, 2019 at 11:55:22AM +0100, Harald Freudenberger wrote: > > @@ -129,6 +128,7 @@ static int ecb_paes_init(struct crypto_skcipher *tfm) > struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm); > > ctx->kb.key = NULL; > + spin_lock_init(&ctx->pk_lock); This makes no sense. The context is per-tfm, and each tfm should have a single key at any time. The synchronisation of setkey vs. crypto operations is left to the user of the tfm, not the implementor. So why do you need this spin lock at all? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt