From: Dave Jiang <dave.jiang@intel.com>
To: Robert Richter <rrichter@amd.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] cxl: Check for invalid addresses returned from translation functions on errors
Date: Wed, 14 Jan 2026 09:08:17 -0700 [thread overview]
Message-ID: <6411cf5f-0a92-452c-b974-be14dcc4bd32@intel.com> (raw)
In-Reply-To: <aWaEqW1vP3EEOvYK@rric.localdomain>
On 1/13/26 10:45 AM, Robert Richter wrote:
> On 13.01.26 08:51:15, Dave Jiang wrote:
>>
>>
>> On 1/7/26 5:05 AM, Robert Richter wrote:
>>> Translation functions may return an invalid address in case of errors.
>>> If the address is not checked the further use of the invalid value
>>> will cause an address corruption.
>>>
>>> Consistently check for a valid address returned by translation
>>> functions. Use RESOURCE_SIZE_MAX to indicate an invalid address for
>>> type resource_size_t. Depending on the type either RESOURCE_SIZE_MAX
>>> or ULLONG_MAX is used to indicate an address error.
>>>
>>> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>>> Signed-off-by: Robert Richter <rrichter@amd.com>
>>> ---
>>> v3:
>>> * updated sob-chain,
>>> * changed error handling flow in test/cxl_translate.c (Alison),
>>>
>>> v2:
>>> * separated from this patch series (Alison):
>>> [PATCH v8 00/13] cxl: ACPI PRM Address Translation Support and AMD Zen5 enablement
>>> * improved error handling logic and early return on error in
>>> region_offset_to_dpa_result() (Dave),
>>> * use RESOURCE_SIZE_MAX to indicate an invalid address for
>>> resource_size_t types (Alison, kernel test robot),
>>> * improved patch description (Alison),
>>> * added line wrap for code >80 chars.
>>> ---
>>>
>>> Signed-off-by: Robert Richter <rrichter@amd.com>
>>
>> Applied to cxl/fixes
>> 8441c7d3bd6c5a52ab2ecf77e43a5bf262004f5c
>
> Thanks Alison and Dave.
>
>> Added user impact statement and fixed up tab formatting reported by checkpatch.
>
>>> + pr_err("test random iter %d FAIL hpa=%llu, dpa=%llu reverse_dpa=%llu, pos=%d reverse_pos=%d eiw=%u eig=%u\n",
>>> + i, hpa, dpa, reverse_dpa, pos, reverse_pos, eiw, eig);
>
> Note that my checkpatch does not trigger a tab issue here. How did you
> test that?
Maybe --strict?
>
> Thanks,
>
> -Robert
next prev parent reply other threads:[~2026-01-14 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 12:05 [PATCH v3] cxl: Check for invalid addresses returned from translation functions on errors Robert Richter
2026-01-08 16:13 ` Jonathan Cameron
2026-01-13 0:05 ` Alison Schofield
2026-01-13 15:51 ` Dave Jiang
2026-01-13 17:45 ` Robert Richter
2026-01-14 16:08 ` Dave Jiang [this message]
2026-01-14 16:44 ` Robert Richter
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=6411cf5f-0a92-452c-b974-be14dcc4bd32@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=linux-kernel@vger.kernel.org \
--cc=rrichter@amd.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