From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26B4A3BFE2D for ; Wed, 18 Mar 2026 16:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773852576; cv=none; b=L/9xD/ZggvgQC5MNwwpfIZWvHuWCdbAY5/AGlC8ERTIbmB79RyLQgnBZE9T2vvJ6juTtKH/2yKwqoDAA4OEfnhmIp8iQsbfai4uDQZ9PQhhB1kgfl56+TONrGJbRNCCfwHJ6M3zuCLEyh3UAcXs/NV/OgUmm5kQZPFWkBAGq5z8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773852576; c=relaxed/simple; bh=sM63BjaUYSTL7oYJd40DzNpNnWKr1OcKeVXJI0grzoU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JP9fMoxUe3aG+DtHRjMcHcqsh0bq1AED2ZCCiH1mA1OE1hw307g8QD19kZwEO59ML5UTnGJq59CQYSdE3T5zsh4IzL1pUsA+ekixURef21bfWAmi2xTj45CTpNKR1MYnOOxFUAABJTQeafR+xVdRX7YAhzetILX0J0LEH7rSOKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=giMijjHO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="giMijjHO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A58AC2BC87; Wed, 18 Mar 2026 16:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773852575; bh=sM63BjaUYSTL7oYJd40DzNpNnWKr1OcKeVXJI0grzoU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=giMijjHOfOioGsEh0VoWUhxtznSFOdznDmd3VSOeYtVcF8nhCkoEbVxAahLEM/QJ/ PTWFWNO2Dup6BSJh853Bm0tGN4WCMNqM6ohFOYl9W7J0LJtF/2OCkbOwKwziAtmZfU kVtHKw+ODJlSpcRmoUpPBljPev/YSDSrF1U2jfUVteZAGri0K+RV700vDjaa77lb39 lafX8o8tmszcXB3oE+CDLnhGc/IFv/LioXRxb4IuTDxpziTdfX7T6PNN6MGao/XR9Q Z9wZr6maz/jSsCu7nVxvIcS1gSJeGWD8DJO8KE10NlBh7q6V0+09td9IQnM407ZnWY Xg35GTLZ2zU7w== Date: Wed, 18 Mar 2026 09:48:34 -0700 From: Eric Biggers To: Arnd Bergmann Cc: Dan Williams , Dionna Amalie Glaze , Cedric Xing , Arnd Bergmann , Andrew Morton , Zi Li , "Masami Hiramatsu (Google)" , Lance Yang , Zhou Yuhang , Colin Ian King , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tsm-mr: fix sample dependencies Message-ID: <20260318164834.GB2255@sol> References: <20260318105200.1985712-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260318105200.1985712-1-arnd@kernel.org> On Wed, Mar 18, 2026 at 11:51:55AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The tsm sample fails to link when crypto support is in a loadable module: > > ld.lld-22: error: undefined symbol: crypto_alloc_shash > ld.lld-22: error: undefined symbol: crypto_shash_tfm_digest > ld.lld-22: error: undefined symbol: crypto_destroy_tfm > ld.lld-22: error: undefined symbol: crypto_shash_init > ld.lld-22: error: undefined symbol: crypto_shash_finup > >>> referenced by tsm_mr_sample.c > >>> samples/tsm-mr/tsm_mr_sample.o:(sample_report_extend_mr) in archive vmlinux.a > > This used to be handled indirectly by CONFIG_TSM_MEASUREMENTS forcing > the crypto code to be built-in, but that was changed because TSM > itself does not require it. > > Move the select into the Kconfig option that controls the sample > instead. > > Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code") > Fixes: 44a3873df811 ("coco/guest: Remove unneeded selection of CRYPTO") > Signed-off-by: Arnd Bergmann > --- > samples/Kconfig | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/samples/Kconfig b/samples/Kconfig > index 5bc7c9e5a59e..730cc9f4197e 100644 > --- a/samples/Kconfig > +++ b/samples/Kconfig > @@ -186,6 +186,8 @@ config SAMPLE_TIMER > > config SAMPLE_TSM_MR > tristate "TSM measurement sample" > + select CRYPTO > + select CRYPTO_HASH > select TSM_MEASUREMENTS > select VIRT_DRIVERS > help Thanks. If we go with this, I can take it through libcrypto-next, given that that's where "coco/guest: Remove unneeded selection of CRYPTO" is. However, note that this fix doesn't select the crypto algorithms the module actually uses. So it doesn't completely fix it either, and we'd at least need an additional fix to actually select the algorithms. I suggest that we instead convert this module to use the SHA-2 library APIs (https://lore.kernel.org/linux-crypto/20260318164233.19800-1-ebiggers@kernel.org/). That patch fixes both problems. - Eric