cxl/mbox: Block immediate mode in SET_PARTITION_INFO command
authorAlison Schofield <alison.schofield@intel.com>
Thu, 31 Mar 2022 01:27:18 +0000 (18:27 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 Apr 2022 23:07:01 +0000 (16:07 -0700)
commit6179045ccc0c6229dc449afc1701dc7fbd40571f
tree06c502f75d0926a83ccf63dbe5e8415c8bb588dc
parent2dd5600a0e4e1aca8541e1c5bb2bc26bc0441d4d
cxl/mbox: Block immediate mode in SET_PARTITION_INFO command

User space may send the SET_PARTITION_INFO mailbox command using
the IOCTL interface. Inspect the input payload and fail if the
immediate flag is set.

This is the first instance of the driver inspecting an input payload
from user space. Assume there will be more such cases and implement
with an extensible helper.

In order for the kernel to react to an immediate partition change it
needs to assert that the change will not affect any active decode. At
a minimum this requires validating that the device is using HDM
decoders instead of the CXL DVSEC for decode, and that none of the
active HDM decoders are affected by the partition change. For now,
just fail until that support arrives.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/241821186c363833980adbc389e2c547bc5a6395.1648687552.git.alison.schofield@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h