All of lore.kernel.org
 help / color / mirror / Atom feed
From: alison.schofield@intel.com
To: Vishal Verma <vishal.l.verma@intel.com>
Cc: Alison Schofield <alison.schofield@intel.com>,
	nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: [ndctl PATCH v5 0/5] Support poison list retrieval
Date: Tue, 21 Nov 2023 17:22:01 -0800	[thread overview]
Message-ID: <cover.1700615159.git.alison.schofield@intel.com> (raw)

From: Alison Schofield <alison.schofield@intel.com>

Changes since v4:
- Unit test style changes based on a chatroom review with Vishal.
- Link to v4:
https://lore.kernel.org/linux-cxl/cover.1700591754.git.alison.schofield@intel.com/

Changes since v3:
- Exclude poison record where address belongs to a different region
- Add unit test case for above scenario
- Refactor unit test handling of poison record checks (Vishal)
- Address shellcheck complaints in the unit test (Vishal)
- Remove empty json fields from cxl-list man page
- Omit json "flags" field when no flags exist
- Minor flow updates in the unit test
- Link to v3:
  https://lore.kernel.org/linux-cxl/cover.1700258145.git.alison.schofield@intel.com/


Begin cover letter:

Add the option to include a memory device poison list in cxl list json output.
Examples appended below: by memdev, by region, by memdev and coincidentally
in a region, and no poison found.

Example: By memdev
cxl list -m mem1 --poison -u
{
  "memdev":"mem1",
  "pmem_size":"1024.00 MiB (1073.74 MB)",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "serial":"0x1",
  "numa_node":1,
  "host":"cxl_mem.1",
  "poison":{
    "nr_records":4,
    "records":[
      {
        "dpa":"0x40000000",
        "dpa_length":64,
        "source":"Injected",
      },
      {
        "dpa":"0x40001000",
        "dpa_length":64,
        "source":"Injected",
      },
      {
        "dpa":"0",
        "dpa_length":64,
        "source":"Injected",
      },
      {
        "dpa":"0x600",
        "dpa_length":64,
        "source":"Injected",
      }
    ]
  }
}

Example: By region
cxl list -r region5 --poison -u
{
  "region":"region5",
  "resource":"0xf110000000",
  "size":"2.00 GiB (2.15 GB)",
  "type":"pmem",
  "interleave_ways":2,
  "interleave_granularity":4096,
  "decode_state":"commit",
  "poison":{
    "nr_records":2,
    "records":[
      {
        "memdev":"mem1",
        "region":"region5",
        "hpa":"0xf110001000",
        "dpa":"0x40000000",
        "dpa_length":64,
        "source":"Injected",
      },
      {
        "memdev":"mem0",
        "region":"region5",
        "hpa":"0xf110000000",
        "dpa":"0x40000000",
        "dpa_length":64,
        "source":"Injected",
      }
    ]
  }
}

Example: By memdev and coincidentally in a region
# cxl list -m mem0 --poison -u
{
  "memdev":"mem0",
  "pmem_size":"1024.00 MiB (1073.74 MB)",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "serial":"0",
  "numa_node":0,
  "host":"cxl_mem.0",
  "poison":{
    "nr_records":1,
    "records":[
      {
        "region":"region5",
        "hpa":"0xf110000000",
        "dpa":"0x40000000",
        "dpa_length":64,
        "source":"Injected",
      }
    ]
  }
}

Example: No poison found
cxl list -m mem9 --poison -u
{
  "memdev":"mem9",
  "pmem_size":"1024.00 MiB (1073.74 MB)",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "serial":"0x9",
  "numa_node":1,
  "host":"cxl_mem.9",
  "poison":{
    "nr_records":0
  }
}

Alison Schofield (5):
  libcxl: add interfaces for GET_POISON_LIST mailbox commands
  cxl: add an optional pid check to event parsing
  cxl/list: collect and parse the poison list records
  cxl/list: add --poison option to cxl list
  cxl/test: add cxl-poison.sh unit test

 Documentation/cxl/cxl-list.txt |  58 +++++++++
 cxl/event_trace.c              |   5 +
 cxl/event_trace.h              |   1 +
 cxl/filter.h                   |   3 +
 cxl/json.c                     | 211 +++++++++++++++++++++++++++++++++
 cxl/lib/libcxl.c               |  47 ++++++++
 cxl/lib/libcxl.sym             |   6 +
 cxl/libcxl.h                   |   2 +
 cxl/list.c                     |   2 +
 test/cxl-poison.sh             | 158 ++++++++++++++++++++++++
 test/meson.build               |   2 +
 11 files changed, 495 insertions(+)
 create mode 100644 test/cxl-poison.sh


base-commit: a871e6153b11fe63780b37cdcb1eb347b296095c
-- 
2.37.3


             reply	other threads:[~2023-11-22  1:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  1:22 alison.schofield [this message]
2023-11-22  1:22 ` [ndctl PATCH v5 1/5] libcxl: add interfaces for GET_POISON_LIST mailbox commands alison.schofield
2023-11-22  1:22 ` [ndctl PATCH v5 2/5] cxl: add an optional pid check to event parsing alison.schofield
2023-11-22  1:22 ` [ndctl PATCH v5 3/5] cxl/list: collect and parse the poison list records alison.schofield
2023-12-07  4:39   ` Dan Williams
2023-12-13  2:13     ` Alison Schofield
2023-11-22  1:22 ` [ndctl PATCH v5 4/5] cxl/list: add --poison option to cxl list alison.schofield
2023-12-07  4:23   ` Dan Williams
2023-12-13  0:34     ` Tsaur, Erwin
2023-12-13  0:34       ` Tsaur, Erwin
2023-12-13  2:02     ` Alison Schofield
2023-11-22  1:22 ` [ndctl PATCH v5 5/5] cxl/test: add cxl-poison.sh unit test 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=cover.1700615159.git.alison.schofield@intel.com \
    --to=alison.schofield@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --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 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.