From: "Cheatham, Benjamin" <benjamin.cheatham@amd.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: <nvdimm@lists.linux.dev>, <linux-cxl@vger.kernel.org>,
<dave.jiang@intel.com>
Subject: Re: [ndctl PATCH v5 0/7] Add error injection support
Date: Wed, 17 Dec 2025 13:56:35 -0600 [thread overview]
Message-ID: <bea48658-5960-4159-bf74-f4ab806189d6@amd.com> (raw)
In-Reply-To: <aUI13O1UFv4L__yw@aschofie-mobl2.lan>
On 12/16/2025 10:47 PM, Alison Schofield wrote:
> On Mon, Dec 15, 2025 at 03:36:23PM -0600, Ben Cheatham wrote:
>> v5 Changes:
>> - Use setmntent()/getmntent() instead of open-coding getting the
>> debugfs path (Dave)
>> - Use correct return code for sysfs_read_attr() (Dave)
>>
>> v4 Changes:
>> - Variable renames for clarity (Dave)
>> - Use errno instead of rc for access() calls (Dave)
>> - Check returns for snprintf() (Dave)
>> - Add util_cxl_dport_filter() (Dave)
>> - Replace printf() calls with log_info() (Dave)
>> - Write correct value to debugfs during protocol error injection
>> (BIT(error) vs. error)
>>
>> v3 Changes:
>> - Rebase on v83 release
>> - Fix whitespace errors (Alison)
>>
>> v2 Changes:
>> - Make the --clear option of 'inject-error' its own command (Alison)
>> - Debugfs is now found using the /proc/mount entry instead of
>> providing the path using a --debugfs option
>> - Man page added for 'clear-error'
>> - Reword commit descriptions for clarity
>>
>> This series adds support for injecting CXL protocol (CXL.cache/mem)
>> errors[1] into CXL RCH Downstream ports and VH root ports[2] and
>> poison into CXL memory devices through the CXL debugfs. Errors are
>> injected using a new 'inject-error' command, while errors are reported
>> using a new cxl-list "-N"/"--injectable-errors" option. Device poison
>> can be cleared using the 'clear-error' command.
>>
>> The 'inject-error'/'clear-error' commands and "-N" option of cxl-list all
>> require access to the CXL driver's debugfs.
>>
>> The documentation for the new cxl-inject-error command shows both usage
>> and the possible device/error types, as well as how to retrieve them
>> using cxl-list. The documentation for cxl-list has also been updated to
>> show the usage of the new injectable errors option.
>>
>> [1]: ACPI v6.5 spec, section 18.6.4
>> [2]: ACPI v6.5 spec, table 18.31
>
> Hi Ben,
>
> I did a patch by patch review but saved up a couple of usability things
> to chat about here:
>
> Consider removing the -N option and simply adding the new info to the
> default memdev and bus listings. Both are only accessing debugfs files and
> don't add much to the default listing, especially the memdev one.
That makes sense, I'll do that.
>
> For the protocol errors, the cxl list entry is always present, even when empty,
> but the poison_injectable attribute is only present when true. Should that be
> always present and true/false? Or maybe true/false/unknown, where unknown is
> the status when CONFIG_DEBUG_FS is not enabled?
> And, maybe something similar for protocol errors?
It's probably fine to have them be always present when CONFIG_DEBUG_FS is enabled.
I think it would be cool to have them be removed when CONFIG_DEBUG_FS is disabled,
but I'm not sure how that would work. If I can do that, that's what I'll do.
Otherwise, I'll just set poison_injectable to false. That's what makes sense to me
since poison injection and error injection into non-RCH ports aren't available
unless the debugfs files are there (AFAIK). For the protocol errors, I'll either do
"None", "N/A", or leave it as an empty list.
>
> Please add more strong 'danger' warnings to the poison inject and clear
> command man pages. See Documentation/ABI/testing/debugfs-cxl for the language
> we converged on when adding the debugfs attributes.
For sure, I'll take a look and update.
>
> I have no test for the protocol errors. Is there anything you can
> share for that?
I don't have any at the moment. My first idea for one is to modify the CXL test module(s)
to replace /sys/kernel/debug/cxl/einj_inject with a dummy that prints a message to the dmesg
then check for that message in the test after running the command. That would somewhat match
the real use case, but doesn't test any actual error injection. If you think that would
be useful let me know and I'll put something together.
>
> I'll send a separate reply asking if you to append an updated cxl-poison
> unit test patch to this set.
That sounds fine to me, I'll append it on v6.
Thanks,
Ben
>
> --Alison
next prev parent reply other threads:[~2025-12-17 19:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 21:36 [ndctl PATCH v5 0/7] Add error injection support Ben Cheatham
2025-12-15 21:36 ` [PATCH v5 1/7] libcxl: Add debugfs path to CXL context Ben Cheatham
2025-12-17 4:26 ` Alison Schofield
2025-12-17 19:55 ` Cheatham, Benjamin
2025-12-15 21:36 ` [PATCH v5 2/7] libcxl: Add CXL protocol errors Ben Cheatham
2025-12-17 4:31 ` Alison Schofield
2025-12-17 19:55 ` Cheatham, Benjamin
2025-12-19 4:38 ` Alison Schofield
2026-01-05 21:00 ` Cheatham, Benjamin
2025-12-15 21:36 ` [PATCH v5 3/7] libcxl: Add poison injection support Ben Cheatham
2025-12-15 21:36 ` [PATCH v5 4/7] cxl: Add inject-error command Ben Cheatham
2025-12-17 4:36 ` Alison Schofield
2025-12-17 19:56 ` Cheatham, Benjamin
2025-12-15 21:36 ` [PATCH v5 5/7] cxl: Add clear-error command Ben Cheatham
2025-12-17 4:39 ` Alison Schofield
2025-12-17 19:56 ` Cheatham, Benjamin
2025-12-15 21:36 ` [PATCH v5 6/7] cxl/list: Add injectable errors in output Ben Cheatham
2025-12-15 21:36 ` [PATCH v5 7/7] Documentation: Add docs for inject/clear-error commands Ben Cheatham
2025-12-17 4:42 ` Alison Schofield
2025-12-17 19:56 ` Cheatham, Benjamin
2025-12-19 4:52 ` Alison Schofield
2026-01-05 21:13 ` Cheatham, Benjamin
2026-01-06 4:41 ` Alison Schofield
2025-12-17 4:47 ` [ndctl PATCH v5 0/7] Add error injection support Alison Schofield
2025-12-17 19:56 ` Cheatham, Benjamin [this message]
2025-12-19 5:08 ` Alison Schofield
2026-01-05 21:14 ` Cheatham, Benjamin
2025-12-17 5:00 ` [ndctl PATCH] cxl/test: use inject and clear cmds in cxl-poison.sh 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=bea48658-5960-4159-bf74-f4ab806189d6@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
/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