* [PATCH tsm 0/4] Start building drivers/attestation
@ 2026-12-01 0:52 Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 1/4] attestation: Start the new subsystem using tsm_report and mr Jason Gunthorpe
` (4 more replies)
0 siblings, 5 replies; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 0:52 UTC (permalink / raw)
To: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
Move tsm_report and tsm_mr, along with all their drivers, into
drivers/attestation. There are no functional changes, but some modules
are renamed to consistent attestation_* names.
This largely just moves drivers/virt/coco/* stuff to drivers/attestation
and makes some adjustments to have per-arch subdirectories to hold all the
stuff. virt/coco was OK when this was only going to be used inside
confidential VMs, but with the new coming needs for bare metal and host
support under the same umbrella it isn't a good place to build an entire
subsystem.
The attestation subsystem is intended to support drivers for all Roots of
Trust (ROTs), both local to the CPU and on-device ROTs accessed through
SPDM. A well-known example of a ROT is a Trusted Platform Module, though
many different specifications for much simpler ROTs now exist.
The existing drivers are all for the ROTs integrated into confidential
VMs. AMD, Intel and ARM each have an attestation ROT linked to their
respective implementations.
A following set of drivers, like ARM FIRME, will start to bring in non-TPM
ROTs on bare metal systems. The kernel SPDM implementation will also live
here and use the upcoming enhanced uAPI.
Eventually we hope to provide a kernel multiplexer so that in-kernel
users, like IMA, can access any attestation measurement register instead
of being hardwired to use only the TPM.
Several reorganization and cleanup passes will be needed after this to
turn it into a well-formed subsystem.
Jason Gunthorpe (4):
attestation: Start the new subsystem using tsm_report and mr
attestation: Move the ARM Realm Token tsm_report driver
attestation: Move Intel TDX Guest tsm_report and mr driver
attestation: Move AMD SEV Guest tsm_report driver
.../sysfs-devices-virtual-misc-tdx_guest | 2 +-
Documentation/driver-api/attestation.rst | 36 +++++++++++++++++++
Documentation/driver-api/coco/index.rst | 10 ------
.../driver-api/coco/measurement-registers.rst | 12 -------
Documentation/driver-api/index.rst | 2 +-
MAINTAINERS | 5 ++-
arch/x86/coco/tdx/tdx.c | 8 ++---
drivers/Kconfig | 2 ++
drivers/Makefile | 2 ++
drivers/attestation/Kconfig | 23 ++++++++++++
drivers/attestation/Makefile | 9 +++++
drivers/attestation/amd/Kconfig | 15 ++++++++
drivers/attestation/amd/Makefile | 4 +++
.../sev-guest => attestation/amd}/sev-guest.c | 2 +-
drivers/attestation/arm/Kconfig | 12 +++++++
drivers/attestation/arm/Makefile | 4 +++
.../main.c => attestation/arm/cca-guest.c} | 2 +-
drivers/attestation/intel/Kconfig | 13 +++++++
drivers/attestation/intel/Makefile | 4 +++
.../intel}/tdx-guest.c | 4 +--
.../{virt/coco/guest => attestation}/tsm-mr.c | 0
.../report.c => attestation/tsm-report.c} | 0
drivers/virt/coco/Kconfig | 8 -----
drivers/virt/coco/Makefile | 4 ---
drivers/virt/coco/arm-cca-guest/Kconfig | 11 ------
drivers/virt/coco/arm-cca-guest/Makefile | 4 ---
drivers/virt/coco/guest/Kconfig | 16 ---------
drivers/virt/coco/guest/Makefile | 4 ---
drivers/virt/coco/sev-guest/Kconfig | 13 -------
drivers/virt/coco/sev-guest/Makefile | 2 --
drivers/virt/coco/tdx-guest/Kconfig | 12 -------
drivers/virt/coco/tdx-guest/Makefile | 2 --
samples/Kconfig | 3 +-
tools/testing/selftests/tdx/config | 2 +-
34 files changed, 138 insertions(+), 114 deletions(-)
create mode 100644 Documentation/driver-api/attestation.rst
delete mode 100644 Documentation/driver-api/coco/index.rst
delete mode 100644 Documentation/driver-api/coco/measurement-registers.rst
create mode 100644 drivers/attestation/Kconfig
create mode 100644 drivers/attestation/Makefile
create mode 100644 drivers/attestation/amd/Kconfig
create mode 100644 drivers/attestation/amd/Makefile
rename drivers/{virt/coco/sev-guest => attestation/amd}/sev-guest.c (99%)
create mode 100644 drivers/attestation/arm/Kconfig
create mode 100644 drivers/attestation/arm/Makefile
rename drivers/{virt/coco/arm-cca-guest/main.c => attestation/arm/cca-guest.c} (99%)
create mode 100644 drivers/attestation/intel/Kconfig
create mode 100644 drivers/attestation/intel/Makefile
rename drivers/{virt/coco/tdx-guest => attestation/intel}/tdx-guest.c (99%)
rename drivers/{virt/coco/guest => attestation}/tsm-mr.c (100%)
rename drivers/{virt/coco/guest/report.c => attestation/tsm-report.c} (100%)
delete mode 100644 drivers/virt/coco/arm-cca-guest/Kconfig
delete mode 100644 drivers/virt/coco/arm-cca-guest/Makefile
delete mode 100644 drivers/virt/coco/guest/Kconfig
delete mode 100644 drivers/virt/coco/guest/Makefile
delete mode 100644 drivers/virt/coco/sev-guest/Kconfig
delete mode 100644 drivers/virt/coco/sev-guest/Makefile
delete mode 100644 drivers/virt/coco/tdx-guest/Kconfig
delete mode 100644 drivers/virt/coco/tdx-guest/Makefile
base-commit: 08b2d931027c237d749c934bcad406a79818123b
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH tsm 1/4] attestation: Start the new subsystem using tsm_report and mr
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
@ 2026-12-01 0:52 ` Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver Jason Gunthorpe
` (3 subsequent siblings)
4 siblings, 0 replies; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 0:52 UTC (permalink / raw)
To: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
Create a basic starting point for drivers/attestation by moving the
tsm_report and tsm_mr core code into drivers/attestation and revising the
Documentation.
The attestation subsystem is intended to support drivers for all Roots of
Trust (ROTs), both local to the CPU and on-device ROTs accessed through
SPDM. A well-known example of a ROT is a Trusted Platform Module, though
many different specifications for much simpler ROTs now exist.
In general, a ROT is a HW device that securely holds a private key, can
generate signed evidence reflecting its current state, and often includes
a measurement register system to create a tamper-proof log signed by its
private key. Sophisticated ROTs may also provide functions like sealing.
ROTs have become a significant security technology in the server space.
They are used to ensure the supply chain has not been tampered with and
to confirm directly that devices are running the expected, untampered
firmware and software.
tsm_report and tsm_mr each implement half of a ROT. tsm_mr allows
manipulating the measurement registers that tsm_report produces signed
evidence over. As things are restructured there will be one driver for
the ROT, and the two uAPIs of report and mr will continue forward using
that single driver.
Ultimately the subsystem should encompass at least the following devices:
* A simplified TPM interface for quote and PCR extend
* AMD CC VM signed reports
* ARM CCA VM signed reports and REM measurement registers
* ARM FIRME bare metal signed reports
* Caliptra open source ROT
* Intel TDX CC VM signed reports and RTMR measurement registers
* SPDM protocol over PCIe DOE and other transports in bare metal
* "SPDM" evidence inside a CC guest using a TDISP device
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
.../sysfs-devices-virtual-misc-tdx_guest | 2 +-
Documentation/driver-api/attestation.rst | 36 +++++++++++++++++++
Documentation/driver-api/coco/index.rst | 10 ------
.../driver-api/coco/measurement-registers.rst | 12 -------
Documentation/driver-api/index.rst | 2 +-
MAINTAINERS | 4 +--
drivers/Kconfig | 2 ++
drivers/Makefile | 2 ++
drivers/attestation/Kconfig | 17 +++++++++
drivers/attestation/Makefile | 5 +++
.../{virt/coco/guest => attestation}/tsm-mr.c | 0
.../report.c => attestation/tsm-report.c} | 0
drivers/virt/coco/Kconfig | 2 --
drivers/virt/coco/Makefile | 1 -
drivers/virt/coco/arm-cca-guest/Kconfig | 2 +-
drivers/virt/coco/guest/Kconfig | 16 ---------
drivers/virt/coco/guest/Makefile | 4 ---
drivers/virt/coco/sev-guest/Kconfig | 2 +-
drivers/virt/coco/tdx-guest/Kconfig | 3 +-
samples/Kconfig | 3 +-
20 files changed, 70 insertions(+), 55 deletions(-)
create mode 100644 Documentation/driver-api/attestation.rst
delete mode 100644 Documentation/driver-api/coco/index.rst
delete mode 100644 Documentation/driver-api/coco/measurement-registers.rst
create mode 100644 drivers/attestation/Kconfig
create mode 100644 drivers/attestation/Makefile
rename drivers/{virt/coco/guest => attestation}/tsm-mr.c (100%)
rename drivers/{virt/coco/guest/report.c => attestation/tsm-report.c} (100%)
delete mode 100644 drivers/virt/coco/guest/Kconfig
delete mode 100644 drivers/virt/coco/guest/Makefile
diff --git a/Documentation/ABI/testing/sysfs-devices-virtual-misc-tdx_guest b/Documentation/ABI/testing/sysfs-devices-virtual-misc-tdx_guest
index 8fca56c8c9dfe6..44f7e82cc316f5 100644
--- a/Documentation/ABI/testing/sysfs-devices-virtual-misc-tdx_guest
+++ b/Documentation/ABI/testing/sysfs-devices-virtual-misc-tdx_guest
@@ -14,7 +14,7 @@ Description:
https://www.intel.com/content/www/us/en/developer/tools/trust-domain-extensions/documentation.html#architecture
See also:
- https://docs.kernel.org/driver-api/coco/measurement-registers.html
+ https://docs.kernel.org/driver-api/attestation.html
What: /sys/devices/virtual/misc/tdx_guest/measurements/mrconfigid
Date: April, 2025
diff --git a/Documentation/driver-api/attestation.rst b/Documentation/driver-api/attestation.rst
new file mode 100644
index 00000000000000..15092bea90f770
--- /dev/null
+++ b/Documentation/driver-api/attestation.rst
@@ -0,0 +1,36 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+=====================
+Attestation Subsystem
+=====================
+
+Attestation subsystem is intended to support drivers for all Roots of Trust
+(ROTs), both local to the CPU and on-device ROTs accessed through SPDM. A well
+known example of a ROT is a Trusted Platform Module, though many different
+specifications for much simpler ROTs exist now.
+
+In general a ROT is a HW device that securely holds a private key, can generate
+a signed evidence reflecting its current state and often includes a measurement
+register system to create a tamper proof log signed by its private key.
+Sophisticated ROTs may also provide functions like sealing.
+
+ROTs have become a significant security technology in the server space. They are
+used to ensure the supply chain has not been tampered with and confirm directly
+that devices are running expected untampered firmware and software.
+
+Measurement Registers
+=====================
+
+"Measurement Registers" (called a PCR in the TPM standards) are used for
+creating a tamper proof log. The register stores the current top of something
+like a Merkle Tree which chains cryptographic hash functions together to reflect
+the current content of a dynamically growing log. When the ROT generates signed
+evidence it will sign this value which allows verifying that the associated log
+is unchanged.
+
+.. kernel-doc:: include/linux/tsm-mr.h
+ :internal:
+
+.. kernel-doc:: drivers/attestation/tsm-mr.c
+ :export:
diff --git a/Documentation/driver-api/coco/index.rst b/Documentation/driver-api/coco/index.rst
deleted file mode 100644
index 783c8b033547ef..00000000000000
--- a/Documentation/driver-api/coco/index.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-======================
-Confidential Computing
-======================
-
-.. toctree::
- :maxdepth: 1
-
- measurement-registers
diff --git a/Documentation/driver-api/coco/measurement-registers.rst b/Documentation/driver-api/coco/measurement-registers.rst
deleted file mode 100644
index 962a44efa2c027..00000000000000
--- a/Documentation/driver-api/coco/measurement-registers.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-.. include:: <isonum.txt>
-
-=====================
-Measurement Registers
-=====================
-
-.. kernel-doc:: include/linux/tsm-mr.h
- :internal:
-
-.. kernel-doc:: drivers/virt/coco/guest/tsm-mr.c
- :export:
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst
index aaf5d76ed074ed..3f32af5ac8b91f 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -80,9 +80,9 @@ Subsystem-specific APIs
80211/index
acpi/index
+ attestation
backlight/lp855x-driver.rst
clk
- coco/index
console
crypto/index
dmaengine/index
diff --git a/MAINTAINERS b/MAINTAINERS
index e8059b3d7e6efb..841e21afde3d82 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -28543,12 +28543,12 @@ L: linux-coco@lists.linux.dev
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tsm/linux.git
F: Documentation/ABI/testing/configfs-tsm-report
-F: Documentation/driver-api/coco/
+F: Documentation/driver-api/attestation.rst
F: Documentation/driver-api/pci/tsm.rst
+F: drivers/attestation/
F: drivers/crypto/ccp/sev-dev-tio.*
F: drivers/crypto/ccp/sev-dev-tsm.c
F: drivers/pci/tsm.c
-F: drivers/virt/coco/guest/
F: drivers/virt/coco/tsm-core.c
F: include/linux/*tsm*.h
F: samples/tsm-mr/
diff --git a/drivers/Kconfig b/drivers/Kconfig
index f2bed2ddeb6628..53b21efd02f649 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -143,6 +143,8 @@ source "drivers/uio/Kconfig"
source "drivers/vfio/Kconfig"
+source "drivers/attestation/Kconfig"
+
source "drivers/virt/Kconfig"
source "drivers/virtio/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 0841ea851847e8..4b471559773114 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -159,6 +159,8 @@ obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/
obj-$(CONFIG_SOUNDWIRE) += soundwire/
+obj-$(CONFIG_ATTESTATION) += attestation/
+
# Virtualization drivers
obj-y += virt/
obj-$(CONFIG_HYPERV) += hv/
diff --git a/drivers/attestation/Kconfig b/drivers/attestation/Kconfig
new file mode 100644
index 00000000000000..86672fa9477b20
--- /dev/null
+++ b/drivers/attestation/Kconfig
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+menuconfig ATTESTATION
+ tristate "Attestation and root of trust devices"
+ select CONFIGFS_FS
+ select CRYPTO_HASH_INFO
+ help
+ Attestation and root of trust (RoT) devices include a range of
+ hardware used in machine attestation. Typically, this hardware
+ protects a private key and can generate signed evidence to report
+ its state. A root of trust often has measurement registers used to
+ create a tamper-proof log.
+
+ The subsystem supports drivers for devices of this class and provides
+ uAPIs to get the information out to userspace.
+
+ If you are unsure, say N.
diff --git a/drivers/attestation/Makefile b/drivers/attestation/Makefile
new file mode 100644
index 00000000000000..3f89f690089e8e
--- /dev/null
+++ b/drivers/attestation/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+attestation-y := \
+ tsm-mr.o \
+ tsm-report.o
+obj-$(CONFIG_ATTESTATION) += attestation.o
diff --git a/drivers/virt/coco/guest/tsm-mr.c b/drivers/attestation/tsm-mr.c
similarity index 100%
rename from drivers/virt/coco/guest/tsm-mr.c
rename to drivers/attestation/tsm-mr.c
diff --git a/drivers/virt/coco/guest/report.c b/drivers/attestation/tsm-report.c
similarity index 100%
rename from drivers/virt/coco/guest/report.c
rename to drivers/attestation/tsm-report.c
diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig
index f7691f64fbe32d..b8960a9e27df61 100644
--- a/drivers/virt/coco/Kconfig
+++ b/drivers/virt/coco/Kconfig
@@ -13,8 +13,6 @@ source "drivers/virt/coco/sev-guest/Kconfig"
source "drivers/virt/coco/tdx-guest/Kconfig"
source "drivers/virt/coco/arm-cca-guest/Kconfig"
-
-source "drivers/virt/coco/guest/Kconfig"
endif
source "drivers/virt/coco/tdx-host/Kconfig"
diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile
index b323b0ae4f82da..0dcad65fdc376e 100644
--- a/drivers/virt/coco/Makefile
+++ b/drivers/virt/coco/Makefile
@@ -9,4 +9,3 @@ obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/
obj-$(CONFIG_INTEL_TDX_HOST) += tdx-host/
obj-$(CONFIG_ARM_CCA_GUEST) += arm-cca-guest/
obj-$(CONFIG_TSM) += tsm-core.o
-obj-$(CONFIG_TSM_GUEST) += guest/
diff --git a/drivers/virt/coco/arm-cca-guest/Kconfig b/drivers/virt/coco/arm-cca-guest/Kconfig
index 0d4ce72e2d8622..cfd6e3d9730092 100644
--- a/drivers/virt/coco/arm-cca-guest/Kconfig
+++ b/drivers/virt/coco/arm-cca-guest/Kconfig
@@ -2,7 +2,7 @@ config ARM_CCA_GUEST
tristate "Arm CCA Guest driver"
depends on ARM_RMM_RSI
depends on HAVE_ARM_SMCCC_DISCOVERY
- select TSM_REPORTS
+ depends on ATTESTATION
help
The driver provides userspace interface to request and
attestation report from the Realm Management Monitor(RMM).
diff --git a/drivers/virt/coco/guest/Kconfig b/drivers/virt/coco/guest/Kconfig
deleted file mode 100644
index da570dc4bd4803..00000000000000
--- a/drivers/virt/coco/guest/Kconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Confidential computing shared guest collateral
-#
-config TSM_GUEST
- bool
-
-config TSM_REPORTS
- select TSM_GUEST
- select CONFIGFS_FS
- tristate
-
-config TSM_MEASUREMENTS
- select TSM_GUEST
- select CRYPTO_HASH_INFO
- bool
diff --git a/drivers/virt/coco/guest/Makefile b/drivers/virt/coco/guest/Makefile
deleted file mode 100644
index 9ec4860bd213ae..00000000000000
--- a/drivers/virt/coco/guest/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_TSM_REPORTS) += tsm_report.o
-tsm_report-y := report.o
-obj-$(CONFIG_TSM_MEASUREMENTS) += tsm-mr.o
diff --git a/drivers/virt/coco/sev-guest/Kconfig b/drivers/virt/coco/sev-guest/Kconfig
index a6405ab6c2c37c..f615fc9409c86f 100644
--- a/drivers/virt/coco/sev-guest/Kconfig
+++ b/drivers/virt/coco/sev-guest/Kconfig
@@ -2,7 +2,7 @@ config SEV_GUEST
tristate "AMD SEV Guest driver"
default m
depends on AMD_MEM_ENCRYPT
- select TSM_REPORTS
+ depends on ATTESTATION
help
SEV-SNP firmware provides the guest a mechanism to communicate with
the PSP without risk from a malicious hypervisor who wishes to read,
diff --git a/drivers/virt/coco/tdx-guest/Kconfig b/drivers/virt/coco/tdx-guest/Kconfig
index dbbdc14383b132..bfb7e6787ffc88 100644
--- a/drivers/virt/coco/tdx-guest/Kconfig
+++ b/drivers/virt/coco/tdx-guest/Kconfig
@@ -1,8 +1,7 @@
config TDX_GUEST_DRIVER
tristate "TDX Guest driver"
depends on INTEL_TDX_GUEST
- select TSM_REPORTS
- select TSM_MEASUREMENTS
+ depends on ATTESTATION
help
The driver provides userspace interface to communicate with
the TDX module to request the TDX guest details like attestation
diff --git a/samples/Kconfig b/samples/Kconfig
index 00eed83c07dfcb..c4a6b6a7b2b427 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -195,10 +195,9 @@ config SAMPLE_TIMER
config SAMPLE_TSM_MR
tristate "TSM measurement sample"
+ depends on ATTESTATION
select CRYPTO_LIB_SHA256
select CRYPTO_LIB_SHA512
- select TSM_MEASUREMENTS
- select VIRT_DRIVERS
help
Build a sample module that emulates MRs (Measurement Registers) and
exposes them to user mode applications through the TSM sysfs
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 1/4] attestation: Start the new subsystem using tsm_report and mr Jason Gunthorpe
@ 2026-12-01 0:52 ` Jason Gunthorpe
2026-12-01 5:25 ` Aneesh Kumar K.V
2026-12-01 0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 0:52 UTC (permalink / raw)
To: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
drivers/virt/coco/arm-cca-guest/main.c is a bit broadly named, but it is
the driver for the Root of Trust inside the RMM, which the guest accesses
only through RSI calls.
This is commonly called the "Realm Token". It also has 4 measurement
registers, but there is no driver for them in Linux yet.
Move it into drivers/attestation/arm/cca-guest.c.
The simple rename takes the arm_smccc_driver for SMC_RSI_ABI_VERSION along
with it. This isn't going to work long term, but Yeoreum has some good
ideas on how to split multi-function SMCCC interfaces into
subsystem-specific drivers that will solve this.
Cc: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
MAINTAINERS | 1 -
drivers/attestation/Kconfig | 4 ++++
drivers/attestation/Makefile | 2 ++
drivers/attestation/arm/Kconfig | 12 ++++++++++++
drivers/attestation/arm/Makefile | 4 ++++
.../main.c => attestation/arm/cca-guest.c} | 2 +-
drivers/virt/coco/Kconfig | 2 --
drivers/virt/coco/Makefile | 1 -
drivers/virt/coco/arm-cca-guest/Kconfig | 11 -----------
drivers/virt/coco/arm-cca-guest/Makefile | 4 ----
10 files changed, 23 insertions(+), 20 deletions(-)
create mode 100644 drivers/attestation/arm/Kconfig
create mode 100644 drivers/attestation/arm/Makefile
rename drivers/{virt/coco/arm-cca-guest/main.c => attestation/arm/cca-guest.c} (99%)
delete mode 100644 drivers/virt/coco/arm-cca-guest/Kconfig
delete mode 100644 drivers/virt/coco/arm-cca-guest/Makefile
diff --git a/MAINTAINERS b/MAINTAINERS
index 841e21afde3d82..e1bffcecea65cd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4041,7 +4041,6 @@ F: Documentation/ABI/testing/sysfs-firmware-cca
F: Documentation/arch/arm64/
F: arch/arm64/
F: drivers/firmware/arm_rmm/
-F: drivers/virt/coco/arm-cca-guest/
F: drivers/virt/coco/pkvm-guest/
F: include/linux/arm-rmi-cmds.h
F: include/linux/arm-rsi-cmds.h
diff --git a/drivers/attestation/Kconfig b/drivers/attestation/Kconfig
index 86672fa9477b20..c71b6e1e5a501e 100644
--- a/drivers/attestation/Kconfig
+++ b/drivers/attestation/Kconfig
@@ -15,3 +15,7 @@ menuconfig ATTESTATION
uAPIs to get the information out to userspace.
If you are unsure, say N.
+
+if ATTESTATION
+source "drivers/attestation/arm/Kconfig"
+endif # ATTESTATION
diff --git a/drivers/attestation/Makefile b/drivers/attestation/Makefile
index 3f89f690089e8e..c48d12d31c6579 100644
--- a/drivers/attestation/Makefile
+++ b/drivers/attestation/Makefile
@@ -3,3 +3,5 @@ attestation-y := \
tsm-mr.o \
tsm-report.o
obj-$(CONFIG_ATTESTATION) += attestation.o
+
+obj-$(CONFIG_ATTESTATION_ARM_CCA_GUEST) += arm/
diff --git a/drivers/attestation/arm/Kconfig b/drivers/attestation/arm/Kconfig
new file mode 100644
index 00000000000000..8c54374930b751
--- /dev/null
+++ b/drivers/attestation/arm/Kconfig
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config ATTESTATION_ARM_CCA_GUEST
+ tristate "Arm CCA Realm Token Attestation Driver"
+ depends on ARM_RMM_RSI
+ depends on HAVE_ARM_SMCCC_DISCOVERY
+ help
+ Driver for the Realm Token provided by the Root of Trust inside
+ the Realm Management Monitor (RMM) through an RSI.
+
+ Reports are available in user-created directories under
+ /sys/kernel/config/tsm/report/ with provider "arm_cca_guest".
+ This driver does not expose TSM measurement registers.
diff --git a/drivers/attestation/arm/Makefile b/drivers/attestation/arm/Makefile
new file mode 100644
index 00000000000000..cf39145ac103f1
--- /dev/null
+++ b/drivers/attestation/arm/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+attestation_arm_cca_guest-y := cca-guest.o
+
+obj-$(CONFIG_ATTESTATION_ARM_CCA_GUEST) += attestation_arm_cca_guest.o
diff --git a/drivers/virt/coco/arm-cca-guest/main.c b/drivers/attestation/arm/cca-guest.c
similarity index 99%
rename from drivers/virt/coco/arm-cca-guest/main.c
rename to drivers/attestation/arm/cca-guest.c
index f97f593da6e3d3..dfebaf36d05cea 100644
--- a/drivers/virt/coco/arm-cca-guest/main.c
+++ b/drivers/attestation/arm/cca-guest.c
@@ -158,7 +158,7 @@ static int arm_cca_report_new(struct tsm_report *report, void *data)
}
static const struct tsm_report_ops arm_cca_tsm_report_ops = {
- .name = KBUILD_MODNAME,
+ .name = "arm_cca_guest",
.report_new = arm_cca_report_new,
};
diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig
index b8960a9e27df61..cc5fa179f2e850 100644
--- a/drivers/virt/coco/Kconfig
+++ b/drivers/virt/coco/Kconfig
@@ -11,8 +11,6 @@ source "drivers/virt/coco/pkvm-guest/Kconfig"
source "drivers/virt/coco/sev-guest/Kconfig"
source "drivers/virt/coco/tdx-guest/Kconfig"
-
-source "drivers/virt/coco/arm-cca-guest/Kconfig"
endif
source "drivers/virt/coco/tdx-host/Kconfig"
diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile
index 0dcad65fdc376e..acda2e49d5e173 100644
--- a/drivers/virt/coco/Makefile
+++ b/drivers/virt/coco/Makefile
@@ -7,5 +7,4 @@ obj-$(CONFIG_ARM_PKVM_GUEST) += pkvm-guest/
obj-$(CONFIG_SEV_GUEST) += sev-guest/
obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/
obj-$(CONFIG_INTEL_TDX_HOST) += tdx-host/
-obj-$(CONFIG_ARM_CCA_GUEST) += arm-cca-guest/
obj-$(CONFIG_TSM) += tsm-core.o
diff --git a/drivers/virt/coco/arm-cca-guest/Kconfig b/drivers/virt/coco/arm-cca-guest/Kconfig
deleted file mode 100644
index cfd6e3d9730092..00000000000000
--- a/drivers/virt/coco/arm-cca-guest/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-config ARM_CCA_GUEST
- tristate "Arm CCA Guest driver"
- depends on ARM_RMM_RSI
- depends on HAVE_ARM_SMCCC_DISCOVERY
- depends on ATTESTATION
- help
- The driver provides userspace interface to request and
- attestation report from the Realm Management Monitor(RMM).
-
- If you choose 'M' here, this module will be called
- arm-cca-guest.
diff --git a/drivers/virt/coco/arm-cca-guest/Makefile b/drivers/virt/coco/arm-cca-guest/Makefile
deleted file mode 100644
index 7564f4fcc4a41a..00000000000000
--- a/drivers/virt/coco/arm-cca-guest/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_ARM_CCA_GUEST) += arm-cca-guest.o
-
-arm-cca-guest-y += main.o
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 1/4] attestation: Start the new subsystem using tsm_report and mr Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver Jason Gunthorpe
@ 2026-12-01 0:52 ` Jason Gunthorpe
2026-12-01 16:19 ` Dave Jiang
2026-12-01 0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
2026-12-01 14:32 ` [PATCH tsm 0/4] Start building drivers/attestation Jiri Pirko
4 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 0:52 UTC (permalink / raw)
To: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
tdx-guest.c is the driver for the Root of Trust inside the TDX module
accessed by the guest.
The Intel TDX spec supports two token formats and 4 measurement registers.
Move it into drivers/attestation/intel/tdx-guest.c.
Module autoloading continues to be triggered by the x86_cpu_id match
mechanism.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
arch/x86/coco/tdx/tdx.c | 8 ++++----
drivers/attestation/Kconfig | 1 +
drivers/attestation/Makefile | 1 +
drivers/attestation/intel/Kconfig | 13 +++++++++++++
drivers/attestation/intel/Makefile | 4 ++++
.../tdx-guest => attestation/intel}/tdx-guest.c | 4 ++--
drivers/virt/coco/Kconfig | 2 --
drivers/virt/coco/Makefile | 1 -
drivers/virt/coco/tdx-guest/Kconfig | 11 -----------
drivers/virt/coco/tdx-guest/Makefile | 2 --
tools/testing/selftests/tdx/config | 2 +-
11 files changed, 26 insertions(+), 23 deletions(-)
create mode 100644 drivers/attestation/intel/Kconfig
create mode 100644 drivers/attestation/intel/Makefile
rename drivers/{virt/coco/tdx-guest => attestation/intel}/tdx-guest.c (99%)
delete mode 100644 drivers/virt/coco/tdx-guest/Kconfig
delete mode 100644 drivers/virt/coco/tdx-guest/Makefile
diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
index 8bacbef62891fd..55124b201b3c1a 100644
--- a/arch/x86/coco/tdx/tdx.c
+++ b/arch/x86/coco/tdx/tdx.c
@@ -139,7 +139,7 @@ int tdx_mcall_get_report0(u8 *reportdata, u8 *tdreport)
return 0;
}
-EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_get_report0, "tdx-guest");
+EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_get_report0, "attestation_intel_tdx_guest");
/**
* tdx_mcall_extend_rtmr() - Wrapper to extend RTMR registers using
@@ -175,7 +175,7 @@ int tdx_mcall_extend_rtmr(u8 index, u8 *data)
return 0;
}
-EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_extend_rtmr, "tdx-guest");
+EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_extend_rtmr, "attestation_intel_tdx_guest");
/**
* tdx_hcall_get_quote() - Wrapper to request TD Quote using GetQuote
@@ -196,7 +196,7 @@ u64 tdx_hcall_get_quote(void *buf, size_t size)
/* Since buf is a shared memory, set the shared (decrypted) bits */
return _tdx_hypercall(TDVMCALL_GET_QUOTE, cc_mkdec(virt_to_phys(buf)), size, 0, 0);
}
-EXPORT_SYMBOL_FOR_MODULES(tdx_hcall_get_quote, "tdx-guest");
+EXPORT_SYMBOL_FOR_MODULES(tdx_hcall_get_quote, "attestation_intel_tdx_guest");
/*
* Ask the TDX module what the largest Quote on the host platform might be.
@@ -213,7 +213,7 @@ int tdx_get_max_quote_size(u64 *max_quote_size)
return 0;
}
-EXPORT_SYMBOL_FOR_MODULES(tdx_get_max_quote_size, "tdx-guest");
+EXPORT_SYMBOL_FOR_MODULES(tdx_get_max_quote_size, "attestation_intel_tdx_guest");
/*
* The kernel cannot handle #VEs when accessing normal kernel memory. Ensure
diff --git a/drivers/attestation/Kconfig b/drivers/attestation/Kconfig
index c71b6e1e5a501e..d632503a55f85a 100644
--- a/drivers/attestation/Kconfig
+++ b/drivers/attestation/Kconfig
@@ -18,4 +18,5 @@ menuconfig ATTESTATION
if ATTESTATION
source "drivers/attestation/arm/Kconfig"
+source "drivers/attestation/intel/Kconfig"
endif # ATTESTATION
diff --git a/drivers/attestation/Makefile b/drivers/attestation/Makefile
index c48d12d31c6579..e12162cb55e30b 100644
--- a/drivers/attestation/Makefile
+++ b/drivers/attestation/Makefile
@@ -5,3 +5,4 @@ attestation-y := \
obj-$(CONFIG_ATTESTATION) += attestation.o
obj-$(CONFIG_ATTESTATION_ARM_CCA_GUEST) += arm/
+obj-$(CONFIG_ATTESTATION_INTEL_TDX_GUEST) += intel/
diff --git a/drivers/attestation/intel/Kconfig b/drivers/attestation/intel/Kconfig
new file mode 100644
index 00000000000000..18a6a2b87e9188
--- /dev/null
+++ b/drivers/attestation/intel/Kconfig
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config ATTESTATION_INTEL_TDX_GUEST
+ tristate "Intel TDX Guest Attestation Driver"
+ depends on INTEL_TDX_GUEST
+ help
+ Driver for the TDX guest signed quote from the Root of Trust inside
+ the TDX module for confidential VMs. The quote includes 4 measurement
+ registers.
+
+ Reports are available in user-created directories under
+ /sys/kernel/config/tsm/report/ with provider "tdx_guest".
+ Measurement registers are exposed under
+ /sys/devices/virtual/misc/tdx_guest/measurements/.
diff --git a/drivers/attestation/intel/Makefile b/drivers/attestation/intel/Makefile
new file mode 100644
index 00000000000000..43ba77b6bfa012
--- /dev/null
+++ b/drivers/attestation/intel/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+attestation_intel_tdx_guest-y := tdx-guest.o
+
+obj-$(CONFIG_ATTESTATION_INTEL_TDX_GUEST) += attestation_intel_tdx_guest.o
diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/attestation/intel/tdx-guest.c
similarity index 99%
rename from drivers/virt/coco/tdx-guest/tdx-guest.c
rename to drivers/attestation/intel/tdx-guest.c
index 11d741da3b35f5..1ccc81f507141e 100644
--- a/drivers/virt/coco/tdx-guest/tdx-guest.c
+++ b/drivers/attestation/intel/tdx-guest.c
@@ -403,7 +403,7 @@ static const struct attribute_group *tdx_attr_groups[] = {
};
static struct miscdevice tdx_misc_dev = {
- .name = KBUILD_MODNAME,
+ .name = "tdx_guest",
.minor = MISC_DYNAMIC_MINOR,
.fops = &tdx_guest_fops,
.groups = tdx_attr_groups,
@@ -416,7 +416,7 @@ static const struct x86_cpu_id tdx_guest_ids[] = {
MODULE_DEVICE_TABLE(x86cpu, tdx_guest_ids);
static const struct tsm_report_ops tdx_tsm_ops = {
- .name = KBUILD_MODNAME,
+ .name = "tdx_guest",
.report_new = tdx_report_new,
.report_attr_visible = tdx_report_attr_visible,
.report_bin_attr_visible = tdx_report_bin_attr_visible,
diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig
index cc5fa179f2e850..5329f82c2b1e6d 100644
--- a/drivers/virt/coco/Kconfig
+++ b/drivers/virt/coco/Kconfig
@@ -9,8 +9,6 @@ source "drivers/virt/coco/efi_secret/Kconfig"
source "drivers/virt/coco/pkvm-guest/Kconfig"
source "drivers/virt/coco/sev-guest/Kconfig"
-
-source "drivers/virt/coco/tdx-guest/Kconfig"
endif
source "drivers/virt/coco/tdx-host/Kconfig"
diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile
index acda2e49d5e173..ea4e27a5ce5040 100644
--- a/drivers/virt/coco/Makefile
+++ b/drivers/virt/coco/Makefile
@@ -5,6 +5,5 @@
obj-$(CONFIG_EFI_SECRET) += efi_secret/
obj-$(CONFIG_ARM_PKVM_GUEST) += pkvm-guest/
obj-$(CONFIG_SEV_GUEST) += sev-guest/
-obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/
obj-$(CONFIG_INTEL_TDX_HOST) += tdx-host/
obj-$(CONFIG_TSM) += tsm-core.o
diff --git a/drivers/virt/coco/tdx-guest/Kconfig b/drivers/virt/coco/tdx-guest/Kconfig
deleted file mode 100644
index bfb7e6787ffc88..00000000000000
--- a/drivers/virt/coco/tdx-guest/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-config TDX_GUEST_DRIVER
- tristate "TDX Guest driver"
- depends on INTEL_TDX_GUEST
- depends on ATTESTATION
- help
- The driver provides userspace interface to communicate with
- the TDX module to request the TDX guest details like attestation
- report.
-
- To compile this driver as module, choose M here. The module will
- be called tdx-guest.
diff --git a/drivers/virt/coco/tdx-guest/Makefile b/drivers/virt/coco/tdx-guest/Makefile
deleted file mode 100644
index 775cb463f9c876..00000000000000
--- a/drivers/virt/coco/tdx-guest/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_TDX_GUEST_DRIVER) += tdx-guest.o
diff --git a/tools/testing/selftests/tdx/config b/tools/testing/selftests/tdx/config
index aa1edc829ab679..c5382d0cbcbad1 100644
--- a/tools/testing/selftests/tdx/config
+++ b/tools/testing/selftests/tdx/config
@@ -1 +1 @@
-CONFIG_TDX_GUEST_DRIVER=y
+CONFIG_ATTESTATION_INTEL_TDX_GUEST=y
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
` (2 preceding siblings ...)
2026-12-01 0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
@ 2026-12-01 0:52 ` Jason Gunthorpe
2026-12-01 3:05 ` Borislav Petkov
2026-12-01 14:32 ` [PATCH tsm 0/4] Start building drivers/attestation Jiri Pirko
4 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 0:52 UTC (permalink / raw)
To: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
sev-guest.c is the driver for the Root of Trust inside the PSP accessed
by confidential VMs.
It supports a direct access path and one that first goes through the
Secure VM Service Module (SVSM) running at VM Privilege Level 0 (VMPL0).
This allows the SVSM to mix its own data into the challenge, for instance
to bind the vTPM's EK. It also supports both a new and an old report
format.
Move it into drivers/attestation/amd/sev-guest.c.
Module autoloading still uses the platform_driver created by the arch
code.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
drivers/attestation/Kconfig | 1 +
drivers/attestation/Makefile | 1 +
drivers/attestation/amd/Kconfig | 15 +++++++++++++++
drivers/attestation/amd/Makefile | 4 ++++
.../sev-guest => attestation/amd}/sev-guest.c | 2 +-
drivers/virt/coco/Kconfig | 2 --
drivers/virt/coco/Makefile | 1 -
drivers/virt/coco/sev-guest/Kconfig | 13 -------------
drivers/virt/coco/sev-guest/Makefile | 2 --
9 files changed, 22 insertions(+), 19 deletions(-)
create mode 100644 drivers/attestation/amd/Kconfig
create mode 100644 drivers/attestation/amd/Makefile
rename drivers/{virt/coco/sev-guest => attestation/amd}/sev-guest.c (99%)
delete mode 100644 drivers/virt/coco/sev-guest/Kconfig
delete mode 100644 drivers/virt/coco/sev-guest/Makefile
diff --git a/drivers/attestation/Kconfig b/drivers/attestation/Kconfig
index d632503a55f85a..4312acc27fc47d 100644
--- a/drivers/attestation/Kconfig
+++ b/drivers/attestation/Kconfig
@@ -17,6 +17,7 @@ menuconfig ATTESTATION
If you are unsure, say N.
if ATTESTATION
+source "drivers/attestation/amd/Kconfig"
source "drivers/attestation/arm/Kconfig"
source "drivers/attestation/intel/Kconfig"
endif # ATTESTATION
diff --git a/drivers/attestation/Makefile b/drivers/attestation/Makefile
index e12162cb55e30b..2c98a03013f983 100644
--- a/drivers/attestation/Makefile
+++ b/drivers/attestation/Makefile
@@ -4,5 +4,6 @@ attestation-y := \
tsm-report.o
obj-$(CONFIG_ATTESTATION) += attestation.o
+obj-$(CONFIG_ATTESTATION_AMD_SEV_GUEST) += amd/
obj-$(CONFIG_ATTESTATION_ARM_CCA_GUEST) += arm/
obj-$(CONFIG_ATTESTATION_INTEL_TDX_GUEST) += intel/
diff --git a/drivers/attestation/amd/Kconfig b/drivers/attestation/amd/Kconfig
new file mode 100644
index 00000000000000..c3203d2f184f0c
--- /dev/null
+++ b/drivers/attestation/amd/Kconfig
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config ATTESTATION_AMD_SEV_GUEST
+ tristate "AMD SEV Guest Attestation Driver"
+ depends on AMD_MEM_ENCRYPT
+ help
+ Driver for the SEV-SNP firmware to access the root of trust in the PSP
+ for confidential VMs. This provides at least two kinds of signed
+ reports using a GUID scheme to select them. There are no measurement
+ registers.
+
+ Reports are available in user-created directories under
+ /sys/kernel/config/tsm/report/ with provider "sev_guest".
+
+ The /dev/sev-guest misc device also provides report and derived-key
+ ioctls. SVSM service reports and manifests use the TSM interface.
diff --git a/drivers/attestation/amd/Makefile b/drivers/attestation/amd/Makefile
new file mode 100644
index 00000000000000..2d2f5ca188813b
--- /dev/null
+++ b/drivers/attestation/amd/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+attestation_amd_sev_guest-y := sev-guest.o
+
+obj-$(CONFIG_ATTESTATION_AMD_SEV_GUEST) += attestation_amd_sev_guest.o
diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/attestation/amd/sev-guest.c
similarity index 99%
rename from drivers/virt/coco/sev-guest/sev-guest.c
rename to drivers/attestation/amd/sev-guest.c
index 5fade6cc135727..2a32b5bbf198f7 100644
--- a/drivers/virt/coco/sev-guest/sev-guest.c
+++ b/drivers/attestation/amd/sev-guest.c
@@ -612,7 +612,7 @@ static bool sev_report_bin_attr_visible(int n)
}
static struct tsm_report_ops sev_tsm_report_ops = {
- .name = KBUILD_MODNAME,
+ .name = "sev_guest",
.report_new = sev_report_new,
.report_attr_visible = sev_report_attr_visible,
.report_bin_attr_visible = sev_report_bin_attr_visible,
diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig
index 5329f82c2b1e6d..bd226c6ddb3fde 100644
--- a/drivers/virt/coco/Kconfig
+++ b/drivers/virt/coco/Kconfig
@@ -7,8 +7,6 @@ if VIRT_DRIVERS
source "drivers/virt/coco/efi_secret/Kconfig"
source "drivers/virt/coco/pkvm-guest/Kconfig"
-
-source "drivers/virt/coco/sev-guest/Kconfig"
endif
source "drivers/virt/coco/tdx-host/Kconfig"
diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile
index ea4e27a5ce5040..dee8fb922755f5 100644
--- a/drivers/virt/coco/Makefile
+++ b/drivers/virt/coco/Makefile
@@ -4,6 +4,5 @@
#
obj-$(CONFIG_EFI_SECRET) += efi_secret/
obj-$(CONFIG_ARM_PKVM_GUEST) += pkvm-guest/
-obj-$(CONFIG_SEV_GUEST) += sev-guest/
obj-$(CONFIG_INTEL_TDX_HOST) += tdx-host/
obj-$(CONFIG_TSM) += tsm-core.o
diff --git a/drivers/virt/coco/sev-guest/Kconfig b/drivers/virt/coco/sev-guest/Kconfig
deleted file mode 100644
index f615fc9409c86f..00000000000000
--- a/drivers/virt/coco/sev-guest/Kconfig
+++ /dev/null
@@ -1,13 +0,0 @@
-config SEV_GUEST
- tristate "AMD SEV Guest driver"
- default m
- depends on AMD_MEM_ENCRYPT
- depends on ATTESTATION
- help
- SEV-SNP firmware provides the guest a mechanism to communicate with
- the PSP without risk from a malicious hypervisor who wishes to read,
- alter, drop or replay the messages sent. The driver provides
- userspace interface to communicate with the PSP to request the
- attestation report and more.
-
- If you choose 'M' here, this module will be called sev-guest.
diff --git a/drivers/virt/coco/sev-guest/Makefile b/drivers/virt/coco/sev-guest/Makefile
deleted file mode 100644
index 63d67c27723a60..00000000000000
--- a/drivers/virt/coco/sev-guest/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_SEV_GUEST) += sev-guest.o
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
@ 2026-12-01 3:05 ` Borislav Petkov
2026-12-01 13:07 ` Jason Gunthorpe
0 siblings, 1 reply; 21+ messages in thread
From: Borislav Petkov @ 2026-12-01 3:05 UTC (permalink / raw)
To: Jason Gunthorpe, Tom Lendacky, Michael Roth
Cc: Alexey Kardashevskiy, Aneesh Kumar K.V, Jonathan Corbet,
Dave Hansen, H. Peter Anvin, Kiryl Shutsemau, kvm, linux-coco,
linux-doc, linux-kselftest, Lukas Wunner, Ingo Molnar,
Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, Jiri Pirko, patches, Yeoreum Yun
On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
> by confidential VMs.
"The driver provides userspace interface to communicate with the PSP to
request the attestation report and more."
So "and more" is no more?
Nothing else is going to need this thing and it will get hijacked into
attestation/?
I guess that's a question for Tom and Mike...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver
2026-12-01 0:52 ` [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver Jason Gunthorpe
@ 2026-12-01 5:25 ` Aneesh Kumar K.V
2026-12-01 13:03 ` Jason Gunthorpe
0 siblings, 1 reply; 21+ messages in thread
From: Aneesh Kumar K.V @ 2026-12-01 5:25 UTC (permalink / raw)
To: Jason Gunthorpe, Alexey Kardashevskiy, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
Jason Gunthorpe <jgg@nvidia.com> writes:
> drivers/virt/coco/arm-cca-guest/main.c is a bit broadly named, but it is
> the driver for the Root of Trust inside the RMM, which the guest accesses
> only through RSI calls.
>
> This is commonly called the "Realm Token". It also has 4 measurement
> registers, but there is no driver for them in Linux yet.
>
> Move it into drivers/attestation/arm/cca-guest.c.
>
> The simple rename takes the arm_smccc_driver for SMC_RSI_ABI_VERSION along
> with it. This isn't going to work long term, but Yeoreum has some good
> ideas on how to split multi-function SMCCC interfaces into
> subsystem-specific drivers that will solve this.
>
[ ... 150 lines skipped ... ]
That creates quite a bit of confusion around the guest driver. The CoCo
driver, arm-cca-guest.ko, will gain many additional features. The model
I have been working towards is for arm-cca-guest.ko to be the driver for
the arm-rsi device and, depending on the relevant conditions, register
with different subsystems. For example, it registers an attestation
device by calling:
attestation_cca_guest_register(dsc->realm_dev, dsc->binding, tsm);
attestation_cca_guest_register() will be provided by
attestation-cca-guest.ko, with the implementation in
drivers/attestation/arm/cca/da-guest.c.
IMHO, drivers/virt/coco should remain the location of the CoCo driver,
which should manage the arm-rsi device. Once tsm_report is moved to the
attestation framework, the cca-guest attestation driver would similarly
provide the corresponding registration functions.
-aneesh
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver
2026-12-01 5:25 ` Aneesh Kumar K.V
@ 2026-12-01 13:03 ` Jason Gunthorpe
0 siblings, 0 replies; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 13:03 UTC (permalink / raw)
To: Aneesh Kumar K.V
Cc: Alexey Kardashevskiy, Borislav Petkov, Jonathan Corbet,
Dave Hansen, H. Peter Anvin, Kiryl Shutsemau, kvm, linux-coco,
linux-doc, linux-kselftest, Lukas Wunner, Ingo Molnar,
Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, Jiri Pirko, patches, Yeoreum Yun
On Tue, Dec 01, 2026 at 10:55:02AM +0530, Aneesh Kumar K.V wrote:
> Jason Gunthorpe <jgg@nvidia.com> writes:
>
> > drivers/virt/coco/arm-cca-guest/main.c is a bit broadly named, but it is
> > the driver for the Root of Trust inside the RMM, which the guest accesses
> > only through RSI calls.
> >
> > This is commonly called the "Realm Token". It also has 4 measurement
> > registers, but there is no driver for them in Linux yet.
> >
> > Move it into drivers/attestation/arm/cca-guest.c.
> >
> > The simple rename takes the arm_smccc_driver for SMC_RSI_ABI_VERSION along
> > with it. This isn't going to work long term, but Yeoreum has some good
> > ideas on how to split multi-function SMCCC interfaces into
> > subsystem-specific drivers that will solve this.
> >
>
> [ ... 150 lines skipped ... ]
>
> That creates quite a bit of confusion around the guest driver. The CoCo
> driver, arm-cca-guest.ko, will gain many additional features.
Not really, it prevent confusions by splitting things up by
functionality.
This file today is 100% the realm token driver. It would make things
worse to cram a bunch of other unrelated stuff into it later on and
then try to split out again.
Lets start with things in the right place before we add more stuff.
> The model I have been working towards is for arm-cca-guest.ko to be
> the driver for the arm-rsi device and, depending on the relevant
> conditions, register with different subsystems. For example, it
> registers an attestation device by calling:
>
> attestation_cca_guest_register(dsc->realm_dev, dsc->binding, tsm);
That call is the job of the tsm driver, and we still need to figure
out where that all lives. A tsm driver for bare metal living in
drivers/virt/coco is pretty nonsensical too. As is AMD putting their
tsm driver in drivers/crypto :\
TSM has the same issue, I don't want to see drivers strewn all over
the place. I'm strongly thinking that drivers/firwmare/tsm/ is
probably the right thing to do there too.
> attestation_cca_guest_register() will be provided by
> attestation-cca-guest.ko, with the implementation in
> drivers/attestation/arm/cca/da-guest.c.
Sure, that makes sense, and this patch is just the realm token version
of the same idea.
> IMHO, drivers/virt/coco should remain the location of the CoCo driver,
> which should manage the arm-rsi device.
We don't need a "rsi device" for the realm token, we just need to
autoprobe the module somehow.
> Once tsm_report is moved to the attestation framework, the cca-guest
> attestation driver would similarly provide the corresponding
> registration functions.
That doesn't seem as nice - I prefer Yeoreum's enhancement to the smcc
bus..
But which ever direction things go the report/attestation code wants
to live here where I moved it and all this code belongs there. We will
figure out the driver binding to deal with the 'multi function smccc'
in one way or another so we can have proper drivers housed in their
proper subsystems.
The FIRME stuff has the same issue it wants an attestation driver and
a TSM driver, which is why I liked the smcc bus enhancement. It is
nice and reusable for each. You can just fork off the two drivers
naturally and then have some shared 'arm_rsi' or 'arm_firme' helper
library under drivers/firmware/arm as necessary.
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 3:05 ` Borislav Petkov
@ 2026-12-01 13:07 ` Jason Gunthorpe
2026-12-01 15:46 ` Tom Lendacky
0 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 13:07 UTC (permalink / raw)
To: Borislav Petkov
Cc: Tom Lendacky, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
> > sev-guest.c is the driver for the Root of Trust inside the PSP accessed
> > by confidential VMs.
>
> "The driver provides userspace interface to communicate with the PSP to
> request the attestation report and more."
>
> So "and more" is no more?
What do you mean? The weird misc device is still there, but other than
the symmetric key derivation it is already all absorbed into
tsm_report and should be obsoleted.
Is there some other "and more" I missed?
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 0/4] Start building drivers/attestation
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
` (3 preceding siblings ...)
2026-12-01 0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
@ 2026-12-01 14:32 ` Jiri Pirko
4 siblings, 0 replies; 21+ messages in thread
From: Jiri Pirko @ 2026-12-01 14:32 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, patches, Yeoreum Yun
Tue, Dec 01, 2026 at 01:52:20AM +0100, jgg@nvidia.com wrote:
>Move tsm_report and tsm_mr, along with all their drivers, into
>drivers/attestation. There are no functional changes, but some modules
>are renamed to consistent attestation_* names.
>
>This largely just moves drivers/virt/coco/* stuff to drivers/attestation
>and makes some adjustments to have per-arch subdirectories to hold all the
>stuff. virt/coco was OK when this was only going to be used inside
>confidential VMs, but with the new coming needs for bare metal and host
>support under the same umbrella it isn't a good place to build an entire
>subsystem.
>
>The attestation subsystem is intended to support drivers for all Roots of
>Trust (ROTs), both local to the CPU and on-device ROTs accessed through
>SPDM. A well-known example of a ROT is a Trusted Platform Module, though
>many different specifications for much simpler ROTs now exist.
>
>The existing drivers are all for the ROTs integrated into confidential
>VMs. AMD, Intel and ARM each have an attestation ROT linked to their
>respective implementations.
>
>A following set of drivers, like ARM FIRME, will start to bring in non-TPM
>ROTs on bare metal systems. The kernel SPDM implementation will also live
>here and use the upcoming enhanced uAPI.
>
>Eventually we hope to provide a kernel multiplexer so that in-kernel
>users, like IMA, can access any attestation measurement register instead
>of being hardwired to use only the TPM.
>
>Several reorganization and cleanup passes will be needed after this to
>turn it into a well-formed subsystem.
Looks fine to me overall. Thanks!
set-
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 13:07 ` Jason Gunthorpe
@ 2026-12-01 15:46 ` Tom Lendacky
2026-12-01 16:20 ` Jason Gunthorpe
0 siblings, 1 reply; 21+ messages in thread
From: Tom Lendacky @ 2026-12-01 15:46 UTC (permalink / raw)
To: Jason Gunthorpe, Borislav Petkov
Cc: Michael Roth, Alexey Kardashevskiy, Aneesh Kumar K.V,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, Jiri Pirko, patches, Yeoreum Yun
On 12/1/26 07:07, Jason Gunthorpe wrote:
> On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
>> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
>>> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
>>> by confidential VMs.
>>
>> "The driver provides userspace interface to communicate with the PSP to
>> request the attestation report and more."
>>
>> So "and more" is no more?
>
> What do you mean? The weird misc device is still there, but other than
> the symmetric key derivation it is already all absorbed into
> tsm_report and should be obsoleted.
>
> Is there some other "and more" I missed?
I'm about to submit a patch series to support the new SNP_GET_TPM_INFO
guest request, which would be obtained via the SEV guest driver. So, yes,
there is more.
Maybe just move the attestation support from the SEV guest driver into the
new file and make the SEV guest driver dependent on that code.
Thanks,
Tom
>
> Jason
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
@ 2026-12-01 16:19 ` Dave Jiang
2026-12-01 16:30 ` Jason Gunthorpe
2026-12-01 17:44 ` Edgecombe, Rick P
0 siblings, 2 replies; 21+ messages in thread
From: Dave Jiang @ 2026-12-01 16:19 UTC (permalink / raw)
To: Jason Gunthorpe, Alexey Kardashevskiy, Aneesh Kumar K.V,
Borislav Petkov, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86
Cc: Jiri Pirko, patches, Yeoreum Yun
On 11/30/26 5:52 PM, Jason Gunthorpe wrote:
> tdx-guest.c is the driver for the Root of Trust inside the TDX module
> accessed by the guest.
>
> The Intel TDX spec supports two token formats and 4 measurement registers.
>
> Move it into drivers/attestation/intel/tdx-guest.c.
>
> Module autoloading continues to be triggered by the x86_cpu_id match
> mechanism.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> arch/x86/coco/tdx/tdx.c | 8 ++++----
> drivers/attestation/Kconfig | 1 +
> drivers/attestation/Makefile | 1 +
> drivers/attestation/intel/Kconfig | 13 +++++++++++++
> drivers/attestation/intel/Makefile | 4 ++++
> .../tdx-guest => attestation/intel}/tdx-guest.c | 4 ++--
> drivers/virt/coco/Kconfig | 2 --
> drivers/virt/coco/Makefile | 1 -
> drivers/virt/coco/tdx-guest/Kconfig | 11 -----------
> drivers/virt/coco/tdx-guest/Makefile | 2 --
> tools/testing/selftests/tdx/config | 2 +-
> 11 files changed, 26 insertions(+), 23 deletions(-)
> create mode 100644 drivers/attestation/intel/Kconfig
> create mode 100644 drivers/attestation/intel/Makefile
> rename drivers/{virt/coco/tdx-guest => attestation/intel}/tdx-guest.c (99%)
> delete mode 100644 drivers/virt/coco/tdx-guest/Kconfig
> delete mode 100644 drivers/virt/coco/tdx-guest/Makefile
>
> diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> index 8bacbef62891fd..55124b201b3c1a 100644
> --- a/arch/x86/coco/tdx/tdx.c
> +++ b/arch/x86/coco/tdx/tdx.c
> @@ -139,7 +139,7 @@ int tdx_mcall_get_report0(u8 *reportdata, u8 *tdreport)
>
> return 0;
> }
> -EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_get_report0, "tdx-guest");
> +EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_get_report0, "attestation_intel_tdx_guest");
>
> /**
> * tdx_mcall_extend_rtmr() - Wrapper to extend RTMR registers using
> @@ -175,7 +175,7 @@ int tdx_mcall_extend_rtmr(u8 index, u8 *data)
>
> return 0;
> }
> -EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_extend_rtmr, "tdx-guest");
> +EXPORT_SYMBOL_FOR_MODULES(tdx_mcall_extend_rtmr, "attestation_intel_tdx_guest");
>
> /**
> * tdx_hcall_get_quote() - Wrapper to request TD Quote using GetQuote
> @@ -196,7 +196,7 @@ u64 tdx_hcall_get_quote(void *buf, size_t size)
> /* Since buf is a shared memory, set the shared (decrypted) bits */
> return _tdx_hypercall(TDVMCALL_GET_QUOTE, cc_mkdec(virt_to_phys(buf)), size, 0, 0);
> }
> -EXPORT_SYMBOL_FOR_MODULES(tdx_hcall_get_quote, "tdx-guest");
> +EXPORT_SYMBOL_FOR_MODULES(tdx_hcall_get_quote, "attestation_intel_tdx_guest");
>
> /*
> * Ask the TDX module what the largest Quote on the host platform might be.
> @@ -213,7 +213,7 @@ int tdx_get_max_quote_size(u64 *max_quote_size)
>
> return 0;
> }
> -EXPORT_SYMBOL_FOR_MODULES(tdx_get_max_quote_size, "tdx-guest");
> +EXPORT_SYMBOL_FOR_MODULES(tdx_get_max_quote_size, "attestation_intel_tdx_guest");
>
> /*
> * The kernel cannot handle #VEs when accessing normal kernel memory. Ensure
> diff --git a/drivers/attestation/Kconfig b/drivers/attestation/Kconfig
> index c71b6e1e5a501e..d632503a55f85a 100644
> --- a/drivers/attestation/Kconfig
> +++ b/drivers/attestation/Kconfig
> @@ -18,4 +18,5 @@ menuconfig ATTESTATION
>
> if ATTESTATION
> source "drivers/attestation/arm/Kconfig"
> +source "drivers/attestation/intel/Kconfig"
> endif # ATTESTATION
> diff --git a/drivers/attestation/Makefile b/drivers/attestation/Makefile
> index c48d12d31c6579..e12162cb55e30b 100644
> --- a/drivers/attestation/Makefile
> +++ b/drivers/attestation/Makefile
> @@ -5,3 +5,4 @@ attestation-y := \
> obj-$(CONFIG_ATTESTATION) += attestation.o
>
> obj-$(CONFIG_ATTESTATION_ARM_CCA_GUEST) += arm/
> +obj-$(CONFIG_ATTESTATION_INTEL_TDX_GUEST) += intel/
> diff --git a/drivers/attestation/intel/Kconfig b/drivers/attestation/intel/Kconfig
> new file mode 100644
> index 00000000000000..18a6a2b87e9188
> --- /dev/null
> +++ b/drivers/attestation/intel/Kconfig
> @@ -0,0 +1,13 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config ATTESTATION_INTEL_TDX_GUEST
> + tristate "Intel TDX Guest Attestation Driver"
> + depends on INTEL_TDX_GUEST
> + help
> + Driver for the TDX guest signed quote from the Root of Trust inside
> + the TDX module for confidential VMs. The quote includes 4 measurement
> + registers.
Unlike the RMM and the PSP, the TDX module doesn't sign anything. It produces the TD report, and the TD Quoting Enclave (QE) on the host signs it into a quote, which the guest gets through the GetQuote hypercall. See the Attestation section of Documentation/arch/x86/tdx.rst.
Also looking at tsm_mrs[], it looks to expose 8 measurement registers.
How about something like this?
Driver for TDX guest attestation. The TDX module produces a TD
report, and the host's TD Quoting Enclave signs it into a quote
through the GetQuote hypercall. The report carries MRTD,
RTMR0-RTMR3, MRCONFIGID, MROWNER and MROWNERCONFIG.
DJ> +
> + Reports are available in user-created directories under
> + /sys/kernel/config/tsm/report/ with provider "tdx_guest".
> + Measurement registers are exposed under
> + /sys/devices/virtual/misc/tdx_guest/measurements/.
> diff --git a/drivers/attestation/intel/Makefile b/drivers/attestation/intel/Makefile
> new file mode 100644
> index 00000000000000..43ba77b6bfa012
> --- /dev/null
> +++ b/drivers/attestation/intel/Makefile
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: GPL-2.0
> +attestation_intel_tdx_guest-y := tdx-guest.o
> +
> +obj-$(CONFIG_ATTESTATION_INTEL_TDX_GUEST) += attestation_intel_tdx_guest.o
> diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/attestation/intel/tdx-guest.c
> similarity index 99%
> rename from drivers/virt/coco/tdx-guest/tdx-guest.c
> rename to drivers/attestation/intel/tdx-guest.c
> index 11d741da3b35f5..1ccc81f507141e 100644
> --- a/drivers/virt/coco/tdx-guest/tdx-guest.c
> +++ b/drivers/attestation/intel/tdx-guest.c
> @@ -403,7 +403,7 @@ static const struct attribute_group *tdx_attr_groups[] = {
> };
>
> static struct miscdevice tdx_misc_dev = {
> - .name = KBUILD_MODNAME,
> + .name = "tdx_guest",
> .minor = MISC_DYNAMIC_MINOR,
> .fops = &tdx_guest_fops,
> .groups = tdx_attr_groups,
> @@ -416,7 +416,7 @@ static const struct x86_cpu_id tdx_guest_ids[] = {
> MODULE_DEVICE_TABLE(x86cpu, tdx_guest_ids);
>
> static const struct tsm_report_ops tdx_tsm_ops = {
> - .name = KBUILD_MODNAME,
> + .name = "tdx_guest",
> .report_new = tdx_report_new,
> .report_attr_visible = tdx_report_attr_visible,
> .report_bin_attr_visible = tdx_report_bin_attr_visible,
> diff --git a/drivers/virt/coco/Kconfig b/drivers/virt/coco/Kconfig
> index cc5fa179f2e850..5329f82c2b1e6d 100644
> --- a/drivers/virt/coco/Kconfig
> +++ b/drivers/virt/coco/Kconfig
> @@ -9,8 +9,6 @@ source "drivers/virt/coco/efi_secret/Kconfig"
> source "drivers/virt/coco/pkvm-guest/Kconfig"
>
> source "drivers/virt/coco/sev-guest/Kconfig"
> -
> -source "drivers/virt/coco/tdx-guest/Kconfig"
> endif
>
> source "drivers/virt/coco/tdx-host/Kconfig"
> diff --git a/drivers/virt/coco/Makefile b/drivers/virt/coco/Makefile
> index acda2e49d5e173..ea4e27a5ce5040 100644
> --- a/drivers/virt/coco/Makefile
> +++ b/drivers/virt/coco/Makefile
> @@ -5,6 +5,5 @@
> obj-$(CONFIG_EFI_SECRET) += efi_secret/
> obj-$(CONFIG_ARM_PKVM_GUEST) += pkvm-guest/
> obj-$(CONFIG_SEV_GUEST) += sev-guest/
> -obj-$(CONFIG_INTEL_TDX_GUEST) += tdx-guest/
> obj-$(CONFIG_INTEL_TDX_HOST) += tdx-host/
> obj-$(CONFIG_TSM) += tsm-core.o
> diff --git a/drivers/virt/coco/tdx-guest/Kconfig b/drivers/virt/coco/tdx-guest/Kconfig
> deleted file mode 100644
> index bfb7e6787ffc88..00000000000000
> --- a/drivers/virt/coco/tdx-guest/Kconfig
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -config TDX_GUEST_DRIVER
> - tristate "TDX Guest driver"
> - depends on INTEL_TDX_GUEST
> - depends on ATTESTATION
> - help
> - The driver provides userspace interface to communicate with
> - the TDX module to request the TDX guest details like attestation
> - report.
> -
> - To compile this driver as module, choose M here. The module will
> - be called tdx-guest.
> diff --git a/drivers/virt/coco/tdx-guest/Makefile b/drivers/virt/coco/tdx-guest/Makefile
> deleted file mode 100644
> index 775cb463f9c876..00000000000000
> --- a/drivers/virt/coco/tdx-guest/Makefile
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -# SPDX-License-Identifier: GPL-2.0
> -obj-$(CONFIG_TDX_GUEST_DRIVER) += tdx-guest.o
> diff --git a/tools/testing/selftests/tdx/config b/tools/testing/selftests/tdx/config
> index aa1edc829ab679..c5382d0cbcbad1 100644
> --- a/tools/testing/selftests/tdx/config
> +++ b/tools/testing/selftests/tdx/config
> @@ -1 +1 @@
> -CONFIG_TDX_GUEST_DRIVER=y
> +CONFIG_ATTESTATION_INTEL_TDX_GUEST=y
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 15:46 ` Tom Lendacky
@ 2026-12-01 16:20 ` Jason Gunthorpe
2026-12-01 16:38 ` Tom Lendacky
0 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 16:20 UTC (permalink / raw)
To: Tom Lendacky
Cc: Borislav Petkov, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On Tue, Dec 01, 2026 at 09:46:18AM -0600, Tom Lendacky wrote:
> On 12/1/26 07:07, Jason Gunthorpe wrote:
> > On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
> >> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
> >>> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
> >>> by confidential VMs.
> >>
> >> "The driver provides userspace interface to communicate with the PSP to
> >> request the attestation report and more."
> >>
> >> So "and more" is no more?
> >
> > What do you mean? The weird misc device is still there, but other than
> > the symmetric key derivation it is already all absorbed into
> > tsm_report and should be obsoleted.
> >
> > Is there some other "and more" I missed?
>
> I'm about to submit a patch series to support the new SNP_GET_TPM_INFO
> guest request, which would be obtained via the SEV guest driver. So, yes,
> there is more.
From the docs this looks like perfectly fine attestation evidence. It
is a blob signed by the ROT after all.
Returning it to userspace should definately flow through attestation
subsystem (even tsm_report can do it, I think?) not AMD private
ioctls.. It is exactly why we are investing so much to build a common
cross-vendor framework that works for everything.
It will eventually work better because your pTPM binding information
can just be transparently discovered, picked up by systemd-report and
delivered to the verifier, without any userspace hassles.
> Maybe just move the attestation support from the SEV guest driver into the
> new file and make the SEV guest driver dependent on that code.
There are probably module ordering issues with that kind of split :(
My expecation was the misc device is only used for attestation and ROT
related topics. That is what the current state is, is that wrong?
More broadly AMD should not be having its own private misc device with
no common APIs with anyone. Dan and Greg both told everyone that same
message a long time ago, go build more common APIs.
My expectation, based on what is in there now, that the misc device
will eventually be kconfig'd away as a legacy interface since the new
interfaces will fully encompass it. The existing AMD implementation of
tsm_report is already very close to obsoleting it.
Do you see it differently?
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 16:19 ` Dave Jiang
@ 2026-12-01 16:30 ` Jason Gunthorpe
2026-12-01 17:58 ` Dave Jiang
2026-12-01 17:44 ` Edgecombe, Rick P
1 sibling, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 16:30 UTC (permalink / raw)
To: Dave Jiang
Cc: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, Jiri Pirko, patches, Yeoreum Yun
On Tue, Dec 01, 2026 at 09:19:47AM -0700, Dave Jiang wrote:
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +config ATTESTATION_INTEL_TDX_GUEST
> > + tristate "Intel TDX Guest Attestation Driver"
> > + depends on INTEL_TDX_GUEST
> > + help
> > + Driver for the TDX guest signed quote from the Root of Trust inside
> > + the TDX module for confidential VMs. The quote includes 4 measurement
> > + registers.
>
> Unlike the RMM and the PSP, the TDX module doesn't sign anything. It
> produces the TD report, and the TD Quoting Enclave (QE) on the host
> signs it into a quote, which the guest gets through the GetQuote
> hypercall. See the Attestation section of
> Documentation/arch/x86/tdx.rst.
Yeah, but from this perspective these complications are all invisible
and hidden in the driver. It doesn't matter that there is the
complicated dance, at the end of the day TDX module is fully in
control of the data that is signed by the platform. That is no
different from any other CC VM ROT.
> Also looking at tsm_mrs[], it looks to expose 8 measurement registers.
I was only thinking of the mutable ones as measurement registers, but
right, the non-mutable ones are there too. ARM also has non-mutable
ones.
> How about something like this?
>
> Driver for TDX guest attestation. The TDX module produces a TD
> report, and the host's TD Quoting Enclave signs it into a quote
> through the GetQuote hypercall. The report carries MRTD,
> RTMR0-RTMR3, MRCONFIGID, MROWNER and MROWNERCONFIG.
Can we simplify the first part: "The TDX module produces evidence
signed by the platform" ?
To keep the language in line with the proposed uAPI?
Thanks,
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 16:20 ` Jason Gunthorpe
@ 2026-12-01 16:38 ` Tom Lendacky
2026-12-01 17:11 ` Jason Gunthorpe
0 siblings, 1 reply; 21+ messages in thread
From: Tom Lendacky @ 2026-12-01 16:38 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Borislav Petkov, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On 12/1/26 10:20, Jason Gunthorpe wrote:
> On Tue, Dec 01, 2026 at 09:46:18AM -0600, Tom Lendacky wrote:
>> On 12/1/26 07:07, Jason Gunthorpe wrote:
>>> On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
>>>> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
>>>>> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
>>>>> by confidential VMs.
>>>>
>>>> "The driver provides userspace interface to communicate with the PSP to
>>>> request the attestation report and more."
>>>>
>>>> So "and more" is no more?
>>>
>>> What do you mean? The weird misc device is still there, but other than
>>> the symmetric key derivation it is already all absorbed into
>>> tsm_report and should be obsoleted.
>>>
>>> Is there some other "and more" I missed?
>>
>> I'm about to submit a patch series to support the new SNP_GET_TPM_INFO
>> guest request, which would be obtained via the SEV guest driver. So, yes,
>> there is more.
>
> From the docs this looks like perfectly fine attestation evidence. It
> is a blob signed by the ROT after all.
>
> Returning it to userspace should definately flow through attestation
> subsystem (even tsm_report can do it, I think?) not AMD private
> ioctls.. It is exactly why we are investing so much to build a common
> cross-vendor framework that works for everything.
So something like /sys/kernel/config/tsm/report/tpmblob? Both outblob and
tpmblob take a nonce, so would we want to use the same inblob or a
different file?
Or would it be better to be a separate configfs directory, e.g.
/sys/kernel/config/tsm/tpm-report, with inblob and outblob for consistency?
Does TDX or CCA having anything similar for a pTPM binding?
Thanks,
Tom
>
> It will eventually work better because your pTPM binding information
> can just be transparently discovered, picked up by systemd-report and
> delivered to the verifier, without any userspace hassles.
>
>> Maybe just move the attestation support from the SEV guest driver into the
>> new file and make the SEV guest driver dependent on that code.
>
> There are probably module ordering issues with that kind of split :(
>
> My expecation was the misc device is only used for attestation and ROT
> related topics. That is what the current state is, is that wrong?
>
> More broadly AMD should not be having its own private misc device with
> no common APIs with anyone. Dan and Greg both told everyone that same
> message a long time ago, go build more common APIs.
>
> My expectation, based on what is in there now, that the misc device
> will eventually be kconfig'd away as a legacy interface since the new
> interfaces will fully encompass it. The existing AMD implementation of
> tsm_report is already very close to obsoleting it.
>
> Do you see it differently?
>
> Jason
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 16:38 ` Tom Lendacky
@ 2026-12-01 17:11 ` Jason Gunthorpe
2026-12-01 17:33 ` Tom Lendacky
0 siblings, 1 reply; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 17:11 UTC (permalink / raw)
To: Tom Lendacky
Cc: Borislav Petkov, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On Tue, Dec 01, 2026 at 10:38:03AM -0600, Tom Lendacky wrote:
> On 12/1/26 10:20, Jason Gunthorpe wrote:
> > On Tue, Dec 01, 2026 at 09:46:18AM -0600, Tom Lendacky wrote:
> >> On 12/1/26 07:07, Jason Gunthorpe wrote:
> >>> On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
> >>>> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
> >>>>> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
> >>>>> by confidential VMs.
> >>>>
> >>>> "The driver provides userspace interface to communicate with the PSP to
> >>>> request the attestation report and more."
> >>>>
> >>>> So "and more" is no more?
> >>>
> >>> What do you mean? The weird misc device is still there, but other than
> >>> the symmetric key derivation it is already all absorbed into
> >>> tsm_report and should be obsoleted.
> >>>
> >>> Is there some other "and more" I missed?
> >>
> >> I'm about to submit a patch series to support the new SNP_GET_TPM_INFO
> >> guest request, which would be obtained via the SEV guest driver. So, yes,
> >> there is more.
> >
> > From the docs this looks like perfectly fine attestation evidence. It
> > is a blob signed by the ROT after all.
> >
> > Returning it to userspace should definately flow through attestation
> > subsystem (even tsm_report can do it, I think?) not AMD private
> > ioctls.. It is exactly why we are investing so much to build a common
> > cross-vendor framework that works for everything.
>
> So something like /sys/kernel/config/tsm/report/tpmblob? Both outblob and
> tpmblob take a nonce, so would we want to use the same inblob or a
> different file?
I would imagine you use one of the mechanisms to change the outblob?
It is a signed report so it should go that way as a single request
with dedicated inblob sequence to specify the nonce.
eg you could give it a GUID and run it through the GUID mechanism.
With the new uAPI it will be cleaner..
> Or would it be better to be a separate configfs directory, e.g.
> /sys/kernel/config/tsm/tpm-report, with inblob and outblob for consistency?
>
> Does TDX or CCA having anything similar for a pTPM binding?
I have not seen anyone do pROT binding into VMs yet. I'm aware of
conversations but nothing concrete. Usually people are interested in a
quote from the pROT, not just a binding. Is that where you are going
too?
What is the use case to share the pTPM's EK to the guest without any
further interaction to the pTPM?
If you imagine further pTPM interaction then maybe this should be its
own guest attestation driver to represent the pTPM.
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 17:11 ` Jason Gunthorpe
@ 2026-12-01 17:33 ` Tom Lendacky
2026-12-01 17:53 ` Jason Gunthorpe
0 siblings, 1 reply; 21+ messages in thread
From: Tom Lendacky @ 2026-12-01 17:33 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Borislav Petkov, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On 12/1/26 11:11, Jason Gunthorpe wrote:
> On Tue, Dec 01, 2026 at 10:38:03AM -0600, Tom Lendacky wrote:
>> On 12/1/26 10:20, Jason Gunthorpe wrote:
>>> On Tue, Dec 01, 2026 at 09:46:18AM -0600, Tom Lendacky wrote:
>>>> On 12/1/26 07:07, Jason Gunthorpe wrote:
>>>>> On Mon, Nov 30, 2026 at 07:05:53PM -0800, Borislav Petkov wrote:
>>>>>> On Mon, Nov 30, 2026 at 08:52:24PM -0400, Jason Gunthorpe wrote:
>>>>>>> sev-guest.c is the driver for the Root of Trust inside the PSP accessed
>>>>>>> by confidential VMs.
>>>>>>
>>>>>> "The driver provides userspace interface to communicate with the PSP to
>>>>>> request the attestation report and more."
>>>>>>
>>>>>> So "and more" is no more?
>>>>>
>>>>> What do you mean? The weird misc device is still there, but other than
>>>>> the symmetric key derivation it is already all absorbed into
>>>>> tsm_report and should be obsoleted.
>>>>>
>>>>> Is there some other "and more" I missed?
>>>>
>>>> I'm about to submit a patch series to support the new SNP_GET_TPM_INFO
>>>> guest request, which would be obtained via the SEV guest driver. So, yes,
>>>> there is more.
>>>
>>> From the docs this looks like perfectly fine attestation evidence. It
>>> is a blob signed by the ROT after all.
>>>
>>> Returning it to userspace should definately flow through attestation
>>> subsystem (even tsm_report can do it, I think?) not AMD private
>>> ioctls.. It is exactly why we are investing so much to build a common
>>> cross-vendor framework that works for everything.
>>
>> So something like /sys/kernel/config/tsm/report/tpmblob? Both outblob and
>> tpmblob take a nonce, so would we want to use the same inblob or a
>> different file?
>
> I would imagine you use one of the mechanisms to change the outblob?
> It is a signed report so it should go that way as a single request
> with dedicated inblob sequence to specify the nonce.
>
> eg you could give it a GUID and run it through the GUID mechanism.
Currently the service_provider is used to route between a direct guest
request and an SVSM-based guest request, so the same mechanism could be
used to add a route for the TPM request.
>
> With the new uAPI it will be cleaner..
>
>> Or would it be better to be a separate configfs directory, e.g.
>> /sys/kernel/config/tsm/tpm-report, with inblob and outblob for consistency?
>>
>> Does TDX or CCA having anything similar for a pTPM binding?
>
> I have not seen anyone do pROT binding into VMs yet. I'm aware of
> conversations but nothing concrete. Usually people are interested in a
> quote from the pROT, not just a binding. Is that where you are going
> too?
>
> What is the use case to share the pTPM's EK to the guest without any
> further interaction to the pTPM?
My understanding of it is based on section 3.8 of the SNP 1.59 ABI. Given
that, having it be part of the current /sys/kernel/config/tsm/report/
seems to make sense.
I can delay my series until this lands to build on the new file location.
>
> If you imagine further pTPM interaction then maybe this should be its
> own guest attestation driver to represent the pTPM.
There is nothing further that I'm aware of.
Thanks,
Tom
>
> Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 16:19 ` Dave Jiang
2026-12-01 16:30 ` Jason Gunthorpe
@ 2026-12-01 17:44 ` Edgecombe, Rick P
2026-12-01 17:57 ` Jason Gunthorpe
1 sibling, 1 reply; 21+ messages in thread
From: Edgecombe, Rick P @ 2026-12-01 17:44 UTC (permalink / raw)
To: corbet@lwn.net, linux-coco@lists.linux.dev, kvm@vger.kernel.org,
shuah@kernel.org, dave.hansen@linux.intel.com, kas@kernel.org,
mingo@redhat.com, rdunlap@infradead.org, Jiang, Dave,
jgg@nvidia.com, aneesh.kumar@kernel.org,
linux-doc@vger.kernel.org, hpa@zytor.com, lukas@wunner.de,
tglx@kernel.org, bp@alien8.de, skhan@linuxfoundation.org,
aik@amd.com, linux-kselftest@vger.kernel.org, x86@kernel.org
Cc: patches@lists.linux.dev, jiri@resnulli.us, yeoreum.yun@arm.com
On Tue, 2026-12-01 at 09:19 -0700, Dave Jiang wrote:
> > +config ATTESTATION_INTEL_TDX_GUEST
> > + tristate "Intel TDX Guest Attestation Driver"
> > + depends on INTEL_TDX_GUEST
> > + help
> > + Driver for the TDX guest signed quote from the Root of Trust
> > inside
> > + the TDX module for confidential VMs. The quote includes 4
> > measurement
> > + registers.
>
> Unlike the RMM and the PSP, the TDX module doesn't sign anything. It produces
> the TD report, and the TD Quoting Enclave (QE) on the host signs it into a
> quote, which the guest gets through the GetQuote hypercall. See the
> Attestation section of Documentation/arch/x86/tdx.rst.
This is changing with DICE based attestation though. The TDX module will do the
signing.
>
> Also looking at tsm_mrs[], it looks to expose 8 measurement registers.
>
> How about something like this?
>
> Driver for TDX guest attestation. The TDX module produces a TD
> report, and the host's TD Quoting Enclave signs it into a quote
> through the GetQuote hypercall. The report carries MRTD,
> RTMR0-RTMR3, MRCONFIGID, MROWNER and MROWNERCONFIG.
Let's make it more generic. Especially since from the guest perspective, it
doesn't know what is doing the signing. It is just makes a hypercall to the host
which can direct the signing to the location of it's choosing. How about
Driver for the TDX guest signed quote from the Root of Trust of the
TDX platform for confidential VMs. The quote includes 4 measurement
registers.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
2026-12-01 17:33 ` Tom Lendacky
@ 2026-12-01 17:53 ` Jason Gunthorpe
0 siblings, 0 replies; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 17:53 UTC (permalink / raw)
To: Tom Lendacky
Cc: Borislav Petkov, Michael Roth, Alexey Kardashevskiy,
Aneesh Kumar K.V, Jonathan Corbet, Dave Hansen, H. Peter Anvin,
Kiryl Shutsemau, kvm, linux-coco, linux-doc, linux-kselftest,
Lukas Wunner, Ingo Molnar, Randy Dunlap, Rick Edgecombe,
Shuah Khan, Shuah Khan, Thomas Gleixner, x86, Jiri Pirko, patches,
Yeoreum Yun
On Tue, Dec 01, 2026 at 11:33:10AM -0600, Tom Lendacky wrote:
> > eg you could give it a GUID and run it through the GUID mechanism.
>
> Currently the service_provider is used to route between a direct guest
> request and an SVSM-based guest request, so the same mechanism could be
> used to add a route for the TPM request.
Yeah that seems like a good thing to try to me.
> > What is the use case to share the pTPM's EK to the guest without any
> > further interaction to the pTPM?
>
> My understanding of it is based on section 3.8 of the SNP 1.59 ABI. Given
> that, having it be part of the current /sys/kernel/config/tsm/report/
> seems to make sense.
That section is pretty clear and is more like what I imagined:
The relying party receives the following objects:
* SEV attestation key certificate chain
* Guest attestation report
* TPM EK certificate chain
* TPM attestation key (AK) blob
* TPM quote
* TPM binding object (TPM_INFO structure. See Table
So tell me where they all come out of the uapi on the guest?
I think it should be
sev-guest attestation driver (this patch)
1: evidence-get(amd-certificates)
2: evidence-get(amd-guest-report)
6: evidence-get(amd-tpm-info)
amd-guest-ptpm attestation driver:
3: evidence-get(tpm ek)
4: evidence-get(tpm ak)
5: evidence-get(tpm signed quote)
This latter one should mirror how the eventual TPM/attestation adaptor
will look.
Alternatively you skip #6 as part of the uAPI and instead kernel
ensures #3 is authentic internally then userspace trusts it. Most of
our guest/host tamper preventions are kept invisible to userspace.
I also think this is perhaps incomplete as a TPM quote without any of
the PCR logs is of highly questionable utility.
In any case don't half implement a feature, you need to show how all
of this works together, including the host to guest API for items 3-5.
I think you will have a much easier time to build it on top of Jiri's
new uapi than trying to squeeze all of this into tsm_report. I'm not
that excited about new creative tsm_report users at this point...
And all of section 3.8 is unambiguously attestation related..
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 17:44 ` Edgecombe, Rick P
@ 2026-12-01 17:57 ` Jason Gunthorpe
0 siblings, 0 replies; 21+ messages in thread
From: Jason Gunthorpe @ 2026-12-01 17:57 UTC (permalink / raw)
To: Edgecombe, Rick P
Cc: corbet@lwn.net, linux-coco@lists.linux.dev, kvm@vger.kernel.org,
shuah@kernel.org, dave.hansen@linux.intel.com, kas@kernel.org,
mingo@redhat.com, rdunlap@infradead.org, Jiang, Dave,
aneesh.kumar@kernel.org, linux-doc@vger.kernel.org, hpa@zytor.com,
lukas@wunner.de, tglx@kernel.org, bp@alien8.de,
skhan@linuxfoundation.org, aik@amd.com,
linux-kselftest@vger.kernel.org, x86@kernel.org,
patches@lists.linux.dev, jiri@resnulli.us, yeoreum.yun@arm.com
On Tue, Dec 01, 2026 at 05:44:57PM +0000, Edgecombe, Rick P wrote:
> > How about something like this?
> >
> > Driver for TDX guest attestation. The TDX module produces a TD
> > report, and the host's TD Quoting Enclave signs it into a quote
> > through the GetQuote hypercall. The report carries MRTD,
> > RTMR0-RTMR3, MRCONFIGID, MROWNER and MROWNERCONFIG.
>
> Let's make it more generic. Especially since from the guest perspective, it
> doesn't know what is doing the signing. It is just makes a hypercall to the host
> which can direct the signing to the location of it's choosing. How about
>
> Driver for the TDX guest signed quote from the Root of Trust of the
> TDX platform for confidential VMs. The quote includes 4 measurement
> registers.
Yeah, that feels about the right level of detail to me. I tweaked it slightly:
config ATTESTATION_INTEL_TDX_GUEST
tristate "Intel TDX Guest Attestation Driver"
depends on INTEL_TDX_GUEST
help
Driver for the TDX guest signed evidence from the Root of Trust of the
TDX platform for confidential VMs. The quote includes 4 extendable
measurement registers.
Reports are available in user-created directories under
/sys/kernel/config/tsm/report/ with provider "tdx_guest".
Measurement registers are exposed under
/sys/devices/virtual/misc/tdx_guest/measurements/.
Thanks,
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver
2026-12-01 16:30 ` Jason Gunthorpe
@ 2026-12-01 17:58 ` Dave Jiang
0 siblings, 0 replies; 21+ messages in thread
From: Dave Jiang @ 2026-12-01 17:58 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Alexey Kardashevskiy, Aneesh Kumar K.V, Borislav Petkov,
Jonathan Corbet, Dave Hansen, H. Peter Anvin, Kiryl Shutsemau,
kvm, linux-coco, linux-doc, linux-kselftest, Lukas Wunner,
Ingo Molnar, Randy Dunlap, Rick Edgecombe, Shuah Khan, Shuah Khan,
Thomas Gleixner, x86, Jiri Pirko, patches, Yeoreum Yun
On 12/1/26 9:30 AM, Jason Gunthorpe wrote:
> On Tue, Dec 01, 2026 at 09:19:47AM -0700, Dave Jiang wrote:
>>> +# SPDX-License-Identifier: GPL-2.0-only
>>> +config ATTESTATION_INTEL_TDX_GUEST
>>> + tristate "Intel TDX Guest Attestation Driver"
>>> + depends on INTEL_TDX_GUEST
>>> + help
>>> + Driver for the TDX guest signed quote from the Root of Trust inside
>>> + the TDX module for confidential VMs. The quote includes 4 measurement
>>> + registers.
>>
>> Unlike the RMM and the PSP, the TDX module doesn't sign anything. It
>> produces the TD report, and the TD Quoting Enclave (QE) on the host
>> signs it into a quote, which the guest gets through the GetQuote
>> hypercall. See the Attestation section of
>> Documentation/arch/x86/tdx.rst.
>
> Yeah, but from this perspective these complications are all invisible
> and hidden in the driver. It doesn't matter that there is the
> complicated dance, at the end of the day TDX module is fully in
> control of the data that is signed by the platform. That is no
> different from any other CC VM ROT.
>
>> Also looking at tsm_mrs[], it looks to expose 8 measurement registers.
>
> I was only thinking of the mutable ones as measurement registers, but
> right, the non-mutable ones are there too. ARM also has non-mutable
> ones.
>
>> How about something like this?
>>
>> Driver for TDX guest attestation. The TDX module produces a TD
>> report, and the host's TD Quoting Enclave signs it into a quote
>> through the GetQuote hypercall. The report carries MRTD,
>> RTMR0-RTMR3, MRCONFIGID, MROWNER and MROWNERCONFIG.
>
> Can we simplify the first part: "The TDX module produces evidence
> signed by the platform" ?
Yup. Also Rick has pointed out that with the new DICE based scheme it should be same as other vendors. So simplified will do.
DJ
>
> To keep the language in line with the proposed uAPI?
>
> Thanks,
> Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2026-12-01 17:58 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 0:52 [PATCH tsm 0/4] Start building drivers/attestation Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 1/4] attestation: Start the new subsystem using tsm_report and mr Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 2/4] attestation: Move the ARM Realm Token tsm_report driver Jason Gunthorpe
2026-12-01 5:25 ` Aneesh Kumar K.V
2026-12-01 13:03 ` Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
2026-12-01 16:19 ` Dave Jiang
2026-12-01 16:30 ` Jason Gunthorpe
2026-12-01 17:58 ` Dave Jiang
2026-12-01 17:44 ` Edgecombe, Rick P
2026-12-01 17:57 ` Jason Gunthorpe
2026-12-01 0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
2026-12-01 3:05 ` Borislav Petkov
2026-12-01 13:07 ` Jason Gunthorpe
2026-12-01 15:46 ` Tom Lendacky
2026-12-01 16:20 ` Jason Gunthorpe
2026-12-01 16:38 ` Tom Lendacky
2026-12-01 17:11 ` Jason Gunthorpe
2026-12-01 17:33 ` Tom Lendacky
2026-12-01 17:53 ` Jason Gunthorpe
2026-12-01 14:32 ` [PATCH tsm 0/4] Start building drivers/attestation Jiri Pirko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox