Update VM ID print format to hexadecimal
Provided VM IDs are partitioned to non-secure and secure VM IDs (bit 15
clear/set), the VM ID print format looks nicer in the debug logs by
displaying an hexadecimal value rather than a decimal integer (one can
quickly determine if the mentioned ID is a VM or SP and get the ID from
the lower part of the value). This change updates print format strings
to use hex in place of decimal for VM IDs.
Change-Id: I1b957bf79fa824e7759ce88dc15e13cb72764aca
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index 53130f2..661647c 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -328,7 +328,8 @@
return;
}
- dlog("from VM %d, attributes %#x, flags %#x, handle %#x, tag %d, to %d "
+ dlog("from VM %#x, attributes %#x, flags %#x, handle %#x, tag %u, to "
+ "%u "
"recipients [",
memory_region->sender, memory_region->attributes,
memory_region->flags, memory_region->handle, memory_region->tag,
@@ -337,7 +338,7 @@
if (i != 0) {
dlog(", ");
}
- dlog("VM %d: %#x (offset %d)",
+ dlog("VM %#x: %#x (offset %u)",
memory_region->receivers[i].receiver_permissions.receiver,
memory_region->receivers[i]
.receiver_permissions.permissions,
@@ -2593,8 +2594,8 @@
if (to_locked.vm->id != memory_region->sender) {
dlog_verbose(
- "VM %d attempted to reclaim memory handle %#x "
- "originally sent by VM %d.\n",
+ "VM %#x attempted to reclaim memory handle %#x "
+ "originally sent by VM %#x.\n",
to_locked.vm->id, handle, memory_region->sender);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -2763,8 +2764,8 @@
/* The original sender must match the caller. */
if (to_locked.vm->id != memory_region->sender) {
dlog_verbose(
- "VM %d attempted to reclaim memory handle %#x "
- "originally sent by VM %d.\n",
+ "VM %#x attempted to reclaim memory handle %#x "
+ "originally sent by VM %#x.\n",
to_locked.vm->id, handle, memory_region->sender);
return ffa_error(FFA_INVALID_PARAMETERS);
}