All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cheng <icheng@nvidia.com>
To: jic23@kernel.org, dave@stgolabs.net, dave.jiang@intel.com,
	 vishal.l.verma@intel.com, djbw@kernel.org,
	danwilliams@nvidia.com,  alison.schofield@intel.com
Cc: iweiny@kernel.org, ming.li@zohomail.com, kaihengf@nvidia.com,
	 kobak@nvidia.com, vaslot@nvidia.com, mochs@nvidia.com,
	newtonl@nvidia.com,  kristinc@nvidia.com,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 0/3] Support zero-sized HDM decoders
Date: Thu, 27 Aug 2026 17:33:56 +0800	[thread overview]
Message-ID: <apAEWBVOUJW7kJ9b@MWDK4CY14F> (raw)
In-Reply-To: <20260805055524.22311-1-icheng@nvidia.com>

On Wed, Aug 05, 2026 at 01:55:21PM +0800, Richard Cheng wrote:

Hello folks,

Just a gentle ping on the series, thanks.

Best regards,
Richard Cheng.

> CXL r4.0 §8.2.4.20.12 ("Committing Decoder Programming") and
> §14.13.10 ("CXL HDM Decoder Zero Size Commit") permit committing an
> HDM decoder with size 0. Firmware may commit and lock such decoders so
> the OS cannot program regions through them; this is a platform design
> choice rather than a specification requirement.
> 
> The kernel currently rejects these decoders with -ENXIO during port
> enumeration and aborts enumeration of the entire port. On affected
> systems, this prevents the CXL topology from appearing in userspace.
> 
> This series enumerates empty committed decoders into the topology while
> keeping them out of region assembly.
> 
> Patch 1 is a preparatory cleanup with no functional change. In
> poison_by_decoder(), "rc" carries both an error code and the loop
> control signal for device_for_each_child(), so returning it bare is
> misleading, the early guards mean "keep walking", not "no error".
> Zeroing "rc" to forgive an -EFAULT on a RAM partition adds to that by
> discarding what the device actually returned. Return a literal 0 where
> the walk should continue, and test the forgiven case directly instead
> of rewriting "rc". Patch 2 extends this function, so cleaning it up
> first keeps the functional change free of unrelated churn.
> 
> Patch 2 makes zero-size DPA reservations first-class. Since the resource
> tree cannot represent an empty range, an empty decoder is backed by a
> separately allocated resource. This keeps port->hdm_end, skip handling,
> and in-order DPA accounting consistent. Operations requiring non-empty
> capacity, including region attachment and poison queries, are guarded
> appropriately.
> 
> Patch 3 adds the mock_zero_size_decoders cxl_test module parameter,
> disabled by default. When enabled, it installs committed, locked,
> zero-sized endpoint, switch, and host-bridge decoders under
> host-bridge0.
> 
> Tested on arm64 with cxl_test and the ndctl unit suite (ndctl
> v85), on a kernel built with KASAN and lockdep enabled.
> 
> Full cxl suite with mock_zero_size_decoders off:
> """
>  1/16 ndctl:cxl / cxl-topology.sh       OK                7.50s
>  2/16 ndctl:cxl / cxl-region-sysfs.sh   OK                5.29s
>  3/16 ndctl:cxl / cxl-labels.sh         OK                3.44s
>  4/16 ndctl:cxl / cxl-create-region.sh  OK                9.97s
>  5/16 ndctl:cxl / cxl-xor-region.sh     OK                5.77s
>  6/16 ndctl:cxl / cxl-events.sh         OK                2.89s
>  7/16 ndctl:cxl / cxl-sanitize.sh       OK                5.74s
>  8/16 ndctl:cxl / cxl-destroy-region.sh OK                3.84s
>  9/16 ndctl:cxl / cxl-qos-class.sh      OK                3.22s
> 10/16 ndctl:cxl / cxl-translate.sh      OK                0.95s
> 11/16 ndctl:cxl / cxl-elc.sh            OK                4.22s
> 12/16 ndctl:cxl / cxl-dax-hmem.sh       OK                4.60s
> 13/16 ndctl:cxl / cxl-region-replay.sh  OK                8.74s
> 14/16 ndctl:cxl / cxl-security.sh       OK                1.83s
> 15/16 ndctl:cxl / cxl-features.sh       OK                1.45s
> 16/16 ndctl:cxl / cxl-poison.sh         SKIP             11.66s
> 
> Ok:                 15
> Expected Fail:      0
> Fail:               0
> Unexpected Pass:    0
> Skipped:            1
> Timeout:            0
> """
> 
> The reason that cxl-poison.sh is skipped is stated in
> https://lore.kernel.org/linux-cxl/anKpY6Y1Sqne1f7Y@MWDK4CY14F/
> 
> Both run_poison_test() rounds pass, so everything this series touches is
> covered, only the unaligned translation section is unreachable, and the
> series does not touch translation.
> 
> The core patch was also previously validated on a Montage CXL Type 3
> device.
> 
> The corresponding ndctl test is attached at
> https://lore.kernel.org/linux-cxl/20260709022857.18732-1-icheng@nvidia.com/
> 
> 
> Changelog:
> 
> v8->v9:
> - Patch 1: add a poison_efault_forgiven() helper and use it in
>   cxl_get_poison_unmapped() as well.
> - Patch 2: rebased on that helper, no functional change.
> - Patch 3: no change.
> - Fixed the test environment so cxl-security.sh runs and passes; the
>   suite is now 15 OK / 1 SKIP. cxl-poison.sh still skips, see above.
> 
> v7->v8:
> - Split the poison_by_decoder() readability cleanup out of the core
>   patch into a new preparatory patch 1.
> - cxl_dpa_request_region(): split the declaration from the allocation
>   so the allocation and its error check sit together.
> - Add the missing blank line between commit message paragraphs in
>   patch 2.
> - Patch 3 is unchanged.
> 
> v6->v7:
> - Rebase onto cxl/for-7.3/cxl-type2-test.
> - Patch 1 is unchanged.
> - Adapt patch 2 to the refactored Type-2/Type-3 decoder initialization
>   paths.
> - Integrate mock_zero_size_decoders with special-topology parameter
>   validation and reject its incompatible use with fail_autoassemble.
> 
> 
> Richard Cheng (3):
>   cxl/region: Simplify poison_by_decoder() error handling
>   cxl/hdm: Allow zero sized HDM decoders
>   tools/testing/cxl: Enable zero sized decoders under hb0
> 
>  drivers/cxl/core/hdm.c       |  55 ++++++++++++------
>  drivers/cxl/core/mbox.c      |   3 +
>  drivers/cxl/core/region.c    |  69 ++++++++++++++--------
>  drivers/cxl/cxl.h            |  10 ++++
>  drivers/cxl/port.c           |   3 +
>  tools/testing/cxl/test/cxl.c | 109 ++++++++++++++++++++++++++++++-----
>  6 files changed, 193 insertions(+), 56 deletions(-)
> 
> 
> base-commit: 1c6b4ceafc3b994871c29340e0c1ddb0af5800e7
> -- 
> 2.43.0
> 

      parent reply	other threads:[~2026-08-27  9:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05  5:55 [PATCH v9 0/3] Support zero-sized HDM decoders Richard Cheng
2026-08-05  5:55 ` [PATCH v9 1/3] cxl/region: Simplify poison_by_decoder() error handling Richard Cheng
2026-08-05  6:09   ` sashiko-bot
2026-08-05  5:55 ` [PATCH v9 2/3] cxl/hdm: Allow zero sized HDM decoders Richard Cheng
2026-08-05  6:09   ` sashiko-bot
2026-08-05  5:55 ` [PATCH v9 3/3] tools/testing/cxl: Enable zero sized decoders under hb0 Richard Cheng
2026-08-27  9:33 ` Richard Cheng [this message]

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=apAEWBVOUJW7kJ9b@MWDK4CY14F \
    --to=icheng@nvidia.com \
    --cc=alison.schofield@intel.com \
    --cc=danwilliams@nvidia.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=kaihengf@nvidia.com \
    --cc=kobak@nvidia.com \
    --cc=kristinc@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=mochs@nvidia.com \
    --cc=newtonl@nvidia.com \
    --cc=vaslot@nvidia.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.