fix: UUID field for PARTITION_INFO_GET
The EAC0 v1.1 FF-A spec now requires that the UUID field in the
partition information descriptors is only populated when
FFA_PARTITION_INFO_GET is supplied with a null uuid (Table 13.37).
This patch implements this change and updates the tests to check
for this.
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I221f2378655874c9e3ac17235f2529cafa9328e8
diff --git a/src/api.c b/src/api.c
index 019b719..c73e7d3 100644
--- a/src/api.c
+++ b/src/api.c
@@ -441,7 +441,7 @@
bool count_flag = (flags && FFA_PARTITION_COUNT_FLAG_MASK) ==
FFA_PARTITION_COUNT_FLAG;
bool uuid_is_null = ffa_uuid_is_null(uuid);
- struct ffa_partition_info partitions[2 * MAX_VMS];
+ struct ffa_partition_info partitions[2 * MAX_VMS] = {0};
struct vm_locked vm_locked;
struct ffa_value ret;
@@ -482,7 +482,9 @@
vm_are_notifications_enabled(vm)
? FFA_PARTITION_NOTIFICATION
: 0;
- partitions[array_index].uuid = vm->uuid;
+ if (uuid_is_null) {
+ partitions[array_index].uuid = vm->uuid;
+ }
}
}
}