From: Dan Williams <dan.j.williams@intel.com>
To: Alison Schofield <alison.schofield@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
"Ben Widawsky" <bwidawsk@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>, <linux-cxl@vger.kernel.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v12 1/6] cxl/mbox: Add GET_POISON_LIST mailbox command
Date: Mon, 17 Apr 2023 12:39:07 -0700 [thread overview]
Message-ID: <643da05aed721_1b66294ef@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <ZD10hpfDnXaatUOE@aschofie-mobl2>
Alison Schofield wrote:
>
> Dan, Vishal,
>
> Following up on using the new deprecated list ...
>
> On Tue, Apr 11, 2023 at 06:47:56PM -0700, Dan Williams wrote:
> > alison.schofield@ wrote:
> > > From: Alison Schofield <alison.schofield@intel.com>
> > >
> > > CXL devices maintain a list of locations that are poisoned or result
> > > in poison if the addresses are accessed by the host.
> > >
> > > Per the spec, (CXL 3.0 8.2.9.8.4.1), the device returns this Poison
> > > list as a set of Media Error Records that include the source of the
> > > error, the starting device physical address, and length. The length is
> > > the number of adjacent DPAs in the record and is in units of 64 bytes.
> > >
> > > Retrieve the poison list.
> > >
> > > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> > > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > > Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> > > ---
> > > drivers/cxl/core/mbox.c | 71 +++++++++++++++++++++++++++++++++++++++++
> > > drivers/cxl/cxlmem.h | 67 ++++++++++++++++++++++++++++++++++++++
> > > drivers/cxl/pci.c | 4 +++
> > > 3 files changed, 142 insertions(+)
> > >
> > > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> > > index f2addb457172..69a5d69dd53b 100644
> > > --- a/drivers/cxl/core/mbox.c
> > > +++ b/drivers/cxl/core/mbox.c
> > > @@ -5,6 +5,8 @@
> > > #include <linux/debugfs.h>
> > > #include <linux/ktime.h>
> > > #include <linux/mutex.h>
> > > +#include <asm/unaligned.h>
> > > +#include <cxlpci.h>
> > > #include <cxlmem.h>
> > > #include <cxl.h>
> > >
> > > @@ -994,6 +996,7 @@ int cxl_dev_state_identify(struct cxl_dev_state *cxlds)
> > > /* See CXL 2.0 Table 175 Identify Memory Device Output Payload */
> > > struct cxl_mbox_identify id;
> > > struct cxl_mbox_cmd mbox_cmd;
> > > + u32 val;
> > > int rc;
> > >
> > > mbox_cmd = (struct cxl_mbox_cmd) {
> > > @@ -1017,6 +1020,11 @@ int cxl_dev_state_identify(struct cxl_dev_state *cxlds)
> > > cxlds->lsa_size = le32_to_cpu(id.lsa_size);
> > > memcpy(cxlds->firmware_version, id.fw_revision, sizeof(id.fw_revision));
> > >
> > > + if (test_bit(CXL_MEM_COMMAND_ID_GET_POISON, cxlds->enabled_cmds)) {
> > > + val = get_unaligned_le24(id.poison_list_max_mer);
> > > + cxlds->poison.max_errors = min_t(u32, val, CXL_POISON_LIST_MAX);
> > > + }
> > > +
> >
> > With this new interface I do not expect we want to support user tooling
> > that wants to retrieve the list via ioctl. So I think this wants a
> > lead-in patch that deprecates the poison command support so that the
> > linux-cxl community only has one mechanism to maintain going forward.
> >
> > Something like the below as a lead-in, and then you would add code to
> > cxl_walk_cel() to set a flag for the "get poison" machinery.
> >
> > -- >8 --
> > From f2cd1d1e09fe6f36255f3b8cd831b2b4903045d4 Mon Sep 17 00:00:00 2001
> > From: Dan Williams <dan.j.williams@intel.com>
> > Date: Tue, 11 Apr 2023 17:48:45 -0700
> > Subject: [PATCH] cxl/mbox: Deprecate poison commands
> >
> > The CXL subsystem is adding a formal mechanism for retrieving the poison
> > list. Minimize the maintenance burden going forward, and maximize the
> > investment in common tooling by deprecating direct user access to issue
> > this command outside of CXL_MEM_RAW_COMMANDS debug scenarios.
> >
> > A new cxl_deprecated_commands[] list is created for querying which
> > command ids defined in previous kernels are now deprecated.
>
> Dan, Vishal,
>
> With the driver no longer returning these commands in the
> cxl_mem_commands[] list, they will appear as -EOPNOTSUPP in
> the ndctl:libcxl cxl_query().
>
> Is there something else we need to do to actually show these
> cmds as deprecated? Something like query the deprecated list
> and add a new status to cxl_query().
No, because any software written before the deprecation does not know to
look to see if they are deprecated, and software written afterwards can
read the latest header file. So an EOPNOTSUPP return is all that is
needed.
> At the moment, my goal is to do what is needed in the driver
> now, and pick up any accompanying libcxl changes after the
> driver changes are merged. A bit worried I'm leaving something
> undone in driver today.
As long as there are users with new needs the driver will always have
undone corner cases. I think this series is in good shape.
next prev parent reply other threads:[~2023-04-17 19:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 20:55 [PATCH v12 0/6] CXL Poison List Retrieval & Tracing alison.schofield
2023-04-10 20:55 ` [PATCH v12 1/6] cxl/mbox: Add GET_POISON_LIST mailbox command alison.schofield
2023-04-12 1:47 ` Dan Williams
2023-04-12 4:45 ` Alison Schofield
2023-04-12 5:18 ` Dan Williams
2023-04-12 18:01 ` Alison Schofield
2023-04-12 19:16 ` Dan Williams
2023-04-12 18:06 ` Alison Schofield
2023-04-13 16:48 ` Alison Schofield
2023-04-13 18:34 ` Dan Williams
2023-04-17 16:32 ` Alison Schofield
2023-04-17 19:39 ` Dan Williams [this message]
2023-04-10 20:55 ` [PATCH v12 2/6] cxl/trace: Add TRACE support for CXL media-error records alison.schofield
2023-04-10 20:55 ` [PATCH v12 3/6] cxl/memdev: Add trigger_poison_list sysfs attribute alison.schofield
2023-04-12 5:37 ` Dan Williams
2023-04-12 18:32 ` Alison Schofield
2023-04-12 19:34 ` Dan Williams
2023-04-10 20:55 ` [PATCH v12 4/6] cxl/region: Provide region info to the cxl_poison trace event alison.schofield
2023-04-12 5:55 ` Dan Williams
2023-04-12 18:39 ` Alison Schofield
2023-04-12 22:09 ` Dan Williams
2023-04-10 20:55 ` [PATCH v12 5/6] cxl/trace: Add an HPA to cxl_poison trace events alison.schofield
2023-04-10 20:55 ` [PATCH v12 6/6] tools/testing/cxl: Mock support for Get Poison List alison.schofield
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=643da05aed721_1b66294ef@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=rostedt@goodmis.org \
--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