feat(ff-a): save partitions version during ffa_version
This will be useful later when we may need to consider the version
of a partition when structuring a response to certain FF-A functions.
Also add a call to FFA_VERSION during initialization of the hypervisor
so the SPMC knows the hypervisors implemented version.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: Ia8f5f8a9589300311a1e129536acce0948d5a6bc
diff --git a/src/api.c b/src/api.c
index 56b8bc2..de2bf5b 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1794,8 +1794,11 @@
}
/** Returns the version of the implemented FF-A specification. */
-struct ffa_value api_ffa_version(uint32_t requested_version)
+struct ffa_value api_ffa_version(struct vcpu *current,
+ uint32_t requested_version)
{
+ struct vm_locked current_vm_locked;
+
/*
* Ensure that both major and minor revision representation occupies at
* most 15 bits.
@@ -1809,6 +1812,10 @@
return (struct ffa_value){.func = (uint32_t)FFA_NOT_SUPPORTED};
}
+ current_vm_locked = vm_lock(current->vm);
+ current_vm_locked.vm->ffa_version = requested_version;
+ vm_unlock(¤t_vm_locked);
+
return ((struct ffa_value){.func = FFA_VERSION_COMPILED});
}