Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp332843pxb; Fri, 14 Jan 2022 06:42:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0sL/6Nzt1T4G/7ex5vpHMejBMheJVXQ6MsMzluuSBjL8G0NaFlga6EkhqY/FTqYNpZC/D X-Received: by 2002:a17:906:c152:: with SMTP id dp18mr1145436ejc.274.1642171328799; Fri, 14 Jan 2022 06:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642171328; cv=none; d=google.com; s=arc-20160816; b=LfaHEmfc09we40BpkZy9k9oshpnuZayHlm1zK83vAlv6AjAj0yRxzoqpJM7ot6HdOt hkOcSQnv51vBUXqFERJTmYT8ZiWDQ6ZYHvGorG8QrVaEdqUBjJoc6czbcjK2qFS7mhBH pLFbS1S3aXFs4C88ItmwD1wLIvllOM3nb2xktelXcZjl/GDwo4GJ+dr/UJtK8VWkMyo/ pxFuee7sYXu7FPSsg4Z21V7onmbUliLm5ou+oSw6OLuPKEy+0AfDPnFfqypC0uB/ACgo XmdAOfOhe5aQG7FWnVxdLQkaOzqJ+21R3eID3O9CDRlCclTmuXuxC/diXKAKX6k2oK9p pbcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gXUW50R+8QigmO6RqPcy28NUiCobfYyCvi9HleKykno=; b=lLpAMEPkhtE66ORWx6W0dXQoxeBOt9E7WBkgeVThvalxVA3ze2cl/tTVriNHwlLq+P 7o/qtN+iP6f5h9AvFtaymGSDHe/9KBKFNhF3HlKk6Np8LfAnWiPR1rC4AxiC2Cbevt5L Q2muXPTVbmrOb3egYkQwoaWMsULuC+1g1R5aGcMJhyfbh7vBhhh2DRleNpsdQ6FQU3B7 p73qaHT8kH8VZMt7Z44UnC4CrpCiU5oGn0N5DahPqGOnwunTM7WMWjQDbprYcLSyS4u7 PXXx+m/IUTAfQf5NBozKQyyQfdS6HvoVyi5muwd7j+Akty/CfomNWt1h6vZ3vwftKTjc I+dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr5si2681718ejc.782.2022.01.14.06.41.43; Fri, 14 Jan 2022 06:42:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234063AbiANGkd (ORCPT + 99 others); Fri, 14 Jan 2022 01:40:33 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:59498 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbiANGkd (ORCPT ); Fri, 14 Jan 2022 01:40:33 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1n8GGE-0006T6-M5; Fri, 14 Jan 2022 17:40:31 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 14 Jan 2022 17:40:30 +1100 Date: Fri, 14 Jan 2022 17:40:30 +1100 From: Herbert Xu To: Eric Biggers Cc: Linux Crypto Mailing List Subject: [v2 PATCH] crypto: testmgr - Move crypto_simd_disabled_for_test out Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jan 12, 2022 at 11:58:00AM +1100, Herbert Xu wrote: > On Tue, Jan 11, 2022 at 01:43:58PM -0800, Eric Biggers wrote: > > > > Maybe CRYPTO_MANAGER_EXTRA_TESTS should select CRYPTO_SIMD? > > You're right. I was focusing only on the module dependencies > but neglected to change the Kconfig dependencies. > > I'll fix this in the next version. ---8<--- As testmgr is part of cryptomgr which was designed to be unloadable as a module, it shouldn't export any symbols for other crypto modules to use as that would prevent it from being unloaded. All its functionality is meant to be accessed through notifiers. The symbol crypto_simd_disabled_for_test was added to testmgr which caused it to be pinned as a module if its users were also loaded. This patch moves it out of testmgr and into crypto/algapi.c so cryptomgr can again be unloaded and replaced on demand. Signed-off-by: Herbert Xu diff --git a/crypto/algapi.c b/crypto/algapi.c index a366cb3e8aa1..9f15e11f5d73 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -21,6 +22,11 @@ static LIST_HEAD(crypto_template_list); +#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS +DEFINE_PER_CPU(bool, crypto_simd_disabled_for_test); +EXPORT_PER_CPU_SYMBOL_GPL(crypto_simd_disabled_for_test); +#endif + static inline void crypto_check_module_sig(struct module *mod) { if (fips_enabled && mod && !module_sig_ok(mod)) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 5831d4bbc64f..3a5a3e5cb77b 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -55,9 +55,6 @@ MODULE_PARM_DESC(noextratests, "disable expensive crypto self-tests"); static unsigned int fuzz_iterations = 100; module_param(fuzz_iterations, uint, 0644); MODULE_PARM_DESC(fuzz_iterations, "number of fuzz test iterations"); - -DEFINE_PER_CPU(bool, crypto_simd_disabled_for_test); -EXPORT_PER_CPU_SYMBOL_GPL(crypto_simd_disabled_for_test); #endif #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt