cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size
authorDan Williams <dan.j.williams@intel.com>
Tue, 6 Dec 2022 04:22:33 +0000 (20:22 -0800)
committerDan Williams <dan.j.williams@intel.com>
Tue, 6 Dec 2022 22:36:02 +0000 (14:36 -0800)
commit5331cdf44dc389ac56f7ba5c24ca52d13eaad8d7
tree715c526b4929cd25ddf0a9c94924cc174c122ebe
parentf5ee4cc19c3eff4459931b6fe8f29d1e0cc204a5
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>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h
drivers/cxl/pmem.c
drivers/cxl/security.c