Linux CXL
 help / color / mirror / Atom feed
* [PATCH 0/5] cxl: CXL Inject & Clear Poison
@ 2022-11-30  4:34 alison.schofield
  2022-11-30  4:34 ` [PATCH 1/5] cxl/memdev: Add support for the Inject Poison mailbox command alison.schofield
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: alison.schofield @ 2022-11-30  4:34 UTC (permalink / raw)
  To: Dan Williams, Ira Weiny, Vishal Verma, Ben Widawsky, Dave Jiang
  Cc: Alison Schofield, linux-cxl

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

Introducing Inject and Clear Poison support for CXL Devices.

These are optional commands, meaning not all CXL devices must support
them. The sysfs attributes, inject_poison and clear_poison, are only
visible for devices reporting support of the capability.

AFAICS the spec does not say support has to come in pairs. A device
could support Inject and not Clear, or the reverse.

Patches 1 & 2 are the required driver implementation.
Patches 3 & 4 are required for testing with cxl_test.

Then there's patch 5. I built on top of the Get Poison Patchset[1]
because Get Poison is useful for checking on the success of Inject
and Clear Poison. Patch 5 teaches the mock of Get Poison how to use
the injected poison list.

That could all be flipped. Inject & Clear could merge first, then
Get Poison would have the capabilities of Patch 5 from the onset.
Or, they can all roll together into one happy patchset.

Example:
# cxl list -m mem1 --media-errors -u
Now you see the default mock media-errors:
{
  "memdev":"mem1",
  "pmem_size":"1024.00 MiB (1073.74 MB)",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "serial":"0x1",
  "host":"cxl_mem.1",
  "media_errors":{
    "nr_media_errors":2,
    "media_error_records":[
      {
        "dpa":"0x40000000",
        "length":64,
        "source":"Internal",
        "flags":"",
        "overflow_time":0
      },
      {
        "dpa":"0",
        "length":64,
        "source":"Internal",
        "flags":"",
        "overflow_time":0
      }
    ]
  }
}

# echo 0x41000000 > /sys/bus/cxl/devices/mem1/inject_poison
# echo 0x30000000 > /sys/bus/cxl/devices/mem1/inject_poison
Now you see the injected mock media-errors:
# cxl list -m mem1 --media-errors -u
{
  "memdev":"mem1",
  "pmem_size":"1024.00 MiB (1073.74 MB)",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "serial":"0x1",
  "host":"cxl_mem.1",
  "media_errors":{
    "nr_media_errors":2,
    "media_error_records":[
      {
        "dpa":"0x41000000",
        "length":64,
        "source":"Injected",
        "flags":"",
        "overflow_time":0
      },
      {
        "dpa":"0x30000000",
        "length":64,
        "source":"Injected",
        "flags":"",
        "overflow_time":0
      }
    ]
  }

Alison Schofield (5):
  cxl/memdev: Add support for the Inject Poison mailbox command
  cxl/memdev: Add support for the Clear Poison mailbox command
  tools/testing/cxl: Mock the Inject Poison mailbox command
  tools/testing/cxl: Mock the Clear Poison mailbox command
  tools/testing/cxl: Use injected poison for Get Poison List

 Documentation/ABI/testing/sysfs-bus-cxl |  36 +++++
 drivers/cxl/core/memdev.c               | 100 ++++++++++++++
 drivers/cxl/cxlmem.h                    |   9 ++
 tools/testing/cxl/test/mem.c            | 170 +++++++++++++++++++++---
 4 files changed, 295 insertions(+), 20 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-12-08 14:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30  4:34 [PATCH 0/5] cxl: CXL Inject & Clear Poison alison.schofield
2022-11-30  4:34 ` [PATCH 1/5] cxl/memdev: Add support for the Inject Poison mailbox command alison.schofield
2022-11-30 14:31   ` Jonathan Cameron
2022-11-30 14:40     ` Jonathan Cameron
2022-12-01 16:42       ` Dave Jiang
2022-12-08  4:20         ` Alison Schofield
2022-12-01 17:26   ` Dave Jiang
2022-12-08  4:17     ` Alison Schofield
2022-12-04 22:04   ` Dan Williams
2022-12-08  4:16     ` Alison Schofield
2022-11-30  4:34 ` [PATCH 2/5] cxl/memdev: Add support for the Clear " alison.schofield
2022-11-30 14:43   ` Jonathan Cameron
2022-12-01 20:14     ` Alison Schofield
2022-12-01 17:54   ` Dave Jiang
2022-12-01 20:09     ` Alison Schofield
2022-11-30  4:34 ` [PATCH 3/5] tools/testing/cxl: Mock the Inject " alison.schofield
2022-11-30 14:58   ` Jonathan Cameron
2022-12-08  4:47     ` Alison Schofield
2022-12-08 14:53       ` Jonathan Cameron
2022-11-30  4:34 ` [PATCH 4/5] tools/testing/cxl: Mock the Clear " alison.schofield
2022-11-30 15:01   ` Jonathan Cameron
2022-11-30  4:34 ` [PATCH 5/5] tools/testing/cxl: Use injected poison for Get Poison List alison.schofield
2022-11-30 15:15   ` Jonathan Cameron
2022-12-08  4:30     ` Alison Schofield
2022-12-08 14:54       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox