diff options
author | Dan Williams <dan.j.williams@intel.com> | 2022-12-06 05:22:33 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-12-06 23:36:02 +0100 |
commit | 5331cdf44dc389ac56f7ba5c24ca52d13eaad8d7 (patch) | |
tree | 715c526b4929cd25ddf0a9c94924cc174c122ebe /drivers/cxl/cxlmem.h | |
parent | cxl/security: Fix Get Security State output payload endian handling (diff) | |
download | linux-5331cdf44dc389ac56f7ba5c24ca52d13eaad8d7.tar.xz linux-5331cdf44dc389ac56f7ba5c24ca52d13eaad8d7.zip |
cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size
Internally cxl_mbox_send_cmd() converts all passed-in parameters to a
'struct cxl_mbox_cmd' instance and sends that to cxlds->mbox_send(). It
then teases the possibilty that the caller can validate the output size.
However, they cannot since the resulting output size is not conveyed to
the called. Fix that by making the caller pass in a constructed 'struct
cxl_mbox_cmd'. This prepares for a future patch to add output size
validation on a per-command basis.
Given the change in signature, also change the name to differentiate it
from the user command submission path that performs more validation
before generating the 'struct cxl_mbox_cmd' instance to execute.
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/167030055370.4044561.17788093375112783036.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/cxlmem.h')
-rw-r--r-- | drivers/cxl/cxlmem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h index 785c6c12515d..c447577f5ad5 100644 --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -430,8 +430,8 @@ enum { CXL_PMEM_SEC_PASS_USER, }; -int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, - size_t in_size, void *out, size_t out_size); +int cxl_internal_send_cmd(struct cxl_dev_state *cxlds, + struct cxl_mbox_cmd *cmd); int cxl_dev_state_identify(struct cxl_dev_state *cxlds); int cxl_await_media_ready(struct cxl_dev_state *cxlds); int cxl_enumerate_cmds(struct cxl_dev_state *cxlds); |