@@ -457,7 +457,7 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id,
457
457
memcpy (buf , host_buffers .tx , fraglen );
458
458
459
459
ep_mem_access = (void * )buf +
460
- ffa_mem_desc_offset (buf , 0 , FFA_VERSION_1_0 );
460
+ ffa_mem_desc_offset (buf , 0 , hyp_ffa_version );
461
461
offset = ep_mem_access -> composite_off ;
462
462
if (!offset || buf -> ep_count != 1 || buf -> sender_id != HOST_FFA_ID ) {
463
463
ret = FFA_RET_INVALID_PARAMETERS ;
@@ -536,7 +536,7 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res,
536
536
fraglen = res -> a2 ;
537
537
538
538
ep_mem_access = (void * )buf +
539
- ffa_mem_desc_offset (buf , 0 , FFA_VERSION_1_0 );
539
+ ffa_mem_desc_offset (buf , 0 , hyp_ffa_version );
540
540
offset = ep_mem_access -> composite_off ;
541
541
/*
542
542
* We can trust the SPMD to get this right, but let's at least
@@ -844,7 +844,7 @@ int hyp_ffa_init(void *pages)
844
844
if (kvm_host_psci_config .smccc_version < ARM_SMCCC_VERSION_1_2 )
845
845
return 0 ;
846
846
847
- arm_smccc_1_1_smc (FFA_VERSION , FFA_VERSION_1_0 , 0 , 0 , 0 , 0 , 0 , 0 , & res );
847
+ arm_smccc_1_1_smc (FFA_VERSION , FFA_VERSION_1_1 , 0 , 0 , 0 , 0 , 0 , 0 , & res );
848
848
if (res .a0 == FFA_RET_NOT_SUPPORTED )
849
849
return 0 ;
850
850
@@ -864,7 +864,11 @@ int hyp_ffa_init(void *pages)
864
864
if (FFA_MAJOR_VERSION (res .a0 ) != 1 )
865
865
return - EOPNOTSUPP ;
866
866
867
- hyp_ffa_version = FFA_VERSION_1_0 ;
867
+ if (FFA_MINOR_VERSION (res .a0 ) < FFA_MINOR_VERSION (FFA_VERSION_1_1 ))
868
+ hyp_ffa_version = res .a0 ;
869
+ else
870
+ hyp_ffa_version = FFA_VERSION_1_1 ;
871
+
868
872
tx = pages ;
869
873
pages += KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE ;
870
874
rx = pages ;
0 commit comments