WSL2-Linux-Kernel/drivers/cxl/core
Fan Ni f04facfb99 cxl/region: Fix memdev reuse check
Due to a typo, the check of whether or not a memdev has already been
used as a target for the region (above code piece) will always be
skipped. Given a memdev with more than one HDM decoder, an interleaved
region can be created that maps multiple HPAs to the same DPA. According
to CXL spec 3.0 8.1.3.8.4, "Aliasing (mapping more than one Host
Physical Address (HPA) to a single Device Physical Address) is
forbidden."

Fix this by using existing iterator for memdev reuse check.

Cc: <stable@vger.kernel.org>
Fixes: 384e624bb2 ("cxl/region: Attach endpoint decoders")
Signed-off-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/20221107212153.745993-1-fan.ni@samsung.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2022-12-08 13:03:47 -08:00
..
Makefile cxl/region: Add region creation support 2022-07-21 17:19:25 -07:00
core.h cxl/mem: Move devm_cxl_add_endpoint() from cxl_core to cxl_mem 2022-12-05 10:32:26 -08:00
hdm.c cxl: update names for interleave ways conversion macros 2022-12-05 18:17:16 -08:00
mbox.c cxl/security: Drop security command ioctl uapi 2022-12-06 14:36:02 -08:00
memdev.c cxl/pci: Add (hopeful) error handling support 2022-12-03 13:40:17 -08:00
pci.c Merge branch 'for-6.2/cxl-aer' into for-6.2/cxl 2022-12-05 12:31:30 -08:00
pmem.c Merge branch 'for-6.2/cxl-security' into for-6.2/cxl 2022-12-05 12:30:38 -08:00
port.c Merge branch 'for-6.2/cxl-xor' into for-6.2/cxl 2022-12-05 12:32:11 -08:00
region.c cxl/region: Fix memdev reuse check 2022-12-08 13:03:47 -08:00
regs.c cxl/regs: Fix sparse warning 2022-12-05 12:33:20 -08:00
suspend.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00