From: Dan Williams <dan.j.williams@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
"Li, Ming" <ming4.li@intel.com>
Cc: <ira.weiny@intel.com>, Dan Williams <dan.j.williams@intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
Bjorn Helgaas <helgaas@kernel.org>,
"Matthew Wilcox" <willy@infradead.org>,
Lukas Wunner <lukas@wunner.de>,
"Alison Schofield" <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Ben Widawsky <bwidawsk@kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
<linux-pci@vger.kernel.org>
Subject: Re: [PATCH V16 3/6] PCI/DOE: Add DOE mailbox support functions
Date: Mon, 15 Aug 2022 15:42:57 -0700 [thread overview]
Message-ID: <62facbf166698_dfbc1294ad@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20220815105038.00000336@huawei.com>
Jonathan Cameron wrote:
> On Mon, 15 Aug 2022 10:17:00 +0800
> "Li, Ming" <ming4.li@intel.com> wrote:
>
> > On 7/20/2022 4:52 AM, ira.weiny@intel.com wrote:
> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > >
> > > Introduced in a PCIe r6.0, sec 6.30, DOE provides a config space based
> > > mailbox with standard protocol discovery. Each mailbox is accessed
> > > through a DOE Extended Capability.
> > >
> > > Each DOE mailbox must support the DOE discovery protocol in addition to
> > > any number of additional protocols.
> > >
> > > Define core PCIe functionality to manage a single PCIe DOE mailbox at a
> > > defined config space offset. Functionality includes iterating,
> > > creating, query of supported protocol, and task submission. Destruction
> > > of the mailboxes is device managed.
> > >
> > > Cc: "Li, Ming" <ming4.li@intel.com>
> > > Cc: Bjorn Helgaas <helgaas@kernel.org>
> > > Cc: Matthew Wilcox <willy@infradead.org>
> > > Acked-by: Bjorn Helgaas <helgaas@kernel.org>
> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > Co-developed-by: Ira Weiny <ira.weiny@intel.com>
> > > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > >
> > > ---
> >
> > > +/**
> > > + * pci_doe_submit_task() - Submit a task to be processed by the state machine
> > > + *
> > > + * @doe_mb: DOE mailbox capability to submit to
> > > + * @task: task to be queued
> > > + *
> > > + * Submit a DOE task (request/response) to the DOE mailbox to be processed.
> > > + * Returns upon queueing the task object. If the queue is full this function
> > > + * will sleep until there is room in the queue.
> > > + *
> > > + * task->complete will be called when the state machine is done processing this
> > > + * task.
> > > + *
> > > + * Excess data will be discarded.
> > > + *
> > > + * RETURNS: 0 when task has been successfully queued, -ERRNO on error
> > > + */
> > > +int pci_doe_submit_task(struct pci_doe_mb *doe_mb, struct pci_doe_task *task)
> > > +{
> > > + if (!pci_doe_supports_prot(doe_mb, task->prot.vid, task->prot.type))
> > > + return -EINVAL;
> > > +
> > > + /*
> > > + * DOE requests must be a whole number of DW and the response needs to
> > > + * be big enough for at least 1 DW
> > > + */
> > > + if (task->request_pl_sz % sizeof(u32) ||
> > > + task->response_pl_sz < sizeof(u32))
> > > + return -EINVAL;
> > > +
> > > + if (test_bit(PCI_DOE_FLAG_DEAD, &doe_mb->flags))
> > > + return -EIO;
> > > +
> > > + task->doe_mb = doe_mb;
> > > + INIT_WORK(&task->work, doe_statemachine_work);
> > > + queue_work(doe_mb->work_queue, &task->work);
> > > + return 0;
> > > +}
> > > +EXPORT_SYMBOL_GPL(pci_doe_submit_task);
> >
>
> > I'm curious why there is not a sychronous function for DOE users. I
> > think some protocols over DOE need a DOE sychrounous interface(e.g.
> > SPDM, TDISP, IDE...). These protocols have to implement an sychronous
> > function over pci_doe_submit_task() by themselves, maybe we can
> > implement an generic sychronous function in PCI/DOE for these DOE
> > users.
>
> This came up during discussions of earlier versions of the series.
> IIRC we decided to postpone adding a synchronous wrapper function
> until there were more use cases.
Note that as far as I can see TDISP makes no requirement of the VMM nor
TVM (trusted VM) to drive an SPDM session. All of that is handled by the
TSM (TEE / Platform Security Manager) where the VMM is outside the trust
boundary. The TVM only validates the contents of a
GET_DEVICE_INTERFACE_REPORT which the TSM had negotiated with the DSM
(Device Security Manager).
All this to say its not clear that Linux needs to grow the capabilities
listed above when it is expected to be outside the Trusted Compute
Boundary.
next prev parent reply other threads:[~2022-08-16 2:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 20:52 [PATCH V16 0/6] CXL: Read CDAT ira.weiny
2022-07-19 20:52 ` [PATCH V16 1/6] PCI: Add vendor ID for the PCI SIG ira.weiny
2022-07-19 20:52 ` [PATCH V16 2/6] PCI: Replace magic constant for PCI Sig Vendor ID ira.weiny
2022-07-19 20:52 ` [PATCH V16 3/6] PCI/DOE: Add DOE mailbox support functions ira.weiny
2022-08-15 2:17 ` Li, Ming
2022-08-15 9:50 ` Jonathan Cameron
2022-08-15 22:42 ` Dan Williams [this message]
2022-10-25 11:03 ` Jonathan Cameron
2022-07-19 20:52 ` [PATCH V16 4/6] cxl/pci: Create PCI DOE mailbox's for memory devices ira.weiny
2022-07-19 22:16 ` Bjorn Helgaas
2022-07-19 20:52 ` [PATCH V16 5/6] driver-core: Introduce BIN_ATTR_ADMIN_{RO,RW} ira.weiny
2022-07-19 20:52 ` [PATCH V16 6/6] cxl/port: Read CDAT table ira.weiny
2022-07-19 22:57 ` [PATCH V16 0/6] CXL: Read CDAT Dan Williams
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=62facbf166698_dfbc1294ad@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bhelgaas@google.com \
--cc=bwidawsk@kernel.org \
--cc=dave.jiang@intel.com \
--cc=helgaas@kernel.org \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=ming4.li@intel.com \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
/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