* [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository
@ 2026-11-16 7:54 Aneesh Kumar K.V (Arm)
2026-11-16 7:54 ` [PATCH 2/2] PCI/TSM: Move core code into its own directory Aneesh Kumar K.V (Arm)
2026-11-18 8:44 ` [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Alexey Kardashevskiy
0 siblings, 2 replies; 11+ messages in thread
From: Aneesh Kumar K.V (Arm) @ 2026-11-16 7:54 UTC (permalink / raw)
To: linux-coco
Cc: Aneesh Kumar K.V (Arm), Alexey Kardashevskiy, Jason Gunthorpe,
Lukas Wunner
Add drivers/virt/coco/tsm-core.c and git repository to the TSM entry.
Cc: Alexey Kardashevskiy <aik@amd.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: linux-coco@lists.linux.dev
Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index ccbcdc0799b9..720fe907885b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -28545,11 +28545,13 @@ M: Jason Gunthorpe <jgg@nvidia.com>
R: Lukas Wunner <lukas@wunner.de>
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/pci/tsm.rst
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/
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 7:54 [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Aneesh Kumar K.V (Arm)
@ 2026-11-16 7:54 ` Aneesh Kumar K.V (Arm)
2026-11-16 13:00 ` Jason Gunthorpe
2026-11-18 8:44 ` [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Alexey Kardashevskiy
1 sibling, 1 reply; 11+ messages in thread
From: Aneesh Kumar K.V (Arm) @ 2026-11-16 7:54 UTC (permalink / raw)
To: linux-coco
Cc: Aneesh Kumar K.V (Arm), Alexey Kardashevskiy, Jason Gunthorpe,
Lukas Wunner, Jason Gunthorpe, Bjorn Helgaas, linux-pci
Multiple patch series modify drivers/pci/tsm.c, and some add new files
to the PCI/TSM subsystem. Move tsm.c to tsm/core.c so these series can
share the directory layout and reduce merge conflicts.
Update the build rules, local header include, and MAINTAINERS entry for
the new location.
No functional change.
Cc: Alexey Kardashevskiy <aik@amd.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-coco@lists.linux.dev
Cc: linux-pci@vger.kernel.org
Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
---
Documentation/driver-api/pci/tsm.rst | 2 +-
MAINTAINERS | 2 +-
drivers/pci/Makefile | 2 +-
drivers/pci/tsm/Makefile | 7 +++++++
drivers/pci/{tsm.c => tsm/core.c} | 2 +-
5 files changed, 11 insertions(+), 4 deletions(-)
create mode 100644 drivers/pci/tsm/Makefile
rename drivers/pci/{tsm.c => tsm/core.c} (99%)
diff --git a/Documentation/driver-api/pci/tsm.rst b/Documentation/driver-api/pci/tsm.rst
index 232b92bec93f..c95c513019b5 100644
--- a/Documentation/driver-api/pci/tsm.rst
+++ b/Documentation/driver-api/pci/tsm.rst
@@ -17,5 +17,5 @@ Subsystem Interfaces
.. kernel-doc:: include/linux/pci-tsm.h
:internal:
-.. kernel-doc:: drivers/pci/tsm.c
+.. kernel-doc:: drivers/pci/tsm/core.c
:export:
diff --git a/MAINTAINERS b/MAINTAINERS
index 720fe907885b..3e626e45d432 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -28549,7 +28549,7 @@ 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/pci/tsm.rst
-F: drivers/pci/tsm.c
+F: drivers/pci/tsm/
F: drivers/virt/coco/guest/
F: drivers/virt/coco/tsm-core.c
F: include/linux/*tsm*.h
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 41ebc3b9a518..211f195ff2c9 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -35,7 +35,7 @@ obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
obj-$(CONFIG_VGA_ARB) += vgaarb.o
obj-$(CONFIG_PCI_DOE) += doe.o
obj-$(CONFIG_PCI_IDE) += ide.o
-obj-$(CONFIG_PCI_TSM) += tsm.o
+obj-$(CONFIG_PCI_TSM) += tsm/
obj-$(CONFIG_PCI_DYNAMIC_OF_NODES) += of_property.o
obj-$(CONFIG_PCI_NPEM) += npem.o
obj-$(CONFIG_PCIE_TPH) += tph.o
diff --git a/drivers/pci/tsm/Makefile b/drivers/pci/tsm/Makefile
new file mode 100644
index 000000000000..464414c11a72
--- /dev/null
+++ b/drivers/pci/tsm/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for the PCI/TSM infrastructure
+
+obj-$(CONFIG_PCI_TSM) += tsm.o
+
+tsm-y := core.o
diff --git a/drivers/pci/tsm.c b/drivers/pci/tsm/core.c
similarity index 99%
rename from drivers/pci/tsm.c
rename to drivers/pci/tsm/core.c
index 5fdcd7f2e820..76ef03a1b3ec 100644
--- a/drivers/pci/tsm.c
+++ b/drivers/pci/tsm/core.c
@@ -15,7 +15,7 @@
#include <linux/sysfs.h>
#include <linux/tsm.h>
#include <linux/xarray.h>
-#include "pci.h"
+#include "../pci.h"
/*
* Provide a read/write lock against the init / exit of pdev tsm
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 7:54 ` [PATCH 2/2] PCI/TSM: Move core code into its own directory Aneesh Kumar K.V (Arm)
@ 2026-11-16 13:00 ` Jason Gunthorpe
2026-11-16 13:15 ` Aneesh Kumar K.V
0 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2026-11-16 13:00 UTC (permalink / raw)
To: Aneesh Kumar K.V (Arm)
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
On Mon, Nov 16, 2026 at 01:24:20PM +0530, Aneesh Kumar K.V (Arm) wrote:
> diff --git a/drivers/pci/tsm.c b/drivers/pci/tsm/core.c
> similarity index 99%
> rename from drivers/pci/tsm.c
> rename to drivers/pci/tsm/core.c
What's the point of a subdirectory if there is onle one file?
If you were to move it to drivers/virt/coco/tsm-pci.c or something
that would be more interesting..
I think we are going to delete most of this file, right?
I'm also seriously wondering if adding sysfs to pci devices is even a
good idea. If there is only one left we can just not do that. Then we
don't need most of the file..
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 13:00 ` Jason Gunthorpe
@ 2026-11-16 13:15 ` Aneesh Kumar K.V
2026-11-16 13:19 ` Jason Gunthorpe
0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K.V @ 2026-11-16 13:15 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
Jason Gunthorpe <jgg@nvidia.com> writes:
> On Mon, Nov 16, 2026 at 01:24:20PM +0530, Aneesh Kumar K.V (Arm) wrote:
>> diff --git a/drivers/pci/tsm.c b/drivers/pci/tsm/core.c
>> similarity index 99%
>> rename from drivers/pci/tsm.c
>> rename to drivers/pci/tsm/core.c
>
> What's the point of a subdirectory if there is onle one file?
>
> If you were to move it to drivers/virt/coco/tsm-pci.c or something
> that would be more interesting..
>
> I think we are going to delete most of this file, right?
>
> I'm also seriously wondering if adding sysfs to pci devices is even a
> good idea. If there is only one left we can just not do that. Then we
> don't need most of the file..
>
The complete CCA patch series adds the following files:
attestation.c core.c ctlv_attestation_pci_gen.c ctlv_attestation_pci_gen.h internal.h Makefile spdm.c
The final implementation is spread across multiple series, and the
attestation series creates drivers/pci/tsm/. I suggested making that
split early to avoid conflicts while these series are being developed.
-aneesh
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 13:15 ` Aneesh Kumar K.V
@ 2026-11-16 13:19 ` Jason Gunthorpe
2026-11-16 14:34 ` Aneesh Kumar K.V
0 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2026-11-16 13:19 UTC (permalink / raw)
To: Aneesh Kumar K.V
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
On Mon, Nov 16, 2026 at 06:45:03PM +0530, Aneesh Kumar K.V wrote:
> The complete CCA patch series adds the following files:
>
> attestation.c core.c ctlv_attestation_pci_gen.c ctlv_attestation_pci_gen.h internal.h Makefile spdm.c
Why would any of this go under drivers/pci ?
The whole point here is to make an 'attestation subsystem', so that
all belongs under
drivers/attestation/
Send a series to move tsm-report.c and tsm-mr.c to drivers/attestation
to kick it off.
Then we can extract the AMD and Intel drivers
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 13:19 ` Jason Gunthorpe
@ 2026-11-16 14:34 ` Aneesh Kumar K.V
2026-11-16 14:42 ` Jason Gunthorpe
0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K.V @ 2026-11-16 14:34 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
Jason Gunthorpe <jgg@nvidia.com> writes:
> On Mon, Nov 16, 2026 at 06:45:03PM +0530, Aneesh Kumar K.V wrote:
>
>> The complete CCA patch series adds the following files:
>>
>> attestation.c core.c ctlv_attestation_pci_gen.c ctlv_attestation_pci_gen.h internal.h Makefile spdm.c
>
> Why would any of this go under drivers/pci ?
>
> The whole point here is to make an 'attestation subsystem', so that
> all belongs under
>
> drivers/attestation/
>
So the attestation evidence would be fetched via drivers/coco/tsm/ and
stored by drivers/pci/tsm.c:pci_tsm_evidence. I would expect
drivers/attestation/ to provide helpers, like other core kernel
components, allowing different subsystems to register as attestation
backends, with PCI/TSM being one of them.
If this is not how you foresee it working, we can defer this patch, and
I can carry it in my tree until the PCI attestation design is clear.
-aneesh
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 14:34 ` Aneesh Kumar K.V
@ 2026-11-16 14:42 ` Jason Gunthorpe
2026-11-18 7:40 ` Aneesh Kumar K.V
0 siblings, 1 reply; 11+ messages in thread
From: Jason Gunthorpe @ 2026-11-16 14:42 UTC (permalink / raw)
To: Aneesh Kumar K.V
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
On Mon, Nov 16, 2026 at 08:04:44PM +0530, Aneesh Kumar K.V wrote:
> Jason Gunthorpe <jgg@nvidia.com> writes:
>
> > On Mon, Nov 16, 2026 at 06:45:03PM +0530, Aneesh Kumar K.V wrote:
> >
> >> The complete CCA patch series adds the following files:
> >>
> >> attestation.c core.c ctlv_attestation_pci_gen.c ctlv_attestation_pci_gen.h internal.h Makefile spdm.c
> >
> > Why would any of this go under drivers/pci ?
> >
> > The whole point here is to make an 'attestation subsystem', so that
> > all belongs under
> >
> > drivers/attestation/
> >
>
> So the attestation evidence would be fetched via drivers/coco/tsm/
No.
The tsm code causes an attestation driver to start, it doesn't do any
attestation activties itself.
> and stored by drivers/pci/tsm.c:pci_tsm_evidence.
Why would we do that? Evidence is fetched, returned to userspace and
discarded by the kernel.
> I would expect drivers/attestation/ to provide helpers, like other
> core kernel components, allowing different subsystems to register as
> attestation backends, with PCI/TSM being one of them.
I expect the thing in drivers/attestation/ to provide the full end to
end driver. It calls the RMI/RSI/RHI's as directly as it can. Without
spreading stuff around all over the place.
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-16 14:42 ` Jason Gunthorpe
@ 2026-11-18 7:40 ` Aneesh Kumar K.V
2026-11-18 13:14 ` Jason Gunthorpe
0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K.V @ 2026-11-18 7:40 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
Jason Gunthorpe <jgg@nvidia.com> writes:
> On Mon, Nov 16, 2026 at 08:04:44PM +0530, Aneesh Kumar K.V wrote:
>> Jason Gunthorpe <jgg@nvidia.com> writes:
>>
>> > On Mon, Nov 16, 2026 at 06:45:03PM +0530, Aneesh Kumar K.V wrote:
>> >
>> >> The complete CCA patch series adds the following files:
>> >>
>> >> attestation.c core.c ctlv_attestation_pci_gen.c ctlv_attestation_pci_gen.h internal.h Makefile spdm.c
>> >
>> > Why would any of this go under drivers/pci ?
>> >
>> > The whole point here is to make an 'attestation subsystem', so that
>> > all belongs under
>> >
>> > drivers/attestation/
>> >
>>
>> So the attestation evidence would be fetched via drivers/coco/tsm/
>
> No.
>
> The tsm code causes an attestation driver to start, it doesn't do any
> attestation activties itself.
>
>> and stored by drivers/pci/tsm.c:pci_tsm_evidence.
>
> Why would we do that? Evidence is fetched, returned to userspace and
> discarded by the kernel.
>
>> I would expect drivers/attestation/ to provide helpers, like other
>> core kernel components, allowing different subsystems to register as
>> attestation backends, with PCI/TSM being one of them.
>
> I expect the thing in drivers/attestation/ to provide the full end to
> end driver. It calls the RMI/RSI/RHI's as directly as it can. Without
> spreading stuff around all over the place.
>
> Jason
I tried separating the CCA attestation driver from arm-cca-host in my
local tree. The main difficulty is coordinating locking and object
lifetimes with the existing PF0 and vDEVICE ownership rules.
PF0 owns the PDEV state and resources used for authentication and stream
activation. vDEVICE operations also depend on that PDEV, so a live
vDEVICE must keep PF0 and its resources alive. Restarting attestation
must not destroy a PDEV while active VDEVICEs still depend on it.
Placing the attestation backend in drivers/attestation/cca/ makes these
checks and locking requirements span two drivers. The attestation driver
calls PDEV_CREATE and PDEV_COMMUNICATE using the PDEV and communication
buffers owned by arm-cca-host. arm-cca-host uses the same PDEV to
connect streams and create vDEVICEs. The two drivers must therefore
coordinate access to these objects and their destruction.
My first attempt used pci_tsm_rwsem to serialize attestation operations.
That would require TSM callbacks for the attestation driver to acquire
and release the lock.
I also tried introducing an attestation_connection object with its own
mutex, reference count. Each vDEVICE then had to hold both its existing
PCI/TSM reference and a reference to this new object. The stream setup
still requires pci_tsm_rwsem, so this approach would also need callbacks
to acquire that lock before accepting evidence.
I am now considering implementing the CCA SPDM attestation ops directly
in arm-cca-host, similar to the viommu ops. The SPDM attestation ops
could then directly use PF0's PDEV, communication buffers, and existing
vDEVICE references. The same driver could prevent conflicting
PDEV/vDEVICE operations, and stop attestation commands before freeing
the associated resources.
-aneesh
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository
2026-11-16 7:54 [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Aneesh Kumar K.V (Arm)
2026-11-16 7:54 ` [PATCH 2/2] PCI/TSM: Move core code into its own directory Aneesh Kumar K.V (Arm)
@ 2026-11-18 8:44 ` Alexey Kardashevskiy
2026-11-18 12:55 ` Jason Gunthorpe
1 sibling, 1 reply; 11+ messages in thread
From: Alexey Kardashevskiy @ 2026-11-18 8:44 UTC (permalink / raw)
To: Aneesh Kumar K.V (Arm), linux-coco
Cc: Jason Gunthorpe, Lukas Wunner, Tom Lendacky, Herbert Xu,
David S. Miller
On 16/11/26 18:54, Aneesh Kumar K.V (Arm) wrote:
> Add drivers/virt/coco/tsm-core.c and git repository to the TSM entry.
>
> Cc: Alexey Kardashevskiy <aik@amd.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: linux-coco@lists.linux.dev
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
> ---
> MAINTAINERS | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ccbcdc0799b9..720fe907885b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -28545,11 +28545,13 @@ M: Jason Gunthorpe <jgg@nvidia.com>
> R: Lukas Wunner <lukas@wunner.de>
> 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/pci/tsm.rst
> 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/
I wonder if we can/should also do this now?
+F: drivers/crypto/ccp/sev-dev-tsm.c
+F: drivers/crypto/ccp/sev-dev-tio.*
Or move the files but where, drivers/attestation/tio? drivers/attestation/amd? And the same question for ARM/Intel. And do these drivers/attestation/* become modules? Thoughts? Thanks,
>
>
> base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
--
Alexey
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository
2026-11-18 8:44 ` [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Alexey Kardashevskiy
@ 2026-11-18 12:55 ` Jason Gunthorpe
0 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2026-11-18 12:55 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Aneesh Kumar K.V (Arm), linux-coco, Lukas Wunner, Tom Lendacky,
Herbert Xu, David S. Miller
On Wed, Nov 18, 2026 at 07:44:21PM +1100, Alexey Kardashevskiy wrote:
> On 16/11/26 18:54, Aneesh Kumar K.V (Arm) wrote:
> > Add drivers/virt/coco/tsm-core.c and git repository to the TSM entry.
> >
> > Cc: Alexey Kardashevskiy <aik@amd.com>
> > Cc: Jason Gunthorpe <jgg@nvidia.com>
> > Cc: Lukas Wunner <lukas@wunner.de>
> > Cc: linux-coco@lists.linux.dev
> > Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
> > ---
> > MAINTAINERS | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index ccbcdc0799b9..720fe907885b 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -28545,11 +28545,13 @@ M: Jason Gunthorpe <jgg@nvidia.com>
> > R: Lukas Wunner <lukas@wunner.de>
> > 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/pci/tsm.rst
> > 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/
>
>
> I wonder if we can/should also do this now?
>
> +F: drivers/crypto/ccp/sev-dev-tsm.c
> +F: drivers/crypto/ccp/sev-dev-tio.*
>
> Or move the files but where, drivers/attestation/tio?
> drivers/attestation/amd? And the same question for ARM/Intel. And do
> these drivers/attestation/* become modules? Thoughts? Thanks,
Some goes to drivers/attestation/amd and ideally they become modules
Some other goes to drivers/virt/coco/tsm/ I guess? I haven't thought
too much about that part yet.
But sure for now we should have those files too until we can move
them.
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] PCI/TSM: Move core code into its own directory
2026-11-18 7:40 ` Aneesh Kumar K.V
@ 2026-11-18 13:14 ` Jason Gunthorpe
0 siblings, 0 replies; 11+ messages in thread
From: Jason Gunthorpe @ 2026-11-18 13:14 UTC (permalink / raw)
To: Aneesh Kumar K.V
Cc: linux-coco, Alexey Kardashevskiy, Lukas Wunner, Bjorn Helgaas,
linux-pci
On Wed, Nov 18, 2026 at 01:10:56PM +0530, Aneesh Kumar K.V wrote:
> PF0 owns the PDEV state and resources used for authentication and stream
> activation. vDEVICE operations also depend on that PDEV, so a live
> vDEVICE must keep PF0 and its resources alive. Restarting attestation
> must not destroy a PDEV while active VDEVICEs still depend on it.
Yeah, you'll definately need some kind of "core" module that handles
these issues. Due to circular module dependencies it has to be
distinct from the tsm:
rmm_core
tsm_rmm_host
tsm_rmm_guest
attestation_rmm_host
attestation_rmm_guest
?
The module graph is
tsm_rmm_host -> rmm_core
-> attestation_rmm_host -> rmm_core
> Placing the attestation backend in drivers/attestation/cca/ makes these
> checks and locking requirements span two drivers. The attestation driver
> calls PDEV_CREATE and PDEV_COMMUNICATE using the PDEV and communication
> buffers owned by arm-cca-host. arm-cca-host uses the same PDEV to
> connect streams and create vDEVICEs. The two drivers must therefore
> coordinate access to these objects and their destruction.
>
> My first attempt used pci_tsm_rwsem to serialize attestation operations.
> That would require TSM callbacks for the attestation driver to acquire
> and release the lock.
Why callbacks? The TSM driver should create some kind of "pdev state"
when it attaches to the PCI device and link it into the pci world so
we can find this object from pci_dev.
The "pdev state" is an object managed by rmm_core, has a lock and a
refcounting scheme to ensure it cannot be destroyed out of order. It
would have information about the one and only vdev, if it exists, as
well.
The TSM driver triggers attestation creation and passes in the "pdev
state" pointer. Probably through an aux device scheme.
Now we have the necessary shared state between three modules to have
locks and some lifecycle rules, without any callbacks.
> I also tried introducing an attestation_connection object with its own
> mutex, reference count. Each vDEVICE then had to hold both its existing
> PCI/TSM reference and a reference to this new object. The stream setup
> still requires pci_tsm_rwsem, so this approach would also need callbacks
> to acquire that lock before accepting evidence.
Which stream setup do you mean? The device to host stream can be
locked by the pdev object.
The future P2P streams.. IDK how we even do uAPI for that, or cross
lock different PCI devices.
> I am now considering implementing the CCA SPDM attestation ops directly
> in arm-cca-host, similar to the viommu ops.
I really prefer we try to avoid this. At that point you may as well
give up and just implement one giant uber module.
I don't see that needing to get a lock on a pdev is so serious that we
should give up?
Jason
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-11-18 13:14 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 7:54 [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Aneesh Kumar K.V (Arm)
2026-11-16 7:54 ` [PATCH 2/2] PCI/TSM: Move core code into its own directory Aneesh Kumar K.V (Arm)
2026-11-16 13:00 ` Jason Gunthorpe
2026-11-16 13:15 ` Aneesh Kumar K.V
2026-11-16 13:19 ` Jason Gunthorpe
2026-11-16 14:34 ` Aneesh Kumar K.V
2026-11-16 14:42 ` Jason Gunthorpe
2026-11-18 7:40 ` Aneesh Kumar K.V
2026-11-18 13:14 ` Jason Gunthorpe
2026-11-18 8:44 ` [PATCH 1/2] MAINTAINERS: Update TSM file coverage and repository Alexey Kardashevskiy
2026-11-18 12:55 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox