From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>, linux-pci@vger.kernel.org
Cc: Gregory Price <gregory.price@memverge.com>,
Ira Weiny <ira.weiny@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Dan Williams <dan.j.williams@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
"Li, Ming" <ming4.li@intel.com>, Hillf Danton <hdanton@sina.com>,
Ben Widawsky <bwidawsk@kernel.org>,
linuxarm@huawei.com, linux-cxl@vger.kernel.org
Subject: [PATCH v3 00/16] Collection of DOE material
Date: Fri, 10 Feb 2023 21:25:00 +0100 [thread overview]
Message-ID: <cover.1676043318.git.lukas@wunner.de> (raw)
Collection of DOE material, v3:
Migrate to synchronous API, create mailboxes in PCI core instead of
in drivers, relax restrictions on request/response size.
One major change since v2 is the behavior on device removal:
Previously ongoing DOE exchanges were canceled before driver unbinding,
so that a driver doesn't wait for an ongoing DOE exchange to time out.
That's the right thing to do for surprise removal, but not for
orderly removal via sysfs or Attention Button, so canceling is
now confined to the former.
Another major change is a new patch at the end of the series
to rightsize CXL CDAT response allocation (per Jonathan's request).
A number of issues in CXL CDAT retrieval caught my eye.
Some of them look like potential vulnerabilities.
I'm adding 4 patches at the beginning of the series to fix them.
Ira kindly tested the series again and verified that the CDAT exposed
in sysfs remains identical.
Changes v2 -> v3:
* [PATCH v3 01/16] cxl/pci: Fix CDAT retrieval on big endian
[PATCH v3 02/16] cxl/pci: Handle truncated CDAT header
[PATCH v3 03/16] cxl/pci: Handle truncated CDAT entries
[PATCH v3 04/16] cxl/pci: Handle excessive CDAT length
* Newly added patch in v3
* [PATCH v3 05/16] PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y
* Explain in commit message what the long-term fix implemented by
a subsequent commit is (Jonathan)
* [PATCH v3 10/16] PCI/DOE: Deduplicate mailbox flushing
* Newly added patch in v3
* [PATCH v3 11/16] PCI/DOE: Allow mailbox creation without devres management
* Call pci_doe_flush_mb() from pci_doe_destroy_mb() to simplify
error paths (Jonathan)
* Explain in commit message why xa_destroy() is reordered in
error path of the new pci_doe_create_mb() (Jonathan)
* [PATCH v3 12/16] PCI/DOE: Create mailboxes on device enumeration
* Don't cancel ongoing DOE exchanges in pci_stop_dev() so that
drivers may perform DOE in their ->remove() hooks
* Instead cancel ongoing DOE exchanges on surprise removal in
pci_dev_set_disconnected()
* Emit error message in pci_doe_init() if mailbox creation fails (Ira)
* Explain in commit message that pci_find_doe_mailbox() can later
be amended with pci_find_next_doe_mailbox() (Jonathan)
* [PATCH v3 15/16] PCI/DOE: Relax restrictions on request and response size
* Fix byte order of last dword on big endian arches (Ira)
* Explain in commit message and kerneldoc that arbitrary-sized
payloads are not stipulated by the spec, but merely for
convenience of the caller (Bjorn, Jonathan)
* Add code comment that "remainder" in pci_doe_recv_resp() signifies
the number of data bytes in the last payload dword (Ira)
* [PATCH v3 16/16] cxl/pci: Rightsize CDAT response allocation
* Newly added patch in v3 on popular request (Jonathan)
Link to v2:
https://lore.kernel.org/all/cover.1674468099.git.lukas@wunner.de/
Lukas Wunner (16):
cxl/pci: Fix CDAT retrieval on big endian
cxl/pci: Handle truncated CDAT header
cxl/pci: Handle truncated CDAT entries
cxl/pci: Handle excessive CDAT length
PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y
PCI/DOE: Fix memory leak with CONFIG_DEBUG_OBJECTS=y
PCI/DOE: Provide synchronous API and use it internally
cxl/pci: Use synchronous API for DOE
PCI/DOE: Make asynchronous API private
PCI/DOE: Deduplicate mailbox flushing
PCI/DOE: Allow mailbox creation without devres management
PCI/DOE: Create mailboxes on device enumeration
cxl/pci: Use CDAT DOE mailbox created by PCI core
PCI/DOE: Make mailbox creation API private
PCI/DOE: Relax restrictions on request and response size
cxl/pci: Rightsize CDAT response allocation
.clang-format | 1 -
drivers/cxl/core/pci.c | 125 ++++++---------
drivers/cxl/cxl.h | 3 +-
drivers/cxl/cxlmem.h | 3 -
drivers/cxl/cxlpci.h | 14 ++
drivers/cxl/pci.c | 49 ------
drivers/cxl/port.c | 2 +-
drivers/pci/doe.c | 340 ++++++++++++++++++++++++++++++----------
drivers/pci/pci.h | 12 ++
drivers/pci/probe.c | 1 +
drivers/pci/remove.c | 1 +
include/linux/pci-doe.h | 62 +-------
include/linux/pci.h | 3 +
13 files changed, 345 insertions(+), 271 deletions(-)
--
2.39.1
next reply other threads:[~2023-02-10 20:28 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 20:25 Lukas Wunner [this message]
2023-02-10 20:25 ` [PATCH v3 01/16] cxl/pci: Fix CDAT retrieval on big endian Lukas Wunner
2023-02-11 0:22 ` Dan Williams
2023-02-19 13:03 ` Lukas Wunner
2023-02-14 11:15 ` Jonathan Cameron
2023-02-14 13:51 ` Lukas Wunner
2023-02-14 15:45 ` Jonathan Cameron
2023-02-28 2:53 ` Alexey Kardashevskiy
2023-02-28 8:24 ` Lukas Wunner
2023-02-28 12:08 ` Alexey Kardashevskiy
2023-02-10 20:25 ` [PATCH v3 02/16] cxl/pci: Handle truncated CDAT header Lukas Wunner
2023-02-11 0:40 ` Dan Williams
2023-02-11 9:34 ` Lukas Wunner
2023-02-14 11:16 ` Jonathan Cameron
2023-02-15 1:41 ` Li, Ming
2023-02-10 20:25 ` [PATCH v3 03/16] cxl/pci: Handle truncated CDAT entries Lukas Wunner
2023-02-11 0:50 ` Dan Williams
2023-02-11 10:56 ` Lukas Wunner
2023-02-14 11:30 ` Jonathan Cameron
2023-02-10 20:25 ` [PATCH v3 04/16] cxl/pci: Handle excessive CDAT length Lukas Wunner
2023-02-11 1:04 ` Dan Williams
2023-02-14 11:33 ` Jonathan Cameron
2023-02-16 10:26 ` Lukas Wunner
2023-02-17 10:01 ` Jonathan Cameron
2023-02-10 20:25 ` [PATCH v3 05/16] PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y Lukas Wunner
2023-02-10 20:25 ` [PATCH v3 06/16] PCI/DOE: Fix memory leak " Lukas Wunner
2023-02-11 1:06 ` Dan Williams
2023-03-01 1:51 ` Davidlohr Bueso
2023-02-10 20:25 ` [PATCH v3 07/16] PCI/DOE: Provide synchronous API and use it internally Lukas Wunner
2023-02-15 1:45 ` Li, Ming
2023-02-28 18:58 ` Davidlohr Bueso
2023-02-10 20:25 ` [PATCH v3 08/16] cxl/pci: Use synchronous API for DOE Lukas Wunner
2023-02-10 20:25 ` [PATCH v3 09/16] PCI/DOE: Make asynchronous API private Lukas Wunner
2023-02-15 1:48 ` Li, Ming
2023-02-10 20:25 ` [PATCH v3 10/16] PCI/DOE: Deduplicate mailbox flushing Lukas Wunner
2023-02-14 11:36 ` Jonathan Cameron
2023-02-15 5:07 ` Li, Ming
2023-02-10 20:25 ` [PATCH v3 11/16] PCI/DOE: Allow mailbox creation without devres management Lukas Wunner
2023-02-14 11:51 ` Jonathan Cameron
2023-02-15 5:17 ` Li, Ming
2023-02-10 20:25 ` [PATCH v3 12/16] PCI/DOE: Create mailboxes on device enumeration Lukas Wunner
2023-02-15 2:07 ` Li, Ming
2023-02-28 1:18 ` Alexey Kardashevskiy
2023-02-28 1:39 ` Dan Williams
2023-02-28 5:43 ` Lukas Wunner
2023-02-28 7:24 ` Alexey Kardashevskiy
2023-02-28 10:42 ` Jonathan Cameron
2023-03-02 20:22 ` Lukas Wunner
2023-03-07 1:55 ` Alexey Kardashevskiy
2023-04-03 0:55 ` Alexey Kardashevskiy
2023-02-10 20:25 ` [PATCH v3 13/16] cxl/pci: Use CDAT DOE mailbox created by PCI core Lukas Wunner
2023-02-10 20:25 ` [PATCH v3 14/16] PCI/DOE: Make mailbox creation API private Lukas Wunner
2023-02-15 2:13 ` Li, Ming
2023-02-10 20:25 ` [PATCH v3 15/16] PCI/DOE: Relax restrictions on request and response size Lukas Wunner
2023-02-15 5:05 ` Li, Ming
2023-02-15 11:49 ` Lukas Wunner
2023-02-10 20:25 ` [PATCH v3 16/16] cxl/pci: Rightsize CDAT response allocation Lukas Wunner
2023-02-14 13:05 ` Jonathan Cameron
2023-02-16 0:56 ` Ira Weiny
2023-02-16 8:03 ` Lukas Wunner
2023-02-28 1:45 ` Alexey Kardashevskiy
2023-02-28 5:55 ` Lukas Wunner
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=cover.1676043318.git.lukas@wunner.de \
--to=lukas@wunner.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=gregory.price@memverge.com \
--cc=hdanton@sina.com \
--cc=helgaas@kernel.org \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=ming4.li@intel.com \
--cc=vishal.l.verma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).