From: Dave Jiang <dave.jiang@intel.com>
To: Alison Schofield <alison.schofield@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2 2/2] cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING as a bitmask
Date: Mon, 23 Feb 2026 16:06:00 -0700 [thread overview]
Message-ID: <88e86d01-e328-448e-b824-d41ed61644bd@intel.com> (raw)
In-Reply-To: <63fe4a6203e40e404347f1cdc7a1c55cb4959b86.1771873256.git.alison.schofield@intel.com>
On 2/23/26 12:13 PM, Alison Schofield wrote:
> The CXL decoder flags are defined as bitmasks, not bit indices.
> Using test_bit() to check them interprets the mask value as a bit
> index, which is the wrong test.
>
> For CXL_DECODER_F_NORMALIZED_ADDRESSING the test reads beyond the
> flags word, making the flag sometimes appear set and blocking creation
> of CXL region debugfs attributes that support poison operations.
>
> Replace test_bit() with a bitmask check.
>
> Found with cxl-test.
>
> Fixes: 208f432406b7 ("cxl: Disable HPA/SPA translation handlers for Normalized Addressing")
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Applied to cxl/fixes
ebd11be59f7421e4b1ea19eaa8102d17ade3d6c6
> ---
>
> Changes in v2:
> Split patches to align w Fixes Tags for backport ease
> Rebased on 7.0-rc1
>
> drivers/cxl/core/region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 780ec947ecf2..42874948b589 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1105,7 +1105,7 @@ static void cxl_region_setup_flags(struct cxl_region *cxlr,
> clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
> }
>
> - if (test_bit(CXL_DECODER_F_NORMALIZED_ADDRESSING, &cxld->flags))
> + if (cxld->flags & CXL_DECODER_F_NORMALIZED_ADDRESSING)
> set_bit(CXL_REGION_F_NORMALIZED_ADDRESSING, &cxlr->flags);
> }
>
next prev parent reply other threads:[~2026-02-23 23:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 19:13 [PATCH v2 1/2] cxl: Test CXL_DECODER_F_LOCK as a bitmask Alison Schofield
2026-02-23 19:13 ` [PATCH v2 2/2] cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING " Alison Schofield
2026-02-23 21:27 ` Gregory Price
2026-02-23 23:06 ` Dave Jiang [this message]
2026-02-23 21:27 ` [PATCH v2 1/2] cxl: Test CXL_DECODER_F_LOCK " Gregory Price
2026-02-23 23:05 ` Dave Jiang
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=88e86d01-e328-448e-b824-d41ed61644bd@intel.com \
--to=dave.jiang@intel.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--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