Hi Olivier,
Thanks for the heads up. I've updated the manifest. Calling FFA_VERSION makes sense too, however I assumes it's not urgent with the manifest corrected.
Cheers, Jens
On Wed, Mar 22, 2023 at 12:30 PM Olivier Deprez Olivier.Deprez@arm.com wrote:
Hi Jens,
We're preparing for the Hafnium changes introducing FF-A v1.1 mem sharing structures, up to: https://review.trustedfirmware.org/c/hafnium/hafnium/+/17399
This is done in a backwards compatible manner, in which a FF-A v1.0 endpoint can still use former mem sharing struct definitions. The requirement is that the endpoint provides the right version either by its manifest, or by calling FFA_VERSION when booted. In order for this transition to happen smoothly it would require OP-TEE to declare the v1.0 version here: https://github.com/jenswi-linaro/build/blob/qemu_sel2/qemu_v8/optee_sp_manif...
or call FFA_VERSION first thing: diff --git a/core/arch/arm/kernel/thread_spmc.c b/core/arch/arm/kernel/thread_spmc.c index 240bcffe..893cb63b 100644 --- a/core/arch/arm/kernel/thread_spmc.c +++ b/core/arch/arm/kernel/thread_spmc.c @@ -1382,6 +1382,18 @@ static uint16_t spmc_get_id(void) return args.a2; }
+static uint16_t spmc_version(void) +{
struct thread_smc_args args = {
.a0 = FFA_VERSION,
.a1 = MAKE_FFA_VERSION(FFA_VERSION_MAJOR, FFA_VERSION_MINOR),
};
thread_smccc(&args);
return (uint16_t)args.a0;
+}
static struct ffa_mem_transaction *spmc_retrieve_req(uint64_t cookie) { struct ffa_mem_transaction *trans_descr = nw_rxtx.tx; @@ -1519,6 +1531,10 @@ out:
static TEE_Result spmc_init(void) {
DMSG("OP-TEE FF-A version %x, SPMC version %x",
MAKE_FFA_VERSION(FFA_VERSION_MAJOR, FFA_VERSION_MINOR),
spmc_version());
spmc_rxtx_map(&nw_rxtx); my_endpoint_id = spmc_get_id(); DMSG("My endpoint ID %#x", my_endpoint_id);
I also noticed PR #5359 introducing the v1.1 mem sharing structures, so this may be another way forward that I did not investigate. https://github.com/jenswi-linaro/optee_os/commit/ddd107f019386d035488e3b4e7c...
Let me know your opinions.
Regards, Olivier.