From: Zhi Wang <zhiw@nvidia.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: <linux-coco@lists.linux.dev>, Bjorn Helgaas <bhelgaas@google.com>,
"Lukas Wunner" <lukas@wunner.de>,
Samuel Ortiz <sameo@rivosinc.com>,
"Alexey Kardashevskiy" <aik@amd.com>,
Xu Yilun <yilun.xu@linux.intel.com>, <gregkh@linuxfoundation.org>,
<linux-pci@vger.kernel.org>
Subject: Re: [PATCH v2 06/11] samples/devsec: Introduce a PCI device-security bus + endpoint sample
Date: Tue, 13 May 2025 13:18:33 +0300 [thread overview]
Message-ID: <20250513131833.522596cd.zhiw@nvidia.com> (raw)
In-Reply-To: <174107249038.1288555.12362100502109498455.stgit@dwillia2-xfh.jf.intel.com>
On Mon, 03 Mar 2025 23:14:50 -0800
Dan Williams <dan.j.williams@intel.com> wrote:
> Establish just enough emulated PCI infrastructure to register a sample
> TSM (platform security manager) driver and have it discover an IDE +
> TEE (link encryption + device-interface security protocol (TDISP))
> capable device.
>
...
> +
> +static int devsec_tsm_connect(struct pci_dev *pdev)
> +{
It might be helpful to put some comments here to describe the expected
common vendor-agnostic sequences from the perspective of TSM driver in
generic style. Guess it would be helpful for vendors to evaluate how to
fit there TSM drivers into these paths.
E.g. create device context, loops of sending SPDM messages of device
connect... The same in devsec_tsm_disconnect().
> + return -ENXIO;
> +}
> +
> +static void devsec_tsm_disconnect(struct pci_dev *pdev)
> +{
> +}
> +
It would be nice to have TDI bind/unbind verbs included.
> +static const struct pci_tsm_ops devsec_pci_ops = {
> + .probe = devsec_tsm_pci_probe,
> + .remove = devsec_tsm_pci_remove,
> + .connect = devsec_tsm_connect,
> + .disconnect = devsec_tsm_disconnect,
> +};
> +
> +static void devsec_tsm_remove(void *tsm_core)
> +{
> + tsm_unregister(tsm_core);
> +}
> +
> +static int devsec_tsm_probe(struct platform_device *pdev)
> +{
> + struct tsm_core_dev *tsm_core;
> +
> + tsm_core = tsm_register(&pdev->dev, NULL, &devsec_pci_ops);
> + if (IS_ERR(tsm_core))
> + return PTR_ERR(tsm_core);
> +
> + return devm_add_action_or_reset(&pdev->dev,
> devsec_tsm_remove,
> + tsm_core);
> +}
> +
> +static struct platform_driver devsec_tsm_driver = {
> + .driver = {
> + .name = "devsec_tsm",
> + },
> +};
> +
> +static struct platform_device *devsec_tsm;
> +
> +static int __init devsec_tsm_init(void)
> +{
> + struct platform_device_info devsec_tsm_info = {
> + .name = "devsec_tsm",
> + .id = -1,
> + };
> + int rc;
> +
> + devsec_tsm = platform_device_register_full(&devsec_tsm_info);
> + if (IS_ERR(devsec_tsm))
> + return PTR_ERR(devsec_tsm);
> +
> + rc = platform_driver_probe(&devsec_tsm_driver,
> devsec_tsm_probe);
> + if (rc)
> + platform_device_unregister(devsec_tsm);
> + return rc;
> +}
> +module_init(devsec_tsm_init);
> +
> +static void __exit devsec_tsm_exit(void)
> +{
> + platform_driver_unregister(&devsec_tsm_driver);
> + platform_device_unregister(devsec_tsm);
> +}
> +module_exit(devsec_tsm_exit);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("Device Security Sample Infrastructure: Platform
> TSM Driver");
>
>
next prev parent reply other threads:[~2025-05-13 10:18 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 7:14 [PATCH v2 00/11] PCI/TSM: Core infrastructure for PCI device security (TDISP) Dan Williams
2025-03-04 7:14 ` [PATCH v2 01/11] configfs-tsm: Namespace TSM report symbols Dan Williams
2025-03-05 10:11 ` Steven Price
2025-03-10 16:26 ` Sathyanarayanan Kuppuswamy
2025-03-10 22:19 ` Huang, Kai
2025-03-04 7:14 ` [PATCH v2 02/11] coco/guest: Move shared guest CC infrastructure to drivers/virt/coco/guest/ Dan Williams
2025-03-10 16:26 ` Sathyanarayanan Kuppuswamy
2025-03-10 22:57 ` Huang, Kai
2025-04-18 23:28 ` Dan Williams
2025-03-04 7:14 ` [PATCH v2 03/11] coco/tsm: Introduce a core device for TEE Security Managers Dan Williams
2025-03-04 7:14 ` [PATCH v2 04/11] PCI/IDE: Enumerate Selective Stream IDE capabilities Dan Williams
2025-03-11 5:46 ` Aneesh Kumar K.V
2025-03-11 6:33 ` Alexey Kardashevskiy
2025-04-25 21:03 ` Dan Williams
2025-03-04 7:14 ` [PATCH v2 05/11] PCI/TSM: Authenticate devices via platform TSM Dan Williams
2025-04-16 5:33 ` Aneesh Kumar K.V
2025-04-25 22:51 ` Dan Williams
2025-03-04 7:14 ` [PATCH v2 06/11] samples/devsec: Introduce a PCI device-security bus + endpoint sample Dan Williams
2025-03-11 14:17 ` [PATCH v2 06/11] samples/devsec: Introduce a PCI device-security Suzuki K Poulose
2025-03-11 14:45 ` [RESEND RFC PATCH 1/3] pci: ide: Fix build failure Suzuki K Poulose
2025-03-11 14:46 ` [RESEND RFC PATCH 2/3] pci: generic-domains: Add helpers to alloc/free dynamic bus numbers Suzuki K Poulose
2025-03-11 14:46 ` [RESEND RFC PATCH 3/3] samples: devsec: Add support for PCI_DOMAINS_GENERIC Suzuki K Poulose
2025-04-20 18:29 ` Dan Williams
2025-04-22 15:45 ` Suzuki K Poulose
2025-04-24 12:39 ` [tip: irq/urgent] irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode() tip-bot2 for Suzuki K Poulose
2025-04-24 13:01 ` tip-bot2 for Suzuki K Poulose
2025-05-13 10:18 ` Zhi Wang [this message]
2025-03-04 7:14 ` [PATCH v2 07/11] PCI: Add PCIe Device 3 Extended Capability enumeration Dan Williams
2025-03-04 7:15 ` [PATCH v2 08/11] PCI/IDE: Add IDE establishment helpers Dan Williams
2025-03-04 20:44 ` kernel test robot
2025-03-05 12:32 ` kernel test robot
2025-03-11 10:51 ` Suzuki K Poulose
2025-04-19 17:50 ` Dan Williams
2025-03-18 3:18 ` Alexey Kardashevskiy
2025-04-25 21:42 ` Dan Williams
2025-04-21 6:13 ` Aneesh Kumar K.V
2025-04-25 16:29 ` Xu Yilun
2025-04-25 23:31 ` Dan Williams
2025-04-27 9:33 ` Aneesh Kumar K.V
2025-03-04 7:15 ` [PATCH v2 09/11] PCI/IDE: Report available IDE streams Dan Williams
2025-03-04 13:49 ` kernel test robot
2025-03-04 16:54 ` Dionna Amalie Glaze
2025-04-25 20:42 ` Dan Williams
2025-03-04 7:15 ` [PATCH v2 10/11] PCI/TSM: Report active " Dan Williams
2025-03-04 7:15 ` [PATCH v2 11/11] samples/devsec: Add sample IDE establishment Dan Williams
2025-05-07 10:47 ` [PATCH v2 00/11] PCI/TSM: Core infrastructure for PCI device security (TDISP) Zhi Wang
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=20250513131833.522596cd.zhiw@nvidia.com \
--to=zhiw@nvidia.com \
--cc=aik@amd.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=sameo@rivosinc.com \
--cc=yilun.xu@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.