From: Alison Schofield <alison.schofield@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jic23@kernel.org>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <iweiny@kernel.org>, Li Ming <ming.li@zohomail.com>,
Richard Cheng <icheng@nvidia.com>
Cc: linux-cxl@vger.kernel.org
Subject: [PATCH 0/4] cxl: Add KUnit tests and documentation
Date: Tue, 13 Oct 2026 21:17:51 -0700 [thread overview]
Message-ID: <cover.1791949910.git.alison.schofield@intel.com> (raw)
The CXL subsystem has no KUnit tests. Its automated test coverage comes
from cxl_test and the ndctl suite, which exercise the driver stack through
an emulated CXL topology. KUnit complements that coverage by testing self-
contained logic and error paths in isolation.
This series introduces CXL KUnit infrastructure and documentation describing
how it complements the existing cxl_test coverage.
The first KUnit suite, a collection of related test cases, exercises the HDM
decoder interleave encoding helpers, providing a starting point for testing
self-contained CXL logic. The second suite exercises mailbox command handling,
including error paths that are difficult to reach through cxl_test.
The mailbox tests also demonstrate the value of regression coverage. An
unknown device return code can cause an out-of-bounds read and allow a failed
command to be reported as successful. The series corrects that behavior, then
adds tests that reproduce the failure without the correction. With KASAN enabled,
the tests also expose the out-of-bounds read.
Together, the two suites establish a pattern for adding KUnit coverage
to CXL, both for existing functionality and for bugs as they are found.
Alison Schofield (3):
Documentation/driver-api/cxl: Add a testing page
cxl: Add KUnit tests for HDM decoder encoding helpers
cxl/mbox: Add KUnit tests for cxl_internal_send_cmd()
Gaobin Huang (1):
cxl/mbox: Treat unknown device return codes as errors
Documentation/driver-api/cxl/index.rst | 1 +
Documentation/driver-api/cxl/testing.rst | 120 +++++++++++
drivers/cxl/.kunitconfig | 4 +
drivers/cxl/Kconfig | 16 ++
drivers/cxl/Makefile | 1 +
drivers/cxl/core/Makefile | 1 +
drivers/cxl/core/tests/Makefile | 5 +
drivers/cxl/core/tests/mbox_kunit.c | 249 +++++++++++++++++++++++
drivers/cxl/cxlmem.h | 6 +
drivers/cxl/tests/Makefile | 5 +
drivers/cxl/tests/hdm_encoding_kunit.c | 156 ++++++++++++++
11 files changed, 564 insertions(+)
create mode 100644 Documentation/driver-api/cxl/testing.rst
create mode 100644 drivers/cxl/.kunitconfig
create mode 100644 drivers/cxl/core/tests/Makefile
create mode 100644 drivers/cxl/core/tests/mbox_kunit.c
create mode 100644 drivers/cxl/tests/Makefile
create mode 100644 drivers/cxl/tests/hdm_encoding_kunit.c
--
2.37.3
next reply other threads:[~2026-10-14 4:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 4:17 Alison Schofield [this message]
2026-10-14 4:17 ` [PATCH 1/4] Documentation/driver-api/cxl: Add a testing page Alison Schofield
2026-10-14 4:17 ` [PATCH 2/4] cxl: Add KUnit tests for HDM decoder encoding helpers Alison Schofield
2026-10-14 4:17 ` [PATCH 3/4] cxl/mbox: Treat unknown device return codes as errors Alison Schofield
2026-10-14 4:17 ` [PATCH 4/4] cxl/mbox: Add KUnit tests for cxl_internal_send_cmd() 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.1791949910.git.alison.schofield@intel.com \
--to=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=icheng@nvidia.com \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=ming.li@zohomail.com \
--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.