@@ -3719,7 +3719,11 @@ annotate_dax_parent(hwloc_obj_t obj, const char *name, int fsroot_fd)
3719
3719
* ../../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0012:00/ndbus0/region2/dax2.0/dax2.0/ for NVDIMMs
3720
3720
* ../../../devices/platform/e820_pmem/ndbus0/region0/dax0.0/dax0.0/ for fake NVM (memmap=size!start kernel parameter)
3721
3721
* ../../../devices/platform/hmem.0/dax0.0/ for "soft-reserved" specific-purpose memory
3722
+ * ../../../devices/platform/ACPI0017:00/root0/decoder0.0/region0/dax_region0/dax0.0/ for CXL RAM
3723
+ * ../../../devices/platform/ACPI0017:00/root0/nvdimm-bridge0/ndbus0/region0/dax0.0/dax0.0/ for CXL PMEM
3722
3724
*/
3725
+
3726
+ /* remove beginning and end of link to populate DAXParent */
3723
3727
begin = link ;
3724
3728
/* remove the starting ".." (likely multiple) */
3725
3729
while (!strncmp (begin , "../" , 3 ))
@@ -3729,9 +3733,9 @@ annotate_dax_parent(hwloc_obj_t obj, const char *name, int fsroot_fd)
3729
3733
begin += 8 ;
3730
3734
if (!strncmp (begin , "platform/" , 9 ))
3731
3735
begin += 9 ;
3732
- /* remove the ending "daxX.Y" (either one or two) */
3736
+ /* stop at the ending "/ daxX.Y" */
3733
3737
end = strstr (begin , name );
3734
- if (end ) {
3738
+ if (end && end != begin && end [ -1 ] == '/' ) {
3735
3739
* end = '\0' ;
3736
3740
if (end != begin && end [-1 ] == '/' )
3737
3741
end [-1 ] = '\0' ;
@@ -3741,6 +3745,7 @@ annotate_dax_parent(hwloc_obj_t obj, const char *name, int fsroot_fd)
3741
3745
type = strstr (begin , "ndbus" ) ? "NVM" : "SPM" ;
3742
3746
hwloc_obj_add_info (obj , "DAXType" , type );
3743
3747
3748
+ /* insert DAXParent last because it's likely less useful than others */
3744
3749
hwloc_obj_add_info (obj , "DAXParent" , begin );
3745
3750
3746
3751
/*
0 commit comments