Skip to content

Commit 2042d11

Browse files
AlisonSchofielddavejiang
authored andcommitted
cxl/trace: Correct DPA field masks for general_media & dram events
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 users do DPA-to-HPA translations this could lead to incorrect page retirement decisions. 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. Fixes: d54a531 ("cxl/mem: Trace General Media Event Record") Co-developed-by: Shiyang Ruan <[email protected]> Signed-off-by: Shiyang Ruan <[email protected]> Signed-off-by: Alison Schofield <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/2867fc43c57720a4a15a3179431829b8dbd2dc16.1714496730.git.alison.schofield@intel.com Signed-off-by: Dave Jiang <[email protected]>
1 parent e67572c commit 2042d11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cxl/core/trace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ TRACE_EVENT(cxl_generic_event,
253253
* DRAM Event Record
254254
* CXL rev 3.0 section 8.2.9.2.1.2; Table 8-44
255255
*/
256-
#define CXL_DPA_FLAGS_MASK 0x3F
257-
#define CXL_DPA_MASK (~CXL_DPA_FLAGS_MASK)
256+
#define CXL_DPA_FLAGS_MASK GENMASK(1, 0)
257+
#define CXL_DPA_MASK GENMASK_ULL(63, 6)
258258

259259
#define CXL_DPA_VOLATILE BIT(0)
260260
#define CXL_DPA_NOT_REPAIRABLE BIT(1)

0 commit comments

Comments
 (0)