Merge "fix(memory share): memory type not specified for mem lend"
diff --git a/tftf/tests/runtime_services/secure_service/spm_common.c b/tftf/tests/runtime_services/secure_service/spm_common.c
index 3c4d0dc..9359b8a 100644
--- a/tftf/tests/runtime_services/secure_service/spm_common.c
+++ b/tftf/tests/runtime_services/secure_service/spm_common.c
@@ -495,13 +495,21 @@
FFA_DATA_ACCESS_NOT_SPECIFIED :
FFA_DATA_ACCESS_RW;
+ /*
+ * Initialize memory region structure for the respective memory send
+ * operation. Note that memory type shall only be specified for memory
+ * share, for memory lend and memory donate these shall remain
+ * unspecified.
+ */
remaining_constituent_count = ffa_memory_region_init(
memory_region, memory_region_max_size, sender, receiver, constituents,
constituents_count, 0, 0, data_access,
FFA_INSTRUCTION_ACCESS_NOT_SPECIFIED,
- FFA_MEMORY_NORMAL_MEM, FFA_MEMORY_CACHE_WRITE_BACK,
- FFA_MEMORY_INNER_SHAREABLE, &total_length, &fragment_length
- );
+ mem_func == FFA_MEM_SHARE_SMC32
+ ? FFA_MEMORY_NORMAL_MEM
+ : FFA_MEMORY_NOT_SPECIFIED_MEM,
+ FFA_MEMORY_CACHE_WRITE_BACK, FFA_MEMORY_INNER_SHAREABLE,
+ &total_length, &fragment_length);
/*
* For simplicity of the test, and at least for the time being,
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c b/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
index ed2c7fe..f382ff3 100644
--- a/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
@@ -276,8 +276,8 @@
(struct ffa_memory_region *)mb.send, MAILBOX_SIZE, SENDER,
RECEIVER, constituents, constituents_count, 0,
FFA_MEMORY_REGION_FLAG_CLEAR, FFA_DATA_ACCESS_RW,
- FFA_INSTRUCTION_ACCESS_NOT_SPECIFIED, FFA_MEMORY_NORMAL_MEM,
- FFA_MEMORY_CACHE_WRITE_BACK, FFA_MEMORY_INNER_SHAREABLE,
+ FFA_INSTRUCTION_ACCESS_NOT_SPECIFIED,
+ FFA_MEMORY_NOT_SPECIFIED_MEM, 0, 0,
&total_length, &fragment_length);
if (remaining_constituent_count != 0) {