From: sashiko-bot@kernel.org
To: "Davidlohr Bueso" <dave@stgolabs.net>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH 4/5] cxl: Add HDM-DB region creation
Date: Fri, 05 Jun 2026 01:34:20 +0000 [thread overview]
Message-ID: <20260605013420.771D01F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260605003329.2584012-5-dave@stgolabs.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Type-2 (CXL_DEVTYPE_DEVMEM) endpoints lacking Back-Invalidation (BI) support are incorrectly allowed to attach to HDM-DB regions, resulting in an invalid HDM-D configuration within a BI-restricted window.
--
commit 17274d5d8a1db5fc909bbe15ef4736f49f5f5bb1
Author: Davidlohr Bueso <dave@stgolabs.net>
cxl: Add HDM-DB region creation
A region inherits its coherency from the chosen root decoder: HDM-DB if the
root has CXL_DECODER_F_BI, otherwise HDM-H. This commit surfaces the
topology through sysfs and enables HDM-DB capability checking.
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index e50dc716d4e82..3f9ddacfae4ea 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
[ ... ]
> @@ -2083,10 +2073,31 @@ static int cxl_region_attach(struct cxl_region *cxlr,
> return -ENXIO;
> }
>
> - if (cxled->cxld.target_type != cxlr->type) {
> - dev_dbg(&cxlr->dev, "%s:%s type mismatch: %d vs %d\n",
> - dev_name(&cxlmd->dev), dev_name(&cxled->cxld.dev),
> - cxled->cxld.target_type, cxlr->type);
> + /*
> + * Verify the device and HDM are capable of the region's flavor before
> + * proceeding. The endpoint decoder's target_type is then inherited
> + * from cxlr->type later in cxl_rr_assign_decoder().
> + */
> + if (cxlr->type == CXL_DECODER_DEVMEM &&
> + cxlds->type == CXL_DEVTYPE_CLASSMEM && !cxlds->bi) {
[Severity: High]
Does this capability check incorrectly allow Type-2 devices without back
invalidation support to bypass the validation?
Since this check requires cxlds->type == CXL_DEVTYPE_CLASSMEM (Type-3
devices), Type-2 devices bypass it. If they attach to an HDM-DB region,
cxld_set_type() in drivers/cxl/core/hdm.c will configure the decoder as
HDM-D (BI=0) because of this logic:
cxld_set_type()
bi = bi && cxlds->bi;
Will this violate the host bridge's coherency expectations by allowing an
HDM-D configuration within a BI-restricted window?
> + dev_err(&cxlr->dev, "%s:%s BI not enabled on device\n",
> + dev_name(&cxlmd->dev), dev_name(&cxled->cxld.dev));
> + return -ENXIO;
> + }
> +
> + cxlhdm = dev_get_drvdata(&ep_port->dev);
> + if (!cxlhdm)
> + return -ENXIO;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605003329.2584012-1-dave@stgolabs.net?part=4
next prev parent reply other threads:[~2026-06-05 1:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 0:33 [PATCH v4 0/5] cxl: Support Back-Invalidate Davidlohr Bueso
2026-06-05 0:33 ` [PATCH 1/5] cxl: Add BI register probing and port initialization Davidlohr Bueso
2026-06-05 1:33 ` sashiko-bot
2026-06-05 2:03 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 2/5] cxl/pci: Add BI topology enable/disable Davidlohr Bueso
2026-06-05 1:29 ` sashiko-bot
2026-06-05 2:11 ` Richard Cheng
2026-06-05 2:20 ` Richard Cheng
2026-06-05 2:23 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 3/5] cxl/hdm: Add BI coherency support for endpoint decoders Davidlohr Bueso
2026-06-05 0:33 ` [PATCH 4/5] cxl: Add HDM-DB region creation Davidlohr Bueso
2026-06-05 1:34 ` sashiko-bot [this message]
2026-06-05 2:37 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 5/5] cxl/hdm: Rename decoder coherency flags Davidlohr Bueso
2026-06-05 2:38 ` [PATCH v4 0/5] cxl: Support Back-Invalidate Richard Cheng
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=20260605013420.771D01F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dave@stgolabs.net \
--cc=linux-cxl@vger.kernel.org \
--cc=sashiko-reviews@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 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.