feat: remove waiter list
FF-A v1.1 deprecate FFA_MSG_SEND ABI and the notification feature in
case of busy receiver.
Change-Id: I30ad97930f872ac097d398085621d1e3e2bee15f
Signed-off-by: Federico Recanati <federico.recanati@arm.com>
diff --git a/src/api.c b/src/api.c
index b4055ed..1e1f781 100644
--- a/src/api.c
+++ b/src/api.c
@@ -187,32 +187,12 @@
}
/**
- * Checks whether the given `to` VM's mailbox is currently busy, and optionally
- * registers the `from` VM to be notified when it becomes available.
+ * Checks whether the given `to` VM's mailbox is currently busy.
*/
-static bool msg_receiver_busy(struct vm_locked to, struct vm *from, bool notify)
+static bool msg_receiver_busy(struct vm_locked to)
{
- if (to.vm->mailbox.state != MAILBOX_STATE_EMPTY ||
- to.vm->mailbox.recv == NULL) {
- /*
- * Fail if the receiver isn't currently ready to receive data,
- * setting up for notification if requested.
- */
- if (notify) {
- struct wait_entry *entry =
- vm_get_wait_entry(from, to.vm->id);
-
- /* Append waiter only if it's not there yet. */
- if (list_empty(&entry->wait_links)) {
- list_append(&to.vm->mailbox.waiter_list,
- &entry->wait_links);
- }
- }
-
- return true;
- }
-
- return false;
+ return to.vm->mailbox.state != MAILBOX_STATE_EMPTY ||
+ to.vm->mailbox.recv == NULL;
}
/**
@@ -369,7 +349,7 @@
uint32_t buffer_size;
struct ffa_value ret;
- if (msg_receiver_busy(vm_locked, NULL, false)) {
+ if (msg_receiver_busy(vm_locked)) {
/*
* Can't retrieve memory information if the mailbox is not
* available.
@@ -1044,6 +1024,8 @@
{
struct vm *vm = locked_vm.vm;
+ CHECK(list_empty(&vm->mailbox.waiter_list));
+
if (list_empty(&vm->mailbox.waiter_list)) {
/* No waiters, nothing else to do. */
return (struct ffa_value){.func = FFA_SUCCESS_32};
@@ -1538,8 +1520,7 @@
*/
struct ffa_value api_ffa_msg_send(ffa_vm_id_t sender_vm_id,
ffa_vm_id_t receiver_vm_id, uint32_t size,
- uint32_t attributes, struct vcpu *current,
- struct vcpu **next)
+ struct vcpu *current, struct vcpu **next)
{
struct vm *from = current->vm;
struct vm *to;
@@ -1548,8 +1529,6 @@
struct ffa_value ret;
struct vcpu_locked current_locked;
bool is_direct_request_ongoing;
- bool notify =
- (attributes & FFA_MSG_SEND_NOTIFY_MASK) == FFA_MSG_SEND_NOTIFY;
/* Ensure sender VM ID corresponds to the current VM. */
if (sender_vm_id != from->id) {
@@ -1601,7 +1580,7 @@
to_locked = vm_lock(to);
- if (msg_receiver_busy(to_locked, from, notify)) {
+ if (msg_receiver_busy(to_locked)) {
ret = ffa_error(FFA_BUSY);
goto out;
}
@@ -2893,7 +2872,7 @@
*/
struct two_vm_locked vm_to_from_lock = vm_lock_both(to, from);
- if (msg_receiver_busy(vm_to_from_lock.vm1, from, false)) {
+ if (msg_receiver_busy(vm_to_from_lock.vm1)) {
ret = ffa_error(FFA_BUSY);
goto out_unlock;
}
@@ -2981,7 +2960,7 @@
*/
memcpy_s(retrieve_request, message_buffer_size, to_msg, length);
- if (msg_receiver_busy(to_locked, NULL, false)) {
+ if (msg_receiver_busy(to_locked)) {
/*
* Can't retrieve memory information if the mailbox is not
* available.
@@ -3102,7 +3081,7 @@
to_locked = vm_lock(to);
- if (msg_receiver_busy(to_locked, NULL, false)) {
+ if (msg_receiver_busy(to_locked)) {
/*
* Can't retrieve memory information if the mailbox is not
* available.