Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22056781rwd; Fri, 30 Jun 2023 03:21:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHuzKmDag7/YcMrDi9tVw+vDhcZ4Y9LLKmUDbXNMBItKW/jSmVhn19d9MpnALJrcN73TdhQ X-Received: by 2002:a92:d386:0:b0:345:e5ab:e177 with SMTP id o6-20020a92d386000000b00345e5abe177mr1826297ilo.9.1688120463193; Fri, 30 Jun 2023 03:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688120463; cv=none; d=google.com; s=arc-20160816; b=gjxsbDHCyT36Jh7FdyK04PSCYF677K9sTYBnbBWTGH09Cj5rka3RKzXuP8X2o5tx7z Ph1WeNp9Y0V3PeL1A0dC4qfRum1lw92ik6gzCRkEhGAtTH2NDNx8jKVD28B3oBItDE5T AeDDt4lLUZYiG+4K825lfYF3amyZfKcfnC/8xz/QsuB/a5nOD8/jO0zYB48NSaZ4r0Kn GrfZ60gC4t3VJp5g/0MftUvnFeRR1sDYNLnbqchtX95nVJ27OuvrpN5IUXICvDj6WJLY ZjBmfy0DP9vvUFoJpBo7+eQ+05Izpku3w22HdMUY8quYah5kljXcqbix0/Snd4j2SWQu fj9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=BEE9aj41WqXUxt0CnjVc1kMAs7fFCAkgQesc50pxlWQ=; fh=5FDFRQocbTpD/Trgq4Mdi58dj4tCzhEODe09MtiTExA=; b=Be/09FgRkfdArPDjxGiRkXj4P4lVClMEzvLMc7xKhibr36guSNUFqcZQ6ma5LqsSbw y1iserzdycwQRmQJl2dLjGADXKqXqKDWRx/KKLtSA6wEdCLBeMVXf/3+gnPZsTLDgM+T AC3pXJF4elzDjjopgaEYJ/sMn4baJvOv5KVcTWUIfN8UjDP+m0EzxIJF8W4FB9tQwv2G 8ehuJv+irkNPCqXYTzysGNByNaonL9mTlUJQXIyCtu1nPhLJ/dYeAPS7WG1VKcwrqunq chfxU2/8jeZfEs11AUdGAP14EkjZdFKjvL3Wg/83/TGjMSNgtLc/8NCAxxgLEnBaIVLG dNJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fOtZKOvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a63cf18000000b0055ab9bb07fbsi9781304pgg.395.2023.06.30.03.20.51; Fri, 30 Jun 2023 03:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fOtZKOvD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232783AbjF3KHf (ORCPT + 99 others); Fri, 30 Jun 2023 06:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233053AbjF3KHa (ORCPT ); Fri, 30 Jun 2023 06:07:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B9384204; Fri, 30 Jun 2023 03:07:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9CCFB6170B; Fri, 30 Jun 2023 10:07:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90BE5C433C0; Fri, 30 Jun 2023 10:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688119625; bh=dRTq5GwVmzPLKyaKbw23kgA98h3wm06ktUQGye1ZKaY=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=fOtZKOvDVMoHj53Mx+Gy2LoFyyPmdIwT32O71yXb2Ehtqebk+gPyiRV5jGGGYA1fM vQBd/9NbGQVNmfCHFMxjVqzdd4+YKiLVOe2YDTuVToChdJa4HXCu2m9DsqTDouCRVy KwwiPbZYx/iOnVzdS0R8CNDFA+x1AbUpElvJhZBOYQzF3UKU7vpZIiZrBz11yx2ulK e9AA85m24IfeJO3WDJ1DXlEFCTOvZ2ZrUqRd8GxdH8DmYcedTRr1+Nuo+hyYRM06Ma JsCJxVVICp+CZDck9Xgcy+EQeeW0kz1eHEJoElv9WJQdqklenA15EtRRxV8T4HMPmb CW7GkzK+xY3sg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 30 Jun 2023 13:07:00 +0300 Message-Id: Cc: "Jason A. Donenfeld" , "Jason Gunthorpe" , "Peter Huewe" , , "Linux regressions mailing list" , "Mario Limonciello" , "Aneesh Kumar K . V" , "Sachin Sant" Subject: Re: [PATCH] tpm: return false from tpm_amd_is_rng_defective on non-x86 platforms From: "Jarkko Sakkinen" To: "Jerry Snitselaar" , , X-Mailer: aerc 0.14.0 References: <20230629204147.1852823-1-jsnitsel@redhat.com> In-Reply-To: <20230629204147.1852823-1-jsnitsel@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu Jun 29, 2023 at 11:41 PM EEST, Jerry Snitselaar wrote: > tpm_amd_is_rng_defective is for dealing with an issue related to the > AMD firmware TPM, so on non-x86 architectures just have it inline and > return false. > > Cc: Jarkko Sakkinen > Cc: "Jason A. Donenfeld" > Cc: Jason Gunthorpe > Cc: Peter Huewe > Cc: stable@vger.kernel.org > Cc: Linux regressions mailing list > Cc: Mario Limonciello > Reported-by: Aneesh Kumar K. V > Reported-by: Sachin Sant > Closes: https://lore.kernel.org/lkml/99B81401-DB46-49B9-B321-CF832B50CAC3= @linux.ibm.com/ > Fixes: f1324bbc4011 ("tpm: disable hwrng for fTPM on some AMD designs") > Signed-off-by: Jerry Snitselaar > --- > drivers/char/tpm/tpm-chip.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c > index cd48033b804a..cf5499e51999 100644 > --- a/drivers/char/tpm/tpm-chip.c > +++ b/drivers/char/tpm/tpm-chip.c > @@ -518,6 +518,7 @@ static int tpm_add_legacy_sysfs(struct tpm_chip *chip= ) > * 6.x.y.z series: 6.0.18.6 + > * 3.x.y.z series: 3.57.y.5 + > */ > +#ifdef CONFIG_X86 > static bool tpm_amd_is_rng_defective(struct tpm_chip *chip) > { > u32 val1, val2; > @@ -566,6 +567,12 @@ static bool tpm_amd_is_rng_defective(struct tpm_chip= *chip) > =20 > return true; > } > +#else > +static inline bool tpm_amd_is_rng_defective(struct tpm_chip *chip) > +{ > + return false; > +} > +#endif /* CONFIG_X86 */ > =20 > static int tpm_hwrng_read(struct hwrng *rng, void *data, size_t max, boo= l wait) > { > --=20 > 2.38.1 Sanity check, this was the right patch, right? I'll apply it. BR, Jarkko