···496496 changed, only freed by writing 0. The kernel makes no guarantees497497 that data is maintained over an address space freeing event, and498498 there is no guarantee that a free followed by an allocate499499- results in the same address being allocated.499499+ results in the same address being allocated. If extended linear500500+ cache is present, the size indicates extended linear cache size501501+ plus the CXL region size.500502503503+What: /sys/bus/cxl/devices/regionZ/extended_linear_cache_size504504+Date: October, 2025505505+KernelVersion: v6.19506506+Contact: linux-cxl@vger.kernel.org507507+Description:508508+ (RO) The size of extended linear cache, if there is an extended509509+ linear cache. Otherwise the attribute will not be visible.501510502511What: /sys/bus/cxl/devices/regionZ/mode503512Date: January, 2023
+7-10
drivers/cxl/acpi.c
···372372373373 rc = hmat_get_extended_linear_cache_size(&res, nid, &cache_size);374374 if (rc)375375- return rc;375375+ return 0;376376377377 /*378378 * The cache range is expected to be within the CFMWS.···397397 int rc;398398399399 rc = cxl_acpi_set_cache_size(cxlrd);400400- if (!rc)401401- return;402402-403403- if (rc != -EOPNOTSUPP) {400400+ if (rc) {404401 /*405405- * Failing to support extended linear cache region resize does not402402+ * Failing to retrieve extended linear cache region resize does not406403 * prevent the region from functioning. Only causes cxl list showing407404 * incorrect region size.408405 */409406 dev_warn(cxlrd->cxlsd.cxld.dev.parent,410410- "Extended linear cache calculation failed rc:%d\n", rc);411411- }407407+ "Extended linear cache retrieval failed rc:%d\n", rc);412408413413- /* Ignoring return code */414414- cxlrd->cache_size = 0;409409+ /* Ignoring return code */410410+ cxlrd->cache_size = 0;411411+ }415412}416413417414DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
+44-15
drivers/cxl/core/region.c
···467467}468468static DEVICE_ATTR_RW(commit);469469470470-static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a,471471- int n)472472-{473473- struct device *dev = kobj_to_dev(kobj);474474- struct cxl_region *cxlr = to_cxl_region(dev);475475-476476- /*477477- * Support tooling that expects to find a 'uuid' attribute for all478478- * regions regardless of mode.479479- */480480- if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_PARTMODE_PMEM)481481- return 0444;482482- return a->mode;483483-}484484-485470static ssize_t interleave_ways_show(struct device *dev,486471 struct device_attribute *attr, char *buf)487472{···745760}746761static DEVICE_ATTR_RW(size);747762763763+static ssize_t extended_linear_cache_size_show(struct device *dev,764764+ struct device_attribute *attr,765765+ char *buf)766766+{767767+ struct cxl_region *cxlr = to_cxl_region(dev);768768+ struct cxl_region_params *p = &cxlr->params;769769+ ssize_t rc;770770+771771+ ACQUIRE(rwsem_read_intr, rwsem)(&cxl_rwsem.region);772772+ if ((rc = ACQUIRE_ERR(rwsem_read_intr, &rwsem)))773773+ return rc;774774+ return sysfs_emit(buf, "%#llx\n", p->cache_size);775775+}776776+static DEVICE_ATTR_RO(extended_linear_cache_size);777777+748778static struct attribute *cxl_region_attrs[] = {749779 &dev_attr_uuid.attr,750780 &dev_attr_commit.attr,···768768 &dev_attr_resource.attr,769769 &dev_attr_size.attr,770770 &dev_attr_mode.attr,771771+ &dev_attr_extended_linear_cache_size.attr,771772 NULL,772773};774774+775775+static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a,776776+ int n)777777+{778778+ struct device *dev = kobj_to_dev(kobj);779779+ struct cxl_region *cxlr = to_cxl_region(dev);780780+781781+ /*782782+ * Support tooling that expects to find a 'uuid' attribute for all783783+ * regions regardless of mode.784784+ */785785+ if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_PARTMODE_PMEM)786786+ return 0444;787787+788788+ /*789789+ * Don't display extended linear cache attribute if there is no790790+ * extended linear cache.791791+ */792792+ if (a == &dev_attr_extended_linear_cache_size.attr &&793793+ cxlr->params.cache_size == 0)794794+ return 0;795795+796796+ return a->mode;797797+}773798774799static const struct attribute_group cxl_region_group = {775800 .attrs = cxl_region_attrs,···36043579 dev_warn(cxlmd->dev.parent,36053580 "Extended linear cache calculation failed rc:%d\n", rc);36063581 }35823582+35833583+ rc = sysfs_update_group(&cxlr->dev.kobj, &cxl_region_group);35843584+ if (rc)35853585+ return rc;3607358636083587 rc = insert_resource(cxlrd->res, res);36093588 if (rc) {