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 Signed-off-by: Jason Gunthorpe --- 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