Skip to content

Commit 9d825f6

Browse files
committed
Merge: Update support for Arm FF-A firmware interface.
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7123 JIRA: https://issues.redhat.com/browse/RHEL-102691 ## Summary of Changes The following series updates support for Arm FF-A firmware interface. Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> Approved-by: Lucas Zampieri <lzampier@redhat.com> Approved-by: Mark Salter <msalter@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Patrick Talbert <ptalbert@redhat.com>
2 parents f537aee + d6abd73 commit 9d825f6

File tree

14 files changed

+2210
-187
lines changed

14 files changed

+2210
-187
lines changed

Documentation/security/tpm/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Trusted Platform Module documentation
88
tpm_vtpm_proxy
99
xen-tpmfront
1010
tpm_ftpm_tee
11+
tpm_ffa_crb
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
========================
4+
TPM CRB over FF-A Driver
5+
========================
6+
7+
The TPM Command Response Buffer (CRB) interface is a standard TPM interface
8+
defined in the TCG PC Client Platform TPM Profile (PTP) Specification [1]_.
9+
The CRB provides a structured set of control registers a client uses when
10+
interacting with a TPM as well as a data buffer for storing TPM commands and
11+
responses. A CRB interface can be implemented in:
12+
13+
- hardware registers in a discrete TPM chip
14+
15+
- in memory for a TPM running in isolated environment where shared memory
16+
allows a client to interact with the TPM
17+
18+
The Firmware Framework for Arm A-profile (FF-A) [2]_ is a specification
19+
that defines interfaces and protocols for the following purposes:
20+
21+
- Compartmentalize firmware into software partitions that run in the Arm
22+
Secure world environment (also know as TrustZone)
23+
24+
- Provide a standard interface for software components in the Non-secure
25+
state, for example OS and Hypervisors, to communicate with this firmware.
26+
27+
A TPM can be implemented as an FF-A secure service. This could be a firmware
28+
TPM or could potentially be a TPM service that acts as a proxy to a discrete
29+
TPM chip. An FF-A based TPM abstracts hardware details (e.g. bus controller
30+
and chip selects) away from the OS and can protect locality 4 from access
31+
by an OS. The TCG-defined CRB interface is used by clients to interact
32+
with the TPM service.
33+
34+
The Arm TPM Service Command Response Buffer Interface Over FF-A [3]_
35+
specification defines FF-A messages that can be used by a client to signal
36+
when updates have been made to the CRB.
37+
38+
How the Linux CRB driver interacts with FF-A is summarized below:
39+
40+
- The tpm_crb_ffa driver registers with the FF-A subsystem in the kernel
41+
with an architected TPM service UUID defined in the CRB over FF-A spec.
42+
43+
- If a TPM service is discovered by FF-A, the probe() function in the
44+
tpm_crb_ffa driver runs, and the driver initializes.
45+
46+
- The probing and initialization of the Linux CRB driver is triggered
47+
by the discovery of a TPM advertised via ACPI. The CRB driver can
48+
detect the type of TPM through the ACPI 'start' method. The start
49+
method for Arm FF-A was defined in TCG ACPI v1.4 [4]_.
50+
51+
- When the CRB driver performs its normal functions such as signaling 'start'
52+
and locality request/relinquish it invokes the tpm_crb_ffa_start() funnction
53+
in the tpm_crb_ffa driver which handles the FF-A messaging to the TPM.
54+
55+
References
56+
==========
57+
58+
.. [1] **TCG PC Client Platform TPM Profile (PTP) Specification**
59+
https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
60+
.. [2] **Arm Firmware Framework for Arm A-profile (FF-A)**
61+
https://developer.arm.com/documentation/den0077/latest/
62+
.. [3] **Arm TPM Service Command Response Buffer Interface Over FF-A**
63+
https://developer.arm.com/documentation/den0138/latest/
64+
.. [4] **TCG ACPI Specification**
65+
https://trustedcomputinggroup.org/resource/tcg-acpi-specification/

drivers/char/tpm/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ config TCG_CRB
183183
from within Linux. To compile this driver as a module, choose
184184
M here; the module will be called tpm_crb.
185185

186+
config TCG_ARM_CRB_FFA
187+
tristate "TPM CRB over Arm FF-A Transport"
188+
depends on ARM_FFA_TRANSPORT && TCG_CRB
189+
default TCG_CRB
190+
help
191+
If the Arm FF-A transport is used to access the TPM say Yes.
192+
To compile this driver as a module, choose M here; the module
193+
will be called tpm_crb_ffa.
194+
186195
config TCG_VTPM_PROXY
187196
tristate "VTPM Proxy Interface"
188197
depends on TCG_TPM

drivers/char/tpm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ obj-$(CONFIG_TCG_IBMVTPM) += tpm_ibmvtpm.o
4040
obj-$(CONFIG_TCG_TIS_ST33ZP24) += st33zp24/
4141
obj-$(CONFIG_TCG_XEN) += xen-tpmfront.o
4242
obj-$(CONFIG_TCG_CRB) += tpm_crb.o
43+
obj-$(CONFIG_TCG_ARM_CRB_FFA) += tpm_crb_ffa.o
4344
obj-$(CONFIG_TCG_VTPM_PROXY) += tpm_vtpm_proxy.o
4445
obj-$(CONFIG_TCG_FTPM_TEE) += tpm_ftpm_tee.o
4546
obj-$(CONFIG_TCG_SVSM) += tpm_svsm.o

0 commit comments

Comments
 (0)