Linux Documentation
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alexey Kardashevskiy <aik@amd.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Borislav Petkov <bp@alien8.de>, Jonathan Corbet <corbet@lwn.net>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Kiryl Shutsemau <kas@kernel.org>,
	kvm@vger.kernel.org, linux-coco@lists.linux.dev,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Lukas Wunner <lukas@wunner.de>, Ingo Molnar <mingo@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	Shuah Khan <shuah@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org
Cc: Jiri Pirko <jiri@resnulli.us>,
	patches@lists.linux.dev, Yeoreum Yun <yeoreum.yun@arm.com>
Subject: [PATCH tsm 4/4] attestation: Move AMD SEV Guest tsm_report driver
Date: Mon, 30 Nov 2026 20:52:24 -0400	[thread overview]
Message-ID: <4-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com> (raw)
In-Reply-To: <0-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com>

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


      parent reply	other threads:[~2026-12-01  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aik@amd.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jiri@resnulli.us \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mingo@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=rdunlap@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yeoreum.yun@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox