提交 f010c75c 编写于 作者: J Jonathan Cameron 提交者: Dan Williams

cxl/pmem: Fix failure to account for 8 byte header for writes to the device LSA.

Writes to the device must include an offset and size as defined in
CXL 2.0 8.2.9.5.2.4 Set LSA (Opcode 4103h)

Fixes tag is non obvious as this code has been through several
reworks and variable names + wasn't in use until the addition
of the region code.

Due to a bug in QEMU CXL emulation this overrun resulted in QEMU
crashing.
Reported-by: NBobo WL <lmw.bobo@gmail.com>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 60b8f172 ("cxl/pmem: Translate NVDIMM label commands to CXL label commands")
Link: https://lore.kernel.org/r/20220815154044.24733-3-Jonathan.Cameron@huawei.comSigned-off-by: NDan Williams <dan.j.williams@intel.com>
上级 2816e24b
...@@ -107,7 +107,7 @@ static int cxl_pmem_get_config_size(struct cxl_dev_state *cxlds, ...@@ -107,7 +107,7 @@ static int cxl_pmem_get_config_size(struct cxl_dev_state *cxlds,
*cmd = (struct nd_cmd_get_config_size) { *cmd = (struct nd_cmd_get_config_size) {
.config_size = cxlds->lsa_size, .config_size = cxlds->lsa_size,
.max_xfer = cxlds->payload_size, .max_xfer = cxlds->payload_size - sizeof(struct cxl_mbox_set_lsa),
}; };
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册