UPSTREAM: firmware: arm_ffa: Add interface to send a notification to a given partition

The framework provides an interface to the sender endpoint to specify
the notification to signal to the receiver endpoint. A sender signals
a notification by requesting its partition manager to set the
corresponding bit in the notifications bitmap of the receiver.

Expose the ability to send a notification to another partition.

(cherry picked from commit e5adb3b20e)

Bug: 335194469
Bug: 325404073
Bug: 278749606
Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-11-cddd3237809c@arm.com
Change-Id: I3cb2fcd9b1e9d3b6a588b01c70ad5f270a3c719b
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sebastian Ene <sebastianene@google.com>
This commit is contained in:
Sudeep Holla 2023-10-05 15:45:04 +01:00 committed by Sebastian Ene
parent 3000dcf09e
commit c78f532206
2 changed files with 15 additions and 0 deletions

View File

@ -1038,6 +1038,18 @@ static int ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu,
return rc; return rc;
} }
static int ffa_notify_send(struct ffa_device *dev, int notify_id,
bool is_per_vcpu, u16 vcpu)
{
u32 flags = 0;
if (is_per_vcpu)
flags |= (PER_VCPU_NOTIFICATION_FLAG | vcpu << 16);
return ffa_notification_set(dev->vm_id, drv_info->vm_id, flags,
BIT(notify_id));
}
static const struct ffa_info_ops ffa_drv_info_ops = { static const struct ffa_info_ops ffa_drv_info_ops = {
.api_version_get = ffa_api_version_get, .api_version_get = ffa_api_version_get,
.partition_info_get = ffa_partition_info_get, .partition_info_get = ffa_partition_info_get,
@ -1063,6 +1075,7 @@ static const struct ffa_notifier_ops ffa_drv_notifier_ops = {
.sched_recv_cb_unregister = ffa_sched_recv_cb_unregister, .sched_recv_cb_unregister = ffa_sched_recv_cb_unregister,
.notify_request = ffa_notify_request, .notify_request = ffa_notify_request,
.notify_relinquish = ffa_notify_relinquish, .notify_relinquish = ffa_notify_relinquish,
.notify_send = ffa_notify_send,
}; };
static const struct ffa_ops ffa_drv_ops = { static const struct ffa_ops ffa_drv_ops = {

View File

@ -404,6 +404,8 @@ struct ffa_notifier_ops {
int (*notify_request)(struct ffa_device *dev, bool per_vcpu, int (*notify_request)(struct ffa_device *dev, bool per_vcpu,
ffa_notifier_cb cb, void *cb_data, int notify_id); ffa_notifier_cb cb, void *cb_data, int notify_id);
int (*notify_relinquish)(struct ffa_device *dev, int notify_id); int (*notify_relinquish)(struct ffa_device *dev, int notify_id);
int (*notify_send)(struct ffa_device *dev, int notify_id, bool per_vcpu,
u16 vcpu);
}; };
struct ffa_ops { struct ffa_ops {