Linux Confidential Computing Development
 help / color / mirror / Atom feed
* [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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ 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] 5+ 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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ 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] 5+ 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  0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
  2026-12-01  0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
  3 siblings, 0 replies; 5+ 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] 5+ 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  0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe
  3 siblings, 0 replies; 5+ 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] 5+ 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
  3 siblings, 0 replies; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2026-12-01  0:52 UTC | newest]

Thread overview: 5+ 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  0:52 ` [PATCH tsm 3/4] attestation: Move Intel TDX Guest tsm_report and mr driver Jason Gunthorpe
2026-12-01  0:52 ` [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox