From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
Jarkko Sakkinen <jarkko@kernel.org>,
Jason Gunthorpe <jgg@ziepe.ca>,
Sudeep Holla <sudeep.holla@kernel.org>,
Yeoreum Yun <yeoreum.yun@arm.com>,
Stuart Yoder <stuart.yoder@arm.com>,
apais@microsoft.com, rachelmenge@linux.microsoft.com,
hargar@linux.microsoft.com, linux-integrity@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] tpm: tpm_crb_ffa: Only probe when ACPI TPM2 uses FF-A
Date: Tue, 17 Nov 2026 20:23:48 +0000 [thread overview]
Message-ID: <avy31EaCx3IQY_Ou@e129823.arm.com> (raw)
In-Reply-To: <20261115013456.212141-3-sidchintamaneni@gmail.com>
LGTM.
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
On Sun, Nov 15, 2026 at 01:34:54AM +0000, Siddharth Chintamaneni wrote:
> Prior to commit 677042afb97a ("tpm: tpm_crb_ffa: revert defered_probed
> when tpm_crb_ffa is built-in"), built-in tpm_crb_ffa only registered
> tpm_crb_ffa_driver from tpm_crb_ffa_init() after crb_acpi_probe()
> confirmed start_method == ACPI_TPM2_CRB_WITH_ARM_FFA. After that
> commit, tpm_crb_ffa unconditionally registers on the FF-A bus at
> device_initcall time (and when loaded as a module) without checking
> the platform's ACPI TPM2 start method.
>
> A platform's firmware may expose a TPM CRB over FF-A Secure Partition
> for UEFI boot services while advertising a non-FF-A start method to
> the OS in the ACPI TPM2 table. When the ACPI TPM2 table designates a
> non-FF-A start method, Linux has no consumer for tpm_crb_ffa and
> should not probe the FF-A TPM service.
>
> On Microsoft Cobalt 200 systems, the ACPI TPM2 table does not use
> ACPI_TPM2_CRB_WITH_ARM_FFA, yet ffa_init() discovers the FF-A TPM
> partition and tpm_crb_ffa_probe() unconditionally sends
> CRB_FFA_GET_INTERFACE_VERSION via FFA_MSG_SEND_DIRECT_REQ2/REQ SMC.
> That request wedges the calling CPU in Secure World (with Non-Secure
> interrupts and GICv3 pseudo-NMIs masked), hanging boot with an RCU CPU
> stall:
>
> [ 5.507519] ARM FF-A: Driver version 1.2
> [ 5.507519] ARM FF-A: Firmware version 1.2 found
> [ 5.507551] ARM FF-A: Notification setup failed -61, not enabled
> [ 7.150580] Freeing initrd memory: 293640K
> [ 65.515248] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> [ 65.521346] rcu: 10-...0: (3 GPs behind) idle=dd9c/1/0x4000000000000000 softirq=37/37 fqs=5262
> [ 65.530031] rcu: hardirqs softirqs csw/system
> [ 65.535589] rcu: number: 0 0 0
> [ 65.541146] rcu: cputime: 0 0 0 ==> 30028(ms)
> [ 65.548102] rcu: (detected by 66, t=15010 jiffies, g=-951, q=1384 ncpus=132)
> [ 65.555228] Sending NMI from CPU 66 to CPUs 10:
> [ 75.560686] After 10 seconds, these CPUS still haven't responded to the NMI: 10
>
> Check tpm2_acpi_start_method in tpm_crb_ffa_probe() and return -ENODEV
> unless it equals ACPI_TPM2_CRB_WITH_ARM_FFA. Checking in probe() rather
> than module_init allows tpm_crb_ffa.ko to load as a symbol dependency
> of tpm_crb.ko on non-FF-A platforms when built as modules, while
> skipping FF-A TPM requests unless ACPI advertises the FF-A start
> method.
>
> Fixes: eb93f0734ef1 ("tpm_crb: ffa_tpm: Implement driver compliant to CRB over FF-A")
> Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
> ---
> drivers/char/tpm/tpm_crb_ffa.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c
> index 025c4d4b17ca..da676da6f3f0 100644
> --- a/drivers/char/tpm/tpm_crb_ffa.c
> +++ b/drivers/char/tpm/tpm_crb_ffa.c
> @@ -9,9 +9,11 @@
>
> #define pr_fmt(fmt) "CRB_FFA: " fmt
>
> +#include <linux/acpi.h>
> #include <linux/arm_ffa.h>
> #include <linux/delay.h>
> #include <linux/moduleparam.h>
> +#include "tpm.h"
> #include "tpm_crb_ffa.h"
>
> static unsigned int busy_timeout_ms = 2000;
> @@ -324,6 +326,9 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
> struct tpm_crb_ffa *p;
> int rc;
>
> + if (tpm2_acpi_start_method != ACPI_TPM2_CRB_WITH_ARM_FFA)
> + return -ENODEV;
> +
> /* only one instance of a TPM partition is supported */
> if (tpm_crb_ffa && !IS_ERR_VALUE(tpm_crb_ffa))
> return -EEXIST;
> --
> 2.45.4
>
--
Sincerely,
Yeoreum Yun
next prev parent reply other threads:[~2026-11-17 20:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 1:34 [PATCH v3 0/4] tpm: Cache ACPI TPM2 start method and gate tpm_crb_ffa probe Siddharth Chintamaneni
2026-11-15 1:34 ` [PATCH v3 1/4] tpm: Cache TPM2 start method Siddharth Chintamaneni
2026-11-17 20:23 ` Yeoreum Yun
2026-11-17 20:54 ` Jarkko Sakkinen
2026-11-15 1:34 ` [PATCH v3 2/4] tpm: tpm_crb_ffa: Only probe when ACPI TPM2 uses FF-A Siddharth Chintamaneni
2026-11-17 20:23 ` Yeoreum Yun [this message]
2026-11-15 1:34 ` [PATCH v3 3/4] tpm: tpm_tis: Use cached tpm2_acpi_start_method Siddharth Chintamaneni
2026-11-15 13:32 ` Jarkko Sakkinen
2026-11-15 1:34 ` [PATCH v3 4/4] tpm: tpm_crb: " Siddharth Chintamaneni
2026-11-17 20:24 ` Yeoreum Yun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avy31EaCx3IQY_Ou@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=apais@microsoft.com \
--cc=hargar@linux.microsoft.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=rachelmenge@linux.microsoft.com \
--cc=sidchintamaneni@gmail.com \
--cc=stuart.yoder@arm.com \
--cc=sudeep.holla@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.