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 2/4] attestation: Move the ARM Realm Token tsm_report driver
Date: Mon, 30 Nov 2026 20:52:22 -0400 [thread overview]
Message-ID: <2-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com> (raw)
In-Reply-To: <0-v1-56c8df81fd64+16c-att_start_jgg@nvidia.com>
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
next prev parent reply other threads:[~2026-12-01 0:52 UTC|newest]
Thread overview: 6+ 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 ` Jason Gunthorpe [this message]
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
2026-12-01 1:00 ` sashiko-bot
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=2-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