summaryrefslogtreecommitdiffstats
path: root/tools/testing/cxl/test/cxl.c
diff options
context:
space:
mode:
authorLi Zhijian <lizhijian@fujitsu.com>2023-10-25 16:54:50 +0800
committerDan Williams <dan.j.williams@intel.com>2023-10-27 13:04:51 -0700
commit3531b27f1f04a6bc9c95cf00d40efe618d57aa93 (patch)
treeeb8366b6567aa9143e73a6989817200bd5af5b31 /tools/testing/cxl/test/cxl.c
parent0cf36a85c1408f86a967fb1db721de1b89b9e675 (diff)
downloadlinux-stable-3531b27f1f04a6bc9c95cf00d40efe618d57aa93.tar.gz
linux-stable-3531b27f1f04a6bc9c95cf00d40efe618d57aa93.tar.bz2
linux-stable-3531b27f1f04a6bc9c95cf00d40efe618d57aa93.zip
cxl/region: Fix cxl_region_rwsem lock held when returning to user space
Fix a missed "goto out" to unlock on error to cleanup this splat: WARNING: lock held when returning to user space! 6.6.0-rc3-lizhijian+ #213 Not tainted ------------------------------------------------ cxl/673 is leaving the kernel with locks still held! 1 lock held by cxl/673: #0: ffffffffa013b9d0 (cxl_region_rwsem){++++}-{3:3}, at: commit_store+0x7d/0x3e0 [cxl_core] In terms of user visible impact of this bug for backports: cxl_region_invalidate_memregion() on x86 invokes wbinvd which is a problematic instruction for virtualized environments. So, on virtualized x86, cxl_region_invalidate_memregion() returns an error. This failure case got missed because CXL memory-expander device passthrough is not a production use case, and emulation of CXL devices is typically limited to kernel development builds with CONFIG_CXL_REGION_INVALIDATION_TEST=y, that makes cxl_region_invalidate_memregion() succeed. In other words, the expected exposure of this bug is limited to CXL subsystem development environments using QEMU that neglected CONFIG_CXL_REGION_INVALIDATION_TEST=y. Fixes: d1257d098a5a ("cxl/region: Move cache invalidation before region teardown, and before setup") Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20231025085450.2514906-1-lizhijian@fujitsu.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools/testing/cxl/test/cxl.c')
0 files changed, 0 insertions, 0 deletions