]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/acpi: Fix setup of memory resource in cxl_acpi_set_cache_size()
authorDave Jiang <dave.jiang@intel.com>
Fri, 10 Oct 2025 20:57:53 +0000 (13:57 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 14 Oct 2025 19:59:13 +0000 (12:59 -0700)
commit2e41e5a91a37202ff6743c3ae5329e106aeb1c6c
treec8cba7a3b7af977a4497c8a015a20dc3e4f99070
parenta375246fcf2bbdaeb1df7fa7ee5a8b884a89085e
cxl/acpi: Fix setup of memory resource in cxl_acpi_set_cache_size()

In order to compare the resource against the HMAT memory target,
the resource needs to be memory type. Change the DEFINE_RES()
macro to DEFINE_RES_MEM() in order to set the correct resource type.
hmat_get_extended_linear_cache_size() uses resource_contains()
internally. This causes a regression for platforms with the
extended linear cache enabled as the comparison always fails and the
cache size is not set. User visible impact is that when 'cxl list' is
issued, a CXL region with extended linear cache support will only
report half the size of the actual size. And this also breaks MCE
reporting of the memory region due to incorrect offset calculation
for the memory.

[dj: Fixup commit log suggested by djbw]
[dj: Fixup stable address for cc]

Fixes: 12b3d697c812 ("cxl: Remove core/acpi.c and cxl core dependency on ACPI")
Cc: stable@vger.kernel.org
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/acpi.c