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/api.c b/src/api.c
index 46d8a88..226b4e7 100644
--- a/src/api.c
+++ b/src/api.c
@@ -292,7 +292,7 @@
{
struct ffa_value ret = ffa_error(FFA_ABORTED);
- dlog_notice("Aborting VM %u vCPU %u\n", current->vm->id,
+ dlog_notice("Aborting VM %#x vCPU %u\n", current->vm->id,
vcpu_index(current));
if (current->vm->id == HF_PRIMARY_VM_ID) {
@@ -580,7 +580,7 @@
if (atomic_load_explicit(&vcpu->vm->aborting, memory_order_relaxed)) {
if (vcpu->state != VCPU_STATE_ABORTED) {
- dlog_notice("Aborting VM %u vCPU %u\n", vcpu->vm->id,
+ dlog_notice("Aborting VM %#x vCPU %u\n", vcpu->vm->id,
vcpu_index(vcpu));
vcpu->state = VCPU_STATE_ABORTED;
}
@@ -1518,9 +1518,9 @@
target_vcpu = vm_get_vcpu(target_vm, target_vcpu_idx);
- dlog_info("Injecting IRQ %d for VM %d vCPU %d from VM %d vCPU %d\n",
+ dlog_info("Injecting IRQ %u for VM %#x vCPU %u from VM %#x vCPU %u\n",
intid, target_vm_id, target_vcpu_idx, current->vm->id,
- current->cpu->id);
+ vcpu_index(current));
return internal_interrupt_inject(target_vcpu, intid, current, next);
}
@@ -1680,7 +1680,7 @@
if (atomic_load_explicit(&receiver_vcpu->vm->aborting,
memory_order_relaxed)) {
if (receiver_vcpu->state != VCPU_STATE_ABORTED) {
- dlog_notice("Aborting VM %u vCPU %u\n",
+ dlog_notice("Aborting VM %#x vCPU %u\n",
receiver_vcpu->vm->id,
vcpu_index(receiver_vcpu));
receiver_vcpu->state = VCPU_STATE_ABORTED;