summaryrefslogtreecommitdiff
path: root/tools/testing/cxl/test/cxl.c
diff options
context:
space:
mode:
authorAlison Schofield <alison.schofield@intel.com>2023-11-26 16:09:30 -0800
committerDan Williams <dan.j.williams@intel.com>2023-11-29 17:23:03 -0800
commit0e33ac9c3ffe5e4f55c68345f44cea7fec2fe750 (patch)
treef1ccb82e9bb25656f0baecde351b062ef479c933 /tools/testing/cxl/test/cxl.c
parent5558b92e8d39e18aa19619be2ee37274e9592528 (diff)
cxl/memdev: Hold region_rwsem during inject and clear poison ops
Poison inject and clear are supported via debugfs where a privileged user can inject and clear poison to a device physical address. Commit 458ba8189cb4 ("cxl: Add cxl_decoders_committed() helper") added a lockdep assert that highlighted a gap in poison inject and clear functions where holding the dpa_rwsem does not assure that a a DPA is not added to a region. The impact for inject and clear is that if the DPA address being injected or cleared has been attached to a region, but not yet committed, the dev_dbg() message intended to alert the debug user that they are acting on a mapped address is not emitted. Also, the cxl_poison trace event that serves as a log of the inject and clear activity will not include region info. Close this gap by snapshotting an unchangeable region state during poison inject and clear operations. That means holding both the region_rwsem and the dpa_rwsem during the inject and clear ops. Fixes: d2fbc4865802 ("cxl/memdev: Add support for the Inject Poison mailbox command") Fixes: 9690b07748d1 ("cxl/memdev: Add support for the Clear Poison mailbox command") Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/08721dc1df0a51e4e38fecd02425c3475912dfd5.1701041440.git.alison.schofield@intel.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