firmware: arm_scmi: Account for SHMEM memory overhead
authorCristian Marussi <cristian.marussi@arm.com>
Mon, 28 Oct 2024 12:01:45 +0000 (12:01 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 28 Oct 2024 14:51:10 +0000 (14:51 +0000)
commit5c14f38893d0b9daefc2c53b8ccd1692c7ced07c
tree4b0008c36855d3a53882ffbe90da865e85e99890
parent2cd7f3db25feeb7c204e36df9f1bb13bea3a3a20
firmware: arm_scmi: Account for SHMEM memory overhead

Transports using shared memory have to consider the overhead due to the
layout area when determining the area effectively available for messages.

Till now, such definitions were ambiguos across the SCMI stack and the
overhead layout area was not considered at all.

Add proper checks in the shmem layer to validate the provided max_msg_size
against the effectively available memory area, less the layout.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20241028120151.1301177-2-cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/common.h
drivers/firmware/arm_scmi/driver.c
drivers/firmware/arm_scmi/shmem.c
drivers/firmware/arm_scmi/transports/mailbox.c
drivers/firmware/arm_scmi/transports/optee.c
drivers/firmware/arm_scmi/transports/smc.c