mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Richard Cheng <icheng@nvidia.com>,
	jic23@kernel.org, dave@stgolabs.net, vishal.l.verma@intel.com,
	alison.schofield@intel.com
Cc: iweiny@kernel.org, ming.li@zohomail.com, kaihengf@nvidia.com,
	kobak@nvidia.com, vaslot@nvidia.com, newtonl@nvidia.com,
	mochs@nvidia.com, kristinc@nvidia.com, linux-cxl@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 0/3] Support zero-sized HDM decoders
Date: Tue, 15 Sep 2026 09:01:06 -0700	[thread overview]
Message-ID: <8a889714-f492-4975-b326-bb2ee866c6a1@intel.com> (raw)
In-Reply-To: <20260914090858.19181-1-icheng@nvidia.com>



On 9/14/26 2:08 AM, Richard Cheng wrote:
> 
> 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. It clarifies
> the error handling and iteration control in poison_by_decoder(), and
> shares the check for a forgiven -EFAULT on a RAM partition with
> cxl_get_poison_unmapped().
> 
> 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.
> 
> Testing:
> 
> As reported in v9, the series was tested on arm64 with cxl_test and
> the ndctl v85 unit suite, with KASAN and lockdep enabled. With
> mock_zero_size_decoders disabled, the full CXL suite reported 15 tests
> passed and 1 skipped.
> 
> cxl-poison.sh was skipped because its unaligned translation section
> was unreachable; both run_poison_test() rounds passed. Details:
> https://lore.kernel.org/linux-cxl/anKpY6Y1Sqne1f7Y@MWDK4CY14F/
> 
> The core patch was also previously validated on a Montage CXL Type 3
> device.
> 
> The corresponding ndctl test:
> https://lore.kernel.org/linux-cxl/20260709022857.18732-1-icheng@nvidia.com/
> 
> Runtime-tested v10 on a CXL Type 3 device and confirmed that normal
> device operation continues to work with the series applied.
> 
> Changelog:
> 
> v9->v10 (Alison Schofield):
> - Patch 2: propagate -ENOMEM when allocation of the standalone
>   zero-sized resource fails.
> - Patch 2: retain the original !cxled->dpa_res guard in cxl_dpa_free().
>   An existing zero-sized reservation must reach the region,
>   enabled-state, and release-order checks.
> - Patch 2: update the commit message.
> - Patches 1 and 3 are unchanged.
> 
> Previous version:
> https://lore.kernel.org/linux-cxl/20260805055524.22311-1-icheng@nvidia.com/
> 
> 
> 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       |  58 +++++++++++++------
>  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, 195 insertions(+), 57 deletions(-)
> 
> 
> base-commit: 899648a2707d0405f573dfc7fe15385d9ba3af55

Applied to cxl/next:
057dc2892d1f
00f9ef9ad1ce
fef22d37d470


      parent reply	other threads:[~2026-09-15 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  9:08 Richard Cheng
2026-09-14  9:08 ` [PATCH v10 1/3] cxl/region: Simplify poison_by_decoder() error handling Richard Cheng
2026-09-15 23:33   ` Jonathan Cameron
2026-09-14  9:08 ` [PATCH v10 2/3] cxl/hdm: Allow zero sized HDM decoders Richard Cheng
2026-09-15  2:16   ` Alison Schofield
2026-09-14  9:08 ` [PATCH v10 3/3] tools/testing/cxl: Enable zero sized decoders under hb0 Richard Cheng
2026-09-15 16:01 ` Dave Jiang [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=8a889714-f492-4975-b326-bb2ee866c6a1@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave@stgolabs.net \
    --cc=icheng@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®