@@ -1331,6 +1331,46 @@ CXL_EXPORT int cxl_memdev_disable_invalidate(struct cxl_memdev *memdev)
return 0;
}
+CXL_EXPORT int cxl_memdev_trigger_poison_list(struct cxl_memdev *memdev)
+{
+ struct cxl_ctx *ctx = cxl_memdev_get_ctx(memdev);
+ char *path = memdev->dev_buf;
+ int len = memdev->buf_len, rc;
+
+ if (snprintf(path, len, "%s/trigger_poison_list", memdev->dev_path) >= len) {
+ err(ctx, "%s: buffer too small\n",
+ cxl_memdev_get_devname(memdev));
+ return -ENXIO;
+ }
+ rc = sysfs_write_attr(ctx, path, "1\n");
+ if (rc < 0) {
+ fprintf(stderr, "%s: Failed write sysfs attr trigger_poison_list\n",
+ cxl_memdev_get_devname(memdev));
+ return rc;
+ }
+ return 0;
+}
+
+CXL_EXPORT int cxl_region_trigger_poison_list(struct cxl_region *region)
+{
+ struct cxl_ctx *ctx = cxl_region_get_ctx(region);
+ char *path = region->dev_buf;
+ int len = region->buf_len, rc;
+
+ if (snprintf(path, len, "%s/trigger_poison_list", region->dev_path) >= len) {
+ err(ctx, "%s: buffer too small\n",
+ cxl_region_get_devname(region));
+ return -ENXIO;
+ }
+ rc = sysfs_write_attr(ctx, path, "1\n");
+ if (rc < 0) {
+ fprintf(stderr, "%s: Failed write sysfs attr trigger_poison_list\n",
+ cxl_region_get_devname(region));
+ return rc;
+ }
+ return 0;
+}
+
CXL_EXPORT int cxl_memdev_enable(struct cxl_memdev *memdev)
{
struct cxl_ctx *ctx = cxl_memdev_get_ctx(memdev);
@@ -217,3 +217,9 @@ global:
cxl_decoder_get_max_available_extent;
cxl_decoder_get_region;
} LIBCXL_2;
+
+LIBCXL_4 {
+global:
+ cxl_memdev_trigger_poison_list;
+ cxl_region_trigger_poison_list;
+} LIBCXL_3;
@@ -375,6 +375,8 @@ enum cxl_setpartition_mode {
int cxl_cmd_partition_set_mode(struct cxl_cmd *cmd,
enum cxl_setpartition_mode mode);
+int cxl_memdev_trigger_poison_list(struct cxl_memdev *memdev);
+int cxl_region_trigger_poison_list(struct cxl_region *region);
#ifdef __cplusplus
} /* extern "C" */