From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@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>,
"Steven Rostedt" <rostedt@goodmis.org>,
Shiyang Ruan <ruansy.fnst@fujitsu.com>
Subject: Re: [PATCH v5 1/4] cxl/trace: Correct DPA field masks for general_media & dram events
Date: Tue, 30 Apr 2024 17:27:51 +0100 [thread overview]
Message-ID: <20240430172751.00005072@Huawei.com> (raw)
In-Reply-To: <23671305ae3cd299aacb3be61d90504d6918a7f8.1714435815.git.alison.schofield@intel.com>
On Mon, 29 Apr 2024 17:34:21 -0700
alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> The length of Physical Address in General Media and DRAM event
> records is 64-bit, so the field mask for extracting the DPA should
> be 64-bit also, otherwise the trace event reports DPA's with the
> upper 32 bits of a DPA address masked off. If userspace was doing
> DPA-to-HPA translations this could lead to incorrect page retirement
> decisions, but there is no known consumer (like rasdaemon) of this
> event today.
https://github.com/mchehab/rasdaemon/blob/master/ras-cxl-handler.c#L205
Yes there is, though there may well not have been back in at v1.
>
> Use GENMASK_ULL() for CXL_DPA_MASK to get all the DPA address bits.
>
> Tidy up CXL_DPA_FLAGS_MASK by using GENMASK() to only mask the exact
> flag bits.
>
> These bits are defined as part of the event record physical address
> descriptions of General Media and DRAM events in CXL Spec 3.1
> Section 8.2.9.2 Events.
>
> Co-developed-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
> Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.CAmeron@huawei.com>
Fixes tag would probably be appropriate I think as this should
be backported.
> ---
> drivers/cxl/core/trace.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h
> index e5f13260fc52..7c5cd069f10c 100644
> --- a/drivers/cxl/core/trace.h
> +++ b/drivers/cxl/core/trace.h
> @@ -253,8 +253,8 @@ TRACE_EVENT(cxl_generic_event,
> * DRAM Event Record
> * CXL rev 3.0 section 8.2.9.2.1.2; Table 8-44
> */
> -#define CXL_DPA_FLAGS_MASK 0x3F
> -#define CXL_DPA_MASK (~CXL_DPA_FLAGS_MASK)
> +#define CXL_DPA_FLAGS_MASK GENMASK(1, 0)
> +#define CXL_DPA_MASK GENMASK_ULL(63, 6)
>
> #define CXL_DPA_VOLATILE BIT(0)
> #define CXL_DPA_NOT_REPAIRABLE BIT(1)
next prev parent reply other threads:[~2024-04-30 16:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 0:34 [PATCH v5 0/4] Add DPA->HPA translation to dram & general_media events alison.schofield
2024-04-30 0:34 ` [PATCH v5 1/4] cxl/trace: Correct DPA field masks for general_media & dram events alison.schofield
2024-04-30 2:12 ` Ira Weiny
2024-04-30 16:27 ` Jonathan Cameron [this message]
2024-04-30 0:34 ` [PATCH v5 2/4] cxl/region: Move cxl_dpa_to_region() work to the region driver alison.schofield
2024-04-30 0:34 ` [PATCH v5 3/4] cxl/region: Move cxl_trace_hpa() " alison.schofield
2024-04-30 16:29 ` Jonathan Cameron
2024-04-30 0:34 ` [PATCH v5 4/4] cxl/core: Add region info to cxl_general_media and cxl_dram events alison.schofield
2024-04-30 2:19 ` Ira Weiny
2024-04-30 4:13 ` Alison Schofield
2024-04-30 16:26 ` Ira Weiny
2024-04-30 16:40 ` Ira Weiny
2024-04-30 16:33 ` Jonathan Cameron
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=20240430172751.00005072@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=ruansy.fnst@fujitsu.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