chore(dlog): fix uses of `dlog` to use new format strings
Now that uses of `dlog` are checked at compile-time, many incorrect uses
of format strings are diagnosed by the compiler. This commit fixes all
of them.
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
Change-Id: I22515a45a264ae3480df8fe360ccee591fc12284
diff --git a/src/api.c b/src/api.c
index 0affad1..aa97f79 100644
--- a/src/api.c
+++ b/src/api.c
@@ -806,7 +806,7 @@
if (vm_count == 0 || vm_count > ARRAY_SIZE(partitions)) {
dlog_verbose(
"Invalid parameters. vm_count = %d (must not be zero "
- "or > %d)\n",
+ "or > %lu)\n",
vm_count, ARRAY_SIZE(partitions));
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1585,7 +1585,7 @@
/* Hafnium only supports a fixed size of RX/TX buffers. */
if (page_count != HF_MAILBOX_SIZE / FFA_PAGE_SIZE) {
- dlog_error("%s: Page count must be %d, it is %d\n", __func__,
+ dlog_error("%s: Page count must be %zu, it is %d\n", __func__,
HF_MAILBOX_SIZE / FFA_PAGE_SIZE, page_count);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3241,7 +3241,7 @@
*/
if (fragment_length_v1_1 > MM_PPOOL_ENTRY_SIZE) {
dlog_verbose(
- "Translation of FF-A v1.0 descriptors for over %u is "
+ "Translation of FF-A v1.0 descriptors for over %lu is "
"unsupported.",
MM_PPOOL_ENTRY_SIZE);
return ffa_error(FFA_NOT_SUPPORTED);
@@ -3405,7 +3405,7 @@
memory_region->memory_access_desc_size) {
dlog_verbose(
"Initial fragment length %d smaller than header size "
- "%d.\n",
+ "%lu.\n",
fragment_length,
sizeof(struct ffa_memory_region) +
memory_region->memory_access_desc_size);
@@ -3746,7 +3746,7 @@
if (fragment_length > HF_MAILBOX_SIZE ||
fragment_length > MM_PPOOL_ENTRY_SIZE) {
dlog_verbose(
- "Fragment length %d larger than mailbox size %d.\n",
+ "Fragment length %d larger than mailbox size %zu.\n",
fragment_length, HF_MAILBOX_SIZE);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -3906,7 +3906,7 @@
}
if (notifications == 0U) {
- dlog_verbose("No notifications have been specified %x.\n",
+ dlog_verbose("No notifications have been specified %lx.\n",
notifications);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -3943,7 +3943,7 @@
receiver_locked, ffa_is_vm_id(sender_vm_id), id_to_validate,
notifications)) {
dlog_verbose(
- "Sender %x not permitted to set notifications %x to "
+ "Sender %x not permitted to set notifications %lx to "
"%x.\n",
sender_vm_id, notifications, receiver_vm_id);
ret = ffa_error(FFA_DENIED);
@@ -3957,7 +3957,7 @@
if (vm_are_notifications_pending(receiver_locked,
ffa_is_vm_id(sender_vm_id),
notifications)) {
- dlog_verbose("Notifications within '%x' pending.\n",
+ dlog_verbose("Notifications within '%lx' pending.\n",
notifications);
ret = ffa_error(FFA_DENIED);
goto out;
@@ -4043,7 +4043,7 @@
if (vm_notifications_validate_binding(
receiver_locked, ffa_is_vm_id(sender_vm_id), sender_vm_id,
notifications, !is_per_vcpu)) {
- dlog_verbose("Notifications in %x are %s\n", notifications,
+ dlog_verbose("Notifications in %lx are %s\n", notifications,
!is_per_vcpu ? "global" : "per-vCPU");
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -4072,7 +4072,7 @@
receiver_locked, ffa_is_vm_id(sender_vm_id), notifications,
vcpu_id, is_per_vcpu);
- dlog_verbose("Set the notifications: %x.\n", notifications);
+ dlog_verbose("Set the notifications: %lx.\n", notifications);
if ((FFA_NOTIFICATIONS_FLAG_DELAY_SRI & flags) == 0) {
dlog_verbose("SRI was NOT delayed. vcpu: %u!\n",
@@ -4155,7 +4155,8 @@
(receiver_locked.vm->vcpu_count != 1 &&
cpu_index(current->cpu) != vcpu_id)) {
dlog_verbose(
- "Invalid VCPU ID %u. vcpu count %u current core: %u!\n",
+ "Invalid VCPU ID %u. vcpu count %u current core: "
+ "%zu!\n",
vcpu_id, receiver_locked.vm->vcpu_count,
cpu_index(current->cpu));
ret = ffa_error(FFA_INVALID_PARAMETERS);
diff --git a/src/arch/aarch64/arm_smmuv3/arm_smmuv3.c b/src/arch/aarch64/arm_smmuv3/arm_smmuv3.c
index 80a951b..3e14ad7 100644
--- a/src/arch/aarch64/arm_smmuv3/arm_smmuv3.c
+++ b/src/arch/aarch64/arm_smmuv3/arm_smmuv3.c
@@ -375,7 +375,7 @@
smmuv3->prop.ias = ias_aarch32;
}
- dlog_verbose("SMMUv3: Input Addr: %d-bits, Output Addr: %d-bits\n",
+ dlog_verbose("SMMUv3: Input Addr: %lu-bits, Output Addr: %lu-bits\n",
smmuv3->prop.ias, smmuv3->prop.oas);
/*
@@ -695,7 +695,7 @@
static inline void push_entry_to_cmdq(uint64_t *cmdq_entry,
const uint64_t *cmd_dword)
{
- dlog_verbose("SMMUv3: Writing command to: %p\n", cmdq_entry);
+ dlog_verbose("SMMUv3: Writing command to: %p\n", (void *)cmdq_entry);
for (unsigned int i = 0; i < CMD_SIZE_DW; i++) {
cmdq_entry[i] = cmd_dword[i];
diff --git a/src/arch/aarch64/hftest/interrupts.c b/src/arch/aarch64/hftest/interrupts.c
index 967ca0c..3ce0c55 100644
--- a/src/arch/aarch64/hftest/interrupts.c
+++ b/src/arch/aarch64/hftest/interrupts.c
@@ -43,10 +43,10 @@
switch (esr >> 26) {
case 0x25: /* EC = 100101, Data abort. */
- dlog("Data abort: pc=%#x, esr=%#x, ec=%#x", elr, esr,
+ dlog("Data abort: pc=%#lx, esr=%#lx, ec=%#lx", elr, esr,
esr >> 26);
if (!(esr & (1U << 10))) { /* Check FnV bit. */
- dlog(", far=%#x", read_msr(far_el1));
+ dlog(", far=%#lx", read_msr(far_el1));
} else {
dlog(", far=invalid");
}
@@ -55,8 +55,8 @@
break;
default:
- dlog("Unknown current sync exception pc=%#x, esr=%#x, "
- "ec=%#x\n",
+ dlog("Unknown current sync exception pc=%#lx, esr=%#lx, "
+ "ec=%#lx\n",
elr, esr, esr >> 26);
}
diff --git a/src/arch/aarch64/hftest/interrupts_gicv3.c b/src/arch/aarch64/hftest/interrupts_gicv3.c
index 9b581e7..ea87b1d 100644
--- a/src/arch/aarch64/hftest/interrupts_gicv3.c
+++ b/src/arch/aarch64/hftest/interrupts_gicv3.c
@@ -44,14 +44,13 @@
}
/* Put interrupts into non-secure group 1. */
- dlog_info("GICR_IGROUPR0 was %x\n", 0xffffffff,
- io_read32(GICR_IGROUPR0));
+ dlog_info("GICR_IGROUPR0 was %x\n", io_read32(GICR_IGROUPR0));
io_write32(GICR_IGROUPR0, 0xffffffff);
dlog_info("wrote %x to GICR_IGROUPR0, got back %x\n", 0xffffffff,
io_read32(GICR_IGROUPR0));
/* Enable non-secure group 1. */
write_msr(ICC_IGRPEN1_EL1, 0x00000001);
- dlog_info("wrote %x to ICC_IGRPEN1_EL1, got back %x\n", 0x00000001,
+ dlog_info("wrote %x to ICC_IGRPEN1_EL1, got back %lx\n", 0x00000001,
read_msr(ICC_IGRPEN1_EL1));
}
diff --git a/src/arch/aarch64/hftest/mm.c b/src/arch/aarch64/hftest/mm.c
index 253559b..c419820 100644
--- a/src/arch/aarch64/hftest/mm.c
+++ b/src/arch/aarch64/hftest/mm.c
@@ -48,7 +48,7 @@
/* Check the physical address range. */
if (!pa_bits) {
dlog_error(
- "Unsupported value of id_aa64mmfr0_el1.PARange: %x\n",
+ "Unsupported value of id_aa64mmfr0_el1.PARange: %lx\n",
pa_range);
return false;
}
diff --git a/src/arch/aarch64/hypervisor/debug_el1.c b/src/arch/aarch64/hypervisor/debug_el1.c
index 484c544..214edee 100644
--- a/src/arch/aarch64/hypervisor/debug_el1.c
+++ b/src/arch/aarch64/hypervisor/debug_el1.c
@@ -163,8 +163,8 @@
value = vcpu->regs.r[rt_register];
dlog_notice(
"Unsupported debug system register read: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, "
- "rt=%d.\n",
+ "op0=%lu, op1=%lu, crn=%lu, crm=%lu, op2=%lu, "
+ "rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr),
GET_ISS_CRN(esr), GET_ISS_CRM(esr),
GET_ISS_OP2(esr), GET_ISS_RT(esr));
@@ -190,8 +190,8 @@
default:
dlog_notice(
"Unsupported debug system register write: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, "
- "rt=%d.\n",
+ "op0=%lu, op1=%lu, crn=%lu, crm=%lu, op2=%lu, "
+ "rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr),
GET_ISS_CRN(esr), GET_ISS_CRM(esr),
GET_ISS_OP2(esr), GET_ISS_RT(esr));
diff --git a/src/arch/aarch64/hypervisor/feature_id.c b/src/arch/aarch64/hypervisor/feature_id.c
index b57b3e6..02d4bc2 100644
--- a/src/arch/aarch64/hypervisor/feature_id.c
+++ b/src/arch/aarch64/hypervisor/feature_id.c
@@ -274,7 +274,8 @@
if (!ISS_IS_READ(esr)) {
dlog_notice(
"Unsupported feature ID register write: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, rt=%d.\n",
+ "op0=%lu, op1=%lu, crn=%lu, crm=%lu, op2=%lu, "
+ "rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr), GET_ISS_CRN(esr),
GET_ISS_CRM(esr), GET_ISS_OP2(esr), GET_ISS_RT(esr));
return true;
@@ -292,7 +293,8 @@
value = 0;
dlog_notice(
"Unsupported feature ID register read: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, rt=%d.\n",
+ "op0=%lu, op1=%lu, crn=%lu, crm=%lu, op2=%lu, "
+ "rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr), GET_ISS_CRN(esr),
GET_ISS_CRM(esr), GET_ISS_OP2(esr), GET_ISS_RT(esr));
break;
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index cc3fa98..c4cb02b 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -254,8 +254,8 @@
/* Handle Granule Protection Fault. */
if (is_arch_feat_rme_supported() && dfsc == DFSC_GPF) {
dlog_verbose(
- "Granule Protection Fault: esr=%#x, ec=%#x, "
- "far=%#x, elr=%#x\n",
+ "Granule Protection Fault: esr=%#lx, ec=%#lx, "
+ "far=%#lx, elr=%#lx\n",
esr, ec, far, elr);
/*
@@ -282,21 +282,21 @@
if (!(esr & (1U << 10))) { /* Check FnV bit. */
dlog_error(
- "Data abort: pc=%#x, esr=%#x, ec=%#x, "
- "far=%#x\n",
+ "Data abort: pc=%#lx, esr=%#lx, ec=%#lx, "
+ "far=%#lx\n",
elr, esr, ec, far);
} else {
dlog_error(
- "Data abort: pc=%#x, esr=%#x, ec=%#x, "
+ "Data abort: pc=%#lx, esr=%#lx, ec=%#lx, "
"far=invalid\n",
elr, esr, ec);
}
} break;
default:
dlog_error(
- "Unknown current sync exception pc=%#x, esr=%#x, "
- "ec=%#x\n",
+ "Unknown current sync exception pc=%#lx, esr=%#lx, "
+ "ec=%#lx\n",
elr, esr, ec);
break;
}
@@ -428,7 +428,7 @@
default:
dlog_error(
"FF-A PSCI framework message not handled "
- "%#x %#x %#x %#x\n",
+ "%#lx %#lx %#lx %#lx\n",
args->func, args->arg1, args->arg2, args->arg3);
psci_msg_response = PSCI_ERROR_NOT_SUPPORTED;
}
@@ -453,7 +453,7 @@
return true;
}
default:
- dlog_error("FF-A framework message not handled %#x\n",
+ dlog_error("FF-A framework message not handled %#lx\n",
args->arg2);
/*
@@ -1078,8 +1078,9 @@
char *direction_str = ISS_IS_READ(esr_el2) ? "read" : "write";
dlog_notice(
- "Trapped access to system register %s: op0=%d, op1=%d, crn=%d, "
- "crm=%d, op2=%d, rt=%d.\n",
+ "Trapped access to system register %s: op0=%lu, op1=%lu, "
+ "crn=%lu, "
+ "crm=%lu, op2=%lu, rt=%lu.\n",
direction_str, GET_ISS_OP0(esr_el2), GET_ISS_OP1(esr_el2),
GET_ISS_CRN(esr_el2), GET_ISS_CRM(esr_el2),
GET_ISS_OP2(esr_el2), GET_ISS_RT(esr_el2));
@@ -1429,8 +1430,8 @@
default:
dlog_notice(
- "Unknown lower sync exception pc=%#x, esr=%#x, "
- "ec=%#x\n",
+ "Unknown lower sync exception pc=%#lx, esr=%#lx, "
+ "ec=%#lx\n",
vcpu->regs.pc, esr, ec);
break;
}
diff --git a/src/arch/aarch64/hypervisor/perfmon.c b/src/arch/aarch64/hypervisor/perfmon.c
index d4ac184..f28f135 100644
--- a/src/arch/aarch64/hypervisor/perfmon.c
+++ b/src/arch/aarch64/hypervisor/perfmon.c
@@ -180,8 +180,8 @@
dlog_notice(
"Unsupported performance monitor register "
"read: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, "
- "rt=%d.\n",
+ "op0=%lu, op1=%lu, crn=%lu, crm=%lu, op2=%lu, "
+ "rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr),
GET_ISS_CRN(esr), GET_ISS_CRM(esr),
GET_ISS_OP2(esr), GET_ISS_RT(esr));
@@ -207,9 +207,8 @@
default:
dlog_notice(
"Unsupported performance monitor register "
- "write: "
- "op0=%d, op1=%d, crn=%d, crm=%d, op2=%d, "
- "rt=%d.\n",
+ "write: op0=%lu, op1=%lu, crn=%lu, crm=%lu, "
+ "op2=%lu, rt=%lu.\n",
GET_ISS_OP0(esr), GET_ISS_OP1(esr),
GET_ISS_CRN(esr), GET_ISS_CRM(esr),
GET_ISS_OP2(esr), GET_ISS_RT(esr));
diff --git a/src/arch/aarch64/memory_protect/rme.c b/src/arch/aarch64/memory_protect/rme.c
index 001ad87..7c9a0c8 100644
--- a/src/arch/aarch64/memory_protect/rme.c
+++ b/src/arch/aarch64/memory_protect/rme.c
@@ -29,7 +29,7 @@
if (!is_arch_feat_rme_supported()) {
dlog_verbose(
"%s: memory protect services rely on RME feature. "
- "Memory is not protected %x\n",
+ "Memory is not protected %lx\n",
__func__, pa_addr(begin));
return ffa_error(FFA_NOT_SUPPORTED);
}
@@ -46,7 +46,7 @@
/* Denied the operation due to state of memory. */
paddr_t last_protected = pa_init(ret.arg1);
- dlog_verbose("%s: denied to update PAS. Last: %x\n", __func__,
+ dlog_verbose("%s: denied to update PAS. Last: %lx\n", __func__,
pa_addr(last_protected));
/* If PAS update failed from first region. */
diff --git a/src/arch/aarch64/mm.c b/src/arch/aarch64/mm.c
index dc2001e..a1d5977 100644
--- a/src/arch/aarch64/mm.c
+++ b/src/arch/aarch64/mm.c
@@ -791,7 +791,7 @@
/* Check the physical address range. */
if (!pa_bits) {
dlog_error(
- "Unsupported value of id_aa64mmfr0_el1.PARange: %x\n",
+ "Unsupported value of id_aa64mmfr0_el1.PARange: %lx\n",
pa_range);
return false;
}
diff --git a/src/arch/aarch64/plat/ffa/hypervisor.c b/src/arch/aarch64/plat/ffa/hypervisor.c
index d56e030..066eac0 100644
--- a/src/arch/aarch64/plat/ffa/hypervisor.c
+++ b/src/arch/aarch64/plat/ffa/hypervisor.c
@@ -281,9 +281,9 @@
* VM's requests should be forwarded to the SPMC, if receiver is an SP.
*/
if (!vm_id_is_current_world(receiver_vm_id)) {
- dlog_verbose("%s calling SPMC %#x %#x %#x %#x %#x\n", __func__,
- args.func, args.arg1, args.arg2, args.arg3,
- args.arg4);
+ dlog_verbose("%s calling SPMC %#lx %#lx %#lx %#lx %#lx\n",
+ __func__, args.func, args.arg1, args.arg2,
+ args.arg3, args.arg4);
if (args.func == FFA_MSG_SEND_DIRECT_REQ_64 ||
args.func == FFA_MSG_SEND_DIRECT_REQ_32) {
*ret = arch_other_world_call(args);
@@ -392,7 +392,7 @@
if (ffa_func_id(*ret) != FFA_SUCCESS_32) {
dlog_verbose(
"Failed forwarding FFA_MSG_SEND2_32 to the "
- "SPMC, got error (%d).\n",
+ "SPMC, got error (%lu).\n",
ret->arg2);
}
@@ -1373,7 +1373,7 @@
if (ret.arg3 != fragment_length) {
dlog_warning(
"%s: got unexpected fragment offset for %s "
- "from other world (expected %d, got %d)\n",
+ "from other world (expected %d, got %lu)\n",
__func__, ffa_func_name(FFA_MEM_FRAG_RX_32),
fragment_length, ret.arg3);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -1546,7 +1546,7 @@
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
- dlog_verbose("Unable to find share state for handle %#x.\n",
+ dlog_verbose("Unable to find share state for handle %#lx.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -1558,7 +1558,7 @@
if (vm_id_is_current_world(to_locked.vm->id) &&
to_locked.vm->id != memory_region->sender) {
dlog_verbose(
- "VM %#x attempted to reclaim memory handle %#x "
+ "VM %#x attempted to reclaim memory handle %#lx "
"originally sent by VM %#x.\n",
to_locked.vm->id, handle, memory_region->sender);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -1567,7 +1567,7 @@
if (!share_state->sending_complete) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"reclaim.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -1591,7 +1591,7 @@
/* Check that all VMs have relinquished. */
if (share_state->retrieved_fragment_count[i] != 0) {
dlog_verbose(
- "Tried to reclaim memory handle %#x "
+ "Tried to reclaim memory handle %#lx "
"that has not been relinquished by all "
"borrowers(%x).\n",
handle, receiver_permissions.receiver);
@@ -1650,7 +1650,7 @@
struct two_vm_locked vm_to_from_lock;
if (!ffa_tee_enabled) {
- dlog_verbose("Invalid handle %#x for FFA_MEM_RECLAIM.\n",
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_RECLAIM.\n",
handle);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1788,8 +1788,8 @@
dlog_verbose(
"other_world didn't successfully "
"complete "
- "memory send operation; returned %#x "
- "(%d). Rolling back.\n",
+ "memory send operation; returned %#lx "
+ "(%lu). Rolling back.\n",
ret.func, ret.arg2);
/*
@@ -1828,7 +1828,7 @@
dlog_verbose(
"other_world didn't successfully abort "
"failed memory send operation; "
- "returned %#x %d).\n",
+ "returned %#lx %lu).\n",
other_world_ret.func,
other_world_ret.arg2);
}
@@ -1854,9 +1854,9 @@
ffa_frag_sender(ret) != from_locked.vm->id) {
dlog_verbose(
"Got unexpected result from forwarding "
- "FFA_MEM_FRAG_TX to other_world: %#x (handle "
- "%#x, offset %d, sender %d); expected "
- "FFA_MEM_FRAG_RX (handle %#x, offset %d, "
+ "FFA_MEM_FRAG_TX to other_world: %#lx (handle "
+ "%#lx, offset %lu, sender %d); expected "
+ "FFA_MEM_FRAG_RX (handle %#lx, offset %d, "
"sender %d).\n",
ret.func, ffa_frag_handle(ret), ret.arg3,
ffa_frag_sender(ret), handle,
diff --git a/src/arch/aarch64/plat/ffa/spmc.c b/src/arch/aarch64/plat/ffa/spmc.c
index aac4788..b8f25ef 100644
--- a/src/arch/aarch64/plat/ffa/spmc.c
+++ b/src/arch/aarch64/plat/ffa/spmc.c
@@ -523,8 +523,9 @@
next_state);
break;
default:
- dlog_error("Illegal Runtime Model specified by SP%x on CPU%x\n",
- current->vm->id, cpu_index(current->cpu));
+ dlog_error(
+ "Illegal Runtime Model specified by SP%x on CPU%zx\n",
+ current->vm->id, cpu_index(current->cpu));
allowed = false;
break;
}
@@ -1163,7 +1164,7 @@
}
if (vm->vcpu_count > 1 && vcpu_idx != cpu_index(current->cpu)) {
- dlog_verbose("vcpu_idx (%d) != pcpu index (%d)\n", vcpu_idx,
+ dlog_verbose("vcpu_idx (%d) != pcpu index (%zu)\n", vcpu_idx,
cpu_index(current->cpu));
return false;
}
@@ -1933,7 +1934,7 @@
static void plat_ffa_send_schedule_receiver_interrupt(struct cpu *cpu)
{
- dlog_verbose("Setting Schedule Receiver SGI %u on core: %u\n",
+ dlog_verbose("Setting Schedule Receiver SGI %u on core: %zu\n",
HF_SCHEDULE_RECEIVER_INTID, cpu_index(cpu));
plat_interrupts_send_sgi(HF_SCHEDULE_RECEIVER_INTID, cpu, false);
@@ -2714,7 +2715,7 @@
(void)page_pool;
(void)to;
- dlog_verbose("Invalid handle %#x for FFA_MEM_RECLAIM.\n", handle);
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_RECLAIM.\n", handle);
return ffa_error(FFA_INVALID_PARAMETERS);
}
diff --git a/src/arch/aarch64/qemuloader/loader.c b/src/arch/aarch64/qemuloader/loader.c
index 111b79a..2dba808 100644
--- a/src/arch/aarch64/qemuloader/loader.c
+++ b/src/arch/aarch64/qemuloader/loader.c
@@ -104,7 +104,7 @@
panic("Invalid FW_CFG features.");
}
- dlog_info("Initrd start %#x, size %#x\n", initrd_start, initrd_size);
+ dlog_info("Initrd start %#lx, size %#x\n", initrd_start, initrd_size);
if (initrd_size != 0 &&
fw_cfg_read_dma(FW_CFG_INITRD_DATA, initrd_start, initrd_size)) {
panic("FW_CFG DMA failed.");
@@ -117,7 +117,7 @@
kernel_start = align_up(initrd_start + initrd_size, LINUX_ALIGNMENT) +
LINUX_OFFSET;
kernel_size = fw_cfg_read_uint32(FW_CFG_KERNEL_SIZE);
- dlog_info("Kernel start %#x, size %#x\n", kernel_start, kernel_size);
+ dlog_info("Kernel start %#lx, size %#x\n", kernel_start, kernel_size);
if (kernel_size == 0) {
panic("Invalid kernel size.");
}
diff --git a/src/arch/fake/hypervisor/other_world.c b/src/arch/fake/hypervisor/other_world.c
index 57df952..9e09a0c 100644
--- a/src/arch/fake/hypervisor/other_world.c
+++ b/src/arch/fake/hypervisor/other_world.c
@@ -14,6 +14,6 @@
struct ffa_value arch_other_world_call(struct ffa_value args)
{
- dlog_error("Attempted to call TEE function %#x\n", args.func);
+ dlog_error("Attempted to call TEE function %#lx\n", args.func);
return ffa_error(FFA_NOT_SUPPORTED);
}
diff --git a/src/fdt_handler.c b/src/fdt_handler.c
index 4d0496f..82ccf6f 100644
--- a/src/fdt_handler.c
+++ b/src/fdt_handler.c
@@ -157,9 +157,9 @@
++mem_range_index;
} else {
dlog_error(
- "Found %s range %u in FDT but only %u "
- "supported, ignoring additional range "
- "of size %u.\n",
+ "Found %s range %zu in FDT but only "
+ "%zu supported, ignoring additional "
+ "range of size %zu.\n",
string_data(device_type),
mem_range_index, mem_range_limit, len);
}
diff --git a/src/ffa_memory.c b/src/ffa_memory.c
index d188f3d..e60c402 100644
--- a/src/ffa_memory.c
+++ b/src/ffa_memory.c
@@ -277,10 +277,17 @@
return;
}
- dlog("from VM %#x, attributes %#x, flags %#x, handle %#x "
- "tag %u, memory access descriptor size %u, to %u "
+ dlog("from VM %#x, attributes (shareability = %s, cacheability = %s, "
+ "type = %s, security = %s), flags %#x, handle %#lx "
+ "tag %lu, memory access descriptor size %u, to %u "
"recipients [",
- memory_region->sender, memory_region->attributes,
+ memory_region->sender,
+ ffa_memory_shareability_name(
+ memory_region->attributes.shareability),
+ ffa_memory_cacheability_name(
+ memory_region->attributes.cacheability),
+ ffa_memory_type_name(memory_region->attributes.type),
+ ffa_memory_security_name(memory_region->attributes.security),
memory_region->flags, memory_region->handle, memory_region->tag,
memory_region->memory_access_desc_size,
memory_region->receiver_count);
@@ -290,15 +297,19 @@
if (i != 0) {
dlog(", ");
}
- dlog("Receiver %#x: %#x (offset %u)",
+ dlog("Receiver %#x: permissions (%s, %s) (offset %u)",
receiver->receiver_permissions.receiver,
- receiver->receiver_permissions.permissions,
+ ffa_data_access_name(receiver->receiver_permissions
+ .permissions.data_access),
+ ffa_instruction_access_name(
+ receiver->receiver_permissions.permissions
+ .instruction_access),
receiver->composite_memory_region_offset);
/* The impdef field is only present from v1.2 and later */
if (ffa_version_from_memory_access_desc_size(
memory_region->memory_access_desc_size) >=
MAKE_FFA_VERSION(1, 2)) {
- dlog(", impdef: %#x %#x", receiver->impdef.val[0],
+ dlog(", impdef: %#lx %#lx", receiver->impdef.val[0],
receiver->impdef.val[1]);
}
}
@@ -331,7 +342,7 @@
dlog("invalid share_func %#x",
share_states[i].share_func);
}
- dlog(" %#x (", share_states[i].memory_region->handle);
+ dlog(" %#lx (", share_states[i].memory_region->handle);
dump_memory_region(share_states[i].memory_region);
if (share_states[i].sending_complete) {
dlog("): fully sent");
@@ -432,9 +443,10 @@
*/
if (!vm_mem_get_mode(vm, begin, end, ¤t_mode)) {
dlog_verbose(
- "%s: constituent memory range %#x..%#x "
+ "%s: constituent memory range "
+ "%#lx..%#lx "
"not mapped with the same mode\n",
- __func__, begin, end);
+ __func__, begin.ipa, end.ipa);
return ffa_error(FFA_DENIED);
}
@@ -447,7 +459,7 @@
} else if (current_mode != *orig_mode) {
dlog_verbose(
"%s: expected mode %#x but was %#x for "
- "%d pages at %#x.\n",
+ "%d pages at %#lx.\n",
__func__, *orig_mode, current_mode,
fragments[i][j].page_count,
ipa_addr(begin));
@@ -624,9 +636,9 @@
if (receiver_v1_0->reserved_0 != 0) {
dlog_verbose(
"Reserved field in the memory access "
- " descriptor must be zero "
- " Currently reciever %d has a reserved "
- " field with a value of %d\n",
+ "descriptor must be zero. Currently "
+ "reciever %zu has a reserved field "
+ "with a value of %lu\n",
i, receiver_v1_0->reserved_0);
return false;
}
@@ -645,9 +657,9 @@
if (receiver->reserved_0 != 0) {
dlog_verbose(
"Reserved field in the memory access "
- " descriptor must be zero "
- " Currently reciever %d has a reserved "
- " field with a value of %d\n",
+ "descriptor must be zero. Currently "
+ "reciever %zu has a reserved field "
+ "with a value of %lu\n",
i, receiver->reserved_0);
return false;
}
@@ -657,8 +669,8 @@
composite_offset = receiver->composite_memory_region_offset;
if (composite_offset != composite_offset_0) {
dlog_verbose(
- "Composite offset %x differs from %x in index "
- "%u\n",
+ "Composite offset %x differs from %x in "
+ "index\n",
composite_offset, composite_offset_0);
return false;
}
@@ -975,7 +987,7 @@
if (!vm_identity_prepare(vm_locked, pa_begin, pa_end, mode, ppool)) {
dlog_verbose(
"%s: memory can't be mapped to %x due to lack of "
- "memory. Base: %lx end: %x\n",
+ "memory. Base: %lx end: %lx\n",
__func__, vm_locked.vm->id, pa_addr(pa_begin),
pa_addr(pa_end));
return ffa_error(FFA_NO_MEMORY);
@@ -1077,7 +1089,7 @@
pa_from_ipa(ipa_init(constituent->address));
paddr_t pa_end = pa_add(pa_begin, size);
- dlog_verbose("%s: reverting fragment %x size %x\n",
+ dlog_verbose("%s: reverting fragment %lx size %zx\n",
__func__, pa_addr(pa_begin), size);
if (constituent == end) {
@@ -1317,8 +1329,8 @@
if (current_size == 0 ||
current_size > UINT64_MAX - ipa_addr(current_begin)) {
- dlog_verbose("Invalid page count. Addr: %x page_count: %x\n",
- current_begin, current_page_count);
+ dlog_verbose("Invalid page count. Addr: %zx page_count: %x\n",
+ current_begin.ipa, current_page_count);
return false;
}
@@ -1333,9 +1345,9 @@
if (size == 0 || size > UINT64_MAX - ipa_addr(begin)) {
dlog_verbose(
- "Invalid page count. Addr: %x "
+ "Invalid page count. Addr: %lx "
"page_count: %x\n",
- begin, page_count);
+ begin.ipa, page_count);
return false;
}
@@ -1349,8 +1361,8 @@
is_memory_range_within(current_begin, current_end,
begin, end)) {
dlog_verbose(
- "Overlapping memory ranges: %#x - %#x "
- "with %#x - %#x\n",
+ "Overlapping memory ranges: %#lx - "
+ "%#lx with %#lx - %#lx\n",
ipa_addr(begin), ipa_addr(end),
ipa_addr(current_begin),
ipa_addr(current_end));
@@ -1853,9 +1865,8 @@
sizeof(struct ffa_composite_memory_region);
if (fragment_length < minimum_first_fragment_length) {
- dlog_verbose("Fragment length %u too short (min %u).\n",
- (size_t)fragment_length,
- minimum_first_fragment_length);
+ dlog_verbose("Fragment length %u too short (min %zu).\n",
+ fragment_length, minimum_first_fragment_length);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1874,7 +1885,7 @@
if (fragment_length > memory_share_length) {
dlog_verbose(
- "Fragment length %u greater than total length %u.\n",
+ "Fragment length %zu greater than total length %zu.\n",
(size_t)fragment_length, (size_t)memory_share_length);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1905,7 +1916,7 @@
sizeof(struct ffa_composite_memory_region) +
sizeof(struct ffa_memory_region_constituent);
if (min_length > memory_share_length) {
- dlog_verbose("Share too short: got %u but minimum is %u.\n",
+ dlog_verbose("Share too short: got %zu but minimum is %zu.\n",
(size_t)memory_share_length, (size_t)min_length);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1924,7 +1935,7 @@
fragment_length - sizeof(struct ffa_composite_memory_region))) {
dlog_verbose(
"Invalid composite memory region descriptor offset "
- "%u.\n",
+ "%zu.\n",
(size_t)composite_memory_region_offset);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -1949,7 +1960,7 @@
((constituents_length /
sizeof(struct ffa_memory_region_constituent)) !=
composite->constituent_count)) {
- dlog_verbose("Invalid length %u or composite offset %u.\n",
+ dlog_verbose("Invalid length %zu or composite offset %zu.\n",
(size_t)memory_share_length,
(size_t)composite_memory_region_offset);
return ffa_error(FFA_INVALID_PARAMETERS);
@@ -2156,7 +2167,7 @@
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
dlog_verbose(
- "Invalid handle %#x for memory send continuation.\n",
+ "Invalid handle %#lx for memory send continuation.\n",
handle);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -2170,7 +2181,7 @@
if (share_state->sending_complete) {
dlog_verbose(
- "Sending of memory handle %#x is already complete.\n",
+ "Sending of memory handle %#lx is already complete.\n",
handle);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -2181,7 +2192,7 @@
* probably be increased.
*/
dlog_warning(
- "Too many fragments for memory share with handle %#x; "
+ "Too many fragments for memory share with handle %#lx; "
"only %d supported.\n",
handle, MAX_FRAGMENTS);
/* Free share state, as it's not possible to complete it. */
@@ -2853,8 +2864,8 @@
dlog_verbose(
"Impdef value in memory send does not "
"match retrieve request value "
- "send value %#x %#x retrieve request "
- "value %#x %#x\n",
+ "send value %#lx %#lx retrieve request "
+ "value %#lx %#lx\n",
receiver->impdef.val[0],
receiver->impdef.val[1],
retrieve_request_receiver->impdef
@@ -2958,7 +2969,7 @@
if (retrieve_request->sender != memory_region->sender) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"retrieve.\n",
memory_region->handle);
return ffa_error(FFA_DENIED);
@@ -3010,7 +3021,7 @@
FFA_MEMORY_REGION_TRANSACTION_TYPE_MASK)) {
dlog_verbose(
"Incorrect transaction type %#x for "
- "FFA_MEM_RETRIEVE_REQ, expected %#x for handle %#x.\n",
+ "FFA_MEM_RETRIEVE_REQ, expected %#x for handle %#lx.\n",
transaction_type,
memory_region->flags &
FFA_MEMORY_REGION_TRANSACTION_TYPE_MASK,
@@ -3020,8 +3031,8 @@
if (retrieve_request->tag != memory_region->tag) {
dlog_verbose(
- "Incorrect tag %d for FFA_MEM_RETRIEVE_REQ, expected "
- "%d for handle %#x.\n",
+ "Incorrect tag %lu for FFA_MEM_RETRIEVE_REQ, expected "
+ "%lu for handle %#lx.\n",
retrieve_request->tag, memory_region->tag,
retrieve_request->handle);
return ffa_error(FFA_INVALID_PARAMETERS);
@@ -3033,7 +3044,7 @@
if (*receiver_index == memory_region->receiver_count) {
dlog_verbose(
"Incorrect receiver VM ID %d for "
- "FFA_MEM_RETRIEVE_REQ, for handle %#x.\n",
+ "FFA_MEM_RETRIEVE_REQ, for handle %#lx.\n",
to_id, memory_region->handle);
return ffa_error(FFA_INVALID_PARAMETERS);
}
@@ -3134,7 +3145,7 @@
if (!share_state->sending_complete) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"retrieve.\n",
handle);
return ffa_error(FFA_INVALID_PARAMETERS);
@@ -3267,7 +3278,7 @@
if (share_state->hypervisor_fragment_count != 0U) {
dlog_verbose(
- "Memory with handle %#x already retrieved by "
+ "Memory with handle %#lx already retrieved by "
"the hypervisor.\n",
handle);
return ffa_error(FFA_DENIED);
@@ -3332,7 +3343,7 @@
share_states = share_states_lock();
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
- dlog_verbose("Invalid handle %#x for FFA_MEM_RETRIEVE_REQ.\n",
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_RETRIEVE_REQ.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3426,7 +3437,7 @@
share_states = share_states_lock();
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
- dlog_verbose("Invalid handle %#x for FFA_MEM_FRAG_RX.\n",
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_FRAG_RX.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3437,7 +3448,7 @@
if (!share_state->sending_complete) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"retrieve.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -3461,7 +3472,8 @@
if (receiver_index == memory_region->receiver_count) {
dlog_verbose(
"Caller of FFA_MEM_FRAG_RX (%x) is not a "
- "borrower to memory sharing transaction (%x)\n",
+ "borrower to memory sharing transaction "
+ "(%lx)\n",
to_locked.vm->id, handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3472,7 +3484,7 @@
share_state->retrieved_fragment_count[receiver_index] >=
share_state->fragment_count) {
dlog_verbose(
- "Retrieval of memory with handle %#x not yet "
+ "Retrieval of memory with handle %#lx not yet "
"started or already completed (%d/%d fragments "
"retrieved).\n",
handle,
@@ -3490,7 +3502,7 @@
share_state->hypervisor_fragment_count >=
share_state->fragment_count) {
dlog_verbose(
- "Retrieve of memory with handle %x not "
+ "Retrieve of memory with handle %lx not "
"started from hypervisor.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -3500,7 +3512,7 @@
if (memory_region->sender != sender_vm_id) {
dlog_verbose(
"Sender ID (%x) is not as expected for memory "
- "handle %x\n",
+ "handle %lx\n",
sender_vm_id, handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3609,7 +3621,7 @@
share_states = share_states_lock();
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
- dlog_verbose("Invalid handle %#x for FFA_MEM_RELINQUISH.\n",
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_RELINQUISH.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3617,7 +3629,7 @@
if (!share_state->sending_complete) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"relinquish.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -3633,7 +3645,7 @@
if (receiver_index == memory_region->receiver_count) {
dlog_verbose(
"VM ID %d tried to relinquish memory region "
- "with handle %#x and it is not a valid borrower.\n",
+ "with handle %#lx and it is not a valid borrower.\n",
from_locked.vm->id, handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3642,7 +3654,7 @@
if (share_state->retrieved_fragment_count[receiver_index] !=
share_state->fragment_count) {
dlog_verbose(
- "Memory with handle %#x not yet fully "
+ "Memory with handle %#lx not yet fully "
"retrieved, "
"receiver %x can't relinquish.\n",
handle, from_locked.vm->id);
@@ -3734,7 +3746,7 @@
share_state = get_share_state(share_states, handle);
if (share_state == NULL) {
- dlog_verbose("Invalid handle %#x for FFA_MEM_RECLAIM.\n",
+ dlog_verbose("Invalid handle %#lx for FFA_MEM_RECLAIM.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
goto out;
@@ -3746,7 +3758,7 @@
if (vm_id_is_current_world(to_locked.vm->id) &&
to_locked.vm->id != memory_region->sender) {
dlog_verbose(
- "VM %#x attempted to reclaim memory handle %#x "
+ "VM %#x attempted to reclaim memory handle %#lx "
"originally sent by VM %#x.\n",
to_locked.vm->id, handle, memory_region->sender);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -3755,7 +3767,7 @@
if (!share_state->sending_complete) {
dlog_verbose(
- "Memory with handle %#x not fully sent, can't "
+ "Memory with handle %#lx not fully sent, can't "
"reclaim.\n",
handle);
ret = ffa_error(FFA_INVALID_PARAMETERS);
@@ -3765,7 +3777,7 @@
for (uint32_t i = 0; i < memory_region->receiver_count; i++) {
if (share_state->retrieved_fragment_count[i] != 0) {
dlog_verbose(
- "Tried to reclaim memory handle %#x "
+ "Tried to reclaim memory handle %#lx "
"that has not been relinquished by all "
"borrowers(%x).\n",
handle,
diff --git a/src/init.c b/src/init.c
index 371b77f..b536e04 100644
--- a/src/init.c
+++ b/src/init.c
@@ -104,7 +104,7 @@
}
for (i = 0; i < params->mem_ranges_count; ++i) {
- dlog_info("Memory range: %#x - %#x\n",
+ dlog_info("Memory range: %#lx - %#lx\n",
pa_addr(params->mem_ranges[i].begin),
pa_addr(params->mem_ranges[i].end) - 1);
}
@@ -117,7 +117,7 @@
* passed to Hafnium entry point is the manifest address.
*/
if (pa_addr(params->initrd_begin)) {
- dlog_info("Ramdisk range: %#x - %#x\n",
+ dlog_info("Ramdisk range: %#lx - %#lx\n",
pa_addr(params->initrd_begin),
pa_addr(params->initrd_end) - 1);
@@ -139,8 +139,9 @@
manifest_it = fdt.buf;
}
- dlog_verbose("Manifest range: %#x - %#x (%d bytes)\n", manifest_it.next,
- manifest_it.limit, manifest_it.limit - manifest_it.next);
+ dlog_verbose("Manifest range: %p - %p (%ld bytes)\n",
+ (void *)manifest_it.next, (void *)manifest_it.limit,
+ manifest_it.limit - manifest_it.next);
if (!is_aligned(manifest_it.next, 4)) {
panic("Manifest not aligned.");
}
diff --git a/src/load.c b/src/load.c
index 2021129..812a748 100644
--- a/src/load.c
+++ b/src/load.c
@@ -122,7 +122,7 @@
return false;
}
- dlog_verbose(" mailbox: send = %#x, recv = %#x\n",
+ dlog_verbose(" mailbox: send = %p, recv = %p\n",
vm_locked.vm->mailbox.send, vm_locked.vm->mailbox.recv);
return true;
@@ -401,7 +401,7 @@
goto out;
}
- dlog_info("Loaded primary VM with %u vCPUs, entry at %#x.\n",
+ dlog_info("Loaded primary VM with %u vCPUs, entry at %#lx.\n",
vm->vcpu_count, pa_addr(primary_begin));
/* Mark the first VM vCPU to be the first booted vCPU. */
@@ -448,8 +448,8 @@
if (allocated_size > fdt_max_size) {
dlog_error(
- "FDT allocated space (%u) is more than the specified "
- "maximum to use (%u).\n",
+ "FDT allocated space (%zu) is more than the specified "
+ "maximum to use (%zu).\n",
allocated_size, fdt_max_size);
return false;
}
@@ -457,7 +457,7 @@
/* Load the FDT to the end of the VM's allocated memory space. */
*fdt_addr = pa_init(pa_addr(pa_sub(end, allocated_size)));
- dlog_info("Loading secondary FDT of allocated size %u at 0x%x.\n",
+ dlog_info("Loading secondary FDT of allocated size %zu at 0x%lx.\n",
allocated_size, pa_addr(*fdt_addr));
if (!copy_to_unmapped(stage1_locked, *fdt_addr, &fdt, ppool)) {
@@ -601,8 +601,8 @@
return false;
}
- dlog_verbose("Memory region %#x - %#x allocated.\n",
- region_begin, region_end);
+ dlog_verbose("Memory region %#lx - %#lx allocated.\n",
+ pa_addr(region_begin), pa_addr(region_end));
j++;
}
@@ -798,7 +798,7 @@
goto out;
}
- dlog_info("Loaded with %u vCPUs, entry at %#x.\n",
+ dlog_info("Loaded with %u vCPUs, entry at %#lx.\n",
manifest_vm->secondary.vcpu_count, pa_addr(mem_begin));
vcpu = vm_get_vcpu(vm, 0);
@@ -1007,7 +1007,7 @@
}
dlog_info("Loading VM id %#x: %s.\n", vm_id,
- manifest_vm->debug_name);
+ manifest_vm->debug_name.data);
mem_size = align_up(manifest_vm->secondary.mem_size, PAGE_SIZE);
@@ -1021,7 +1021,8 @@
params->mem_ranges_count,
mem_size, &secondary_mem_begin,
&secondary_mem_end)) {
- dlog_error("Not enough memory (%u bytes).\n", mem_size);
+ dlog_error("Not enough memory (%lu bytes).\n",
+ mem_size);
continue;
}
diff --git a/src/manifest.c b/src/manifest.c
index b317fc8..628b137 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -428,7 +428,8 @@
}
if (uint32list_has_next(&smcs)) {
- dlog_warning("%s SMC whitelist too long.\n", vm->debug_name);
+ dlog_warning("%s SMC whitelist too long.\n",
+ vm->debug_name.data);
}
TRY(read_bool(node, "smc_whitelist_permissive",
@@ -502,7 +503,7 @@
PAGE_SIZE) /
PAGE_SIZE;
- dlog(" [%x - %x (%u pages)]\n", begin, end, page_count);
+ dlog(" [%lx - %lx (%zu pages)]\n", begin, end, page_count);
}
}
@@ -557,13 +558,14 @@
if (page_count == 0U) {
dlog_error(
- "Empty memory region defined with base address: %#x.\n",
+ "Empty memory region defined with base address: "
+ "%#lx.\n",
base_address);
return MANIFEST_ERROR_MEM_REGION_EMPTY;
}
if (!is_aligned(base_address, PAGE_SIZE)) {
- dlog_error("base_address (%#x) is not aligned to page size.\n",
+ dlog_error("base_address (%#lx) is not aligned to page size.\n",
base_address);
return MANIFEST_ERROR_MEM_REGION_UNALIGNED;
}
@@ -619,14 +621,14 @@
TRY(read_optional_uint64(mem_node, "base-address",
MANIFEST_INVALID_ADDRESS,
&mem_regions[i].base_address));
- dlog_verbose(" Base address: %#x\n",
+ dlog_verbose(" Base address: %#lx\n",
mem_regions[i].base_address);
TRY(read_optional_uint64(mem_node, "relative-address",
MANIFEST_INVALID_ADDRESS,
&relative_address));
if (relative_address != MANIFEST_INVALID_ADDRESS) {
- dlog_verbose(" Relative address: %#x\n",
+ dlog_verbose(" Relative address: %#lx\n",
relative_address);
}
@@ -838,7 +840,7 @@
TRY(read_uint64(dev_node, "base-address",
&dev_regions[i].base_address));
- dlog_verbose(" Base address: %#x\n",
+ dlog_verbose(" Base address: %#lx\n",
dev_regions[i].base_address);
TRY(read_uint32(dev_node, "pages-count",
@@ -960,7 +962,7 @@
assert(info != NULL);
info->mpidr = mpidr;
info->mpidr_valid = true;
- dlog_verbose(" MPIDR = %#x\n", mpidr);
+ dlog_verbose(" MPIDR = %#lx\n", mpidr);
}
}
@@ -1173,7 +1175,7 @@
if (!find_dma_device_id_from_dev_region_nodes(
vm, sid, &device_id)) {
dlog_verbose(
- "Stream ID not found in any device "
+ "Stream ID %d not found in any device "
"region node of partition manifest\n",
sid);
return false;
@@ -1255,11 +1257,11 @@
TRY(read_optional_uint64(&root, "load-address", 0,
&vm->partition.load_addr));
- dlog_verbose(" Load address %#x\n", vm->partition.load_addr);
+ dlog_verbose(" Load address %#lx\n", vm->partition.load_addr);
TRY(read_optional_uint64(&root, "entrypoint-offset", 0,
&vm->partition.ep_offset));
- dlog_verbose(" Entry point offset %#x\n", vm->partition.ep_offset);
+ dlog_verbose(" Entry point offset %#zx\n", vm->partition.ep_offset);
TRY(read_optional_uint32(&root, "gp-register-num",
DEFAULT_BOOT_GP_REGISTER,
@@ -1273,7 +1275,7 @@
TRY(read_optional_uint16(&root, "boot-order", DEFAULT_BOOT_ORDER,
&vm->partition.boot_order));
if (vm->partition.boot_order != DEFAULT_BOOT_ORDER) {
- dlog_verbose(" Boot order %#u\n", vm->partition.boot_order);
+ dlog_verbose(" Boot order %u\n", vm->partition.boot_order);
}
if (!check_boot_order(vm->partition.boot_order)) {
diff --git a/src/mm.c b/src/mm.c
index b05a344..5dc5805 100644
--- a/src/mm.c
+++ b/src/mm.c
@@ -574,7 +574,7 @@
continue;
}
- dlog("%*s%x: %x\n", 4 * (max_level - level), "", i,
+ dlog("%*s%lx: %lx\n", 4 * (max_level - level), "", i,
table->entries[i]);
if (arch_mm_pte_is_table(table->entries[i], level)) {
@@ -1109,13 +1109,13 @@
/* Locking is not enabled yet so fake it, */
struct mm_stage1_locked stage1_locked = mm_stage1_lock_unsafe();
- dlog_info("text: %#x - %#x\n", pa_addr(layout_text_begin()),
+ dlog_info("text: %#lx - %#lx\n", pa_addr(layout_text_begin()),
pa_addr(layout_text_end()));
- dlog_info("rodata: %#x - %#x\n", pa_addr(layout_rodata_begin()),
+ dlog_info("rodata: %#lx - %#lx\n", pa_addr(layout_rodata_begin()),
pa_addr(layout_rodata_end()));
- dlog_info("data: %#x - %#x\n", pa_addr(layout_data_begin()),
+ dlog_info("data: %#lx - %#lx\n", pa_addr(layout_data_begin()),
pa_addr(layout_data_end()));
- dlog_info("stacks: %#x - %#x\n", pa_addr(layout_stacks_begin()),
+ dlog_info("stacks: %#lx - %#lx\n", pa_addr(layout_stacks_begin()),
pa_addr(layout_stacks_end()));
/* ASID 0 is reserved for use by the hypervisor. */
diff --git a/src/vcpu.c b/src/vcpu.c
index 6c33be9..eb0edb0 100644
--- a/src/vcpu.c
+++ b/src/vcpu.c
@@ -188,11 +188,11 @@
if (!resume) {
dlog_warning(
- "Stage-%d page fault: pc=%#x, vmid=%#x, vcpu=%u, "
- "vaddr=%#x, ipaddr=%#x, mode=%#x %#x\n",
- current->vm->el0_partition ? 1 : 2, f->pc, vm->id,
- vcpu_index(current), f->vaddr, f->ipaddr, f->mode,
- mode);
+ "Stage-%d page fault: pc=%#lx, vmid=%#x, vcpu=%u, "
+ "vaddr=%#lx, ipaddr=%#lx, mode=%#x %#x\n",
+ current->vm->el0_partition ? 1 : 2, va_addr(f->pc),
+ vm->id, vcpu_index(current), va_addr(f->vaddr),
+ ipa_addr(f->ipaddr), f->mode, mode);
}
return resume;
diff --git a/test/hftest/power_mgmt.c b/test/hftest/power_mgmt.c
index e77dfb3..7ccfd10 100644
--- a/test/hftest/power_mgmt.c
+++ b/test/hftest/power_mgmt.c
@@ -101,7 +101,7 @@
/* Try to start the given CPU. */
if (!arch_cpu_start(id, &s_arch)) {
- HFTEST_LOG("Couldn't start cpu %u", id);
+ HFTEST_LOG("Couldn't start cpu %lu", id);
return false;
}
diff --git a/test/inc/test/hftest_impl.h b/test/inc/test/hftest_impl.h
index 7a70dd0..6dc3c41 100644
--- a/test/inc/test/hftest_impl.h
+++ b/test/inc/test/hftest_impl.h
@@ -20,12 +20,12 @@
#define HFTEST_MAX_TESTS 50
/*
- * Log with the HFTEST_LOG_PREFIX and a new line. The zero is added so there is
- * always at least one variadic argument.
+ * Log with the HFTEST_LOG_PREFIX and a new line. The newline is passed as
+ * an argument so there is always at least one variadic argument.
*/
-#define HFTEST_LOG(...) HFTEST_LOG_IMPL(__VA_ARGS__, 0)
+#define HFTEST_LOG(...) HFTEST_LOG_IMPL(__VA_ARGS__, "\n")
#define HFTEST_LOG_IMPL(format, ...) \
- dlog("%s" format "\n", HFTEST_LOG_PREFIX, __VA_ARGS__)
+ dlog(HFTEST_LOG_PREFIX format "%s", __VA_ARGS__)
/* Helper to wrap the argument in quotes. */
#define HFTEST_STR(str) #str
@@ -191,49 +191,46 @@
/* _Generic formatting doesn't seem to be supported so doing this manually. */
/* clang-format off */
-
-/*
- * dlog format specifier for types. Note, these aren't the standard specifiers
- * for the types.
- */
-#define hftest_dlog_format(x) \
- _Generic((x), \
- bool: "%u", \
- char: "%c", \
- signed char: "%d", \
- unsigned char: "%u", \
- signed short: "%d", \
- unsigned short: "%u", \
- signed int: "%d", \
- unsigned int: "%u", \
- signed long int: "%d", \
- unsigned long int: "%u", \
- signed long long int: "%d", \
- unsigned long long int: "%u")
-
-/* clang-format on */
-
#define HFTEST_LOG_FAILURE() \
dlog(HFTEST_LOG_PREFIX "Failure: %s:%u\n", __FILE__, __LINE__);
#ifdef HFTEST_OPTIMIZE_FOR_SIZE
#define HFTEST_LOG_ASSERT_DETAILS(lhs, rhs, op)
#else /* HFTEST_OPTIMIZE_FOR_SIZE */
-#define HFTEST_LOG_ASSERT_DETAILS(lhs, rhs, op) \
- do { \
- char lhs_fmt[] = HFTEST_LOG_PREFIX "lhs = %_ (%#x)\n"; \
- char rhs_fmt[] = HFTEST_LOG_PREFIX "rhs = %_ (%#x)\n"; \
- const size_t index = sizeof(HFTEST_LOG_PREFIX "lhs = %_") - 2; \
- lhs_fmt[index] = hftest_dlog_format(lhs)[1]; \
- rhs_fmt[index] = hftest_dlog_format(rhs)[1]; \
- dlog(HFTEST_LOG_PREFIX "assertion failed: `%s %s %s`\n", #lhs, \
- #op, #rhs); \
- dlog(lhs_fmt, lhs_value, lhs_value); \
- dlog(rhs_fmt, rhs_value, rhs_value); \
- dlog("\n"); \
+#define HFTEST_LOG_ASSERT_DETAILS(lhs, rhs, op) \
+ do { \
+ dlog(HFTEST_LOG_PREFIX "assertion failed: `%s %s %s`\n", #lhs, #op, #rhs); \
+ dlog(_Generic(lhs_value, \
+ bool: HFTEST_LOG_PREFIX "lhs = %hhu (%#02hhx)", \
+ char: HFTEST_LOG_PREFIX "lhs = '%c' (%#02hhx)", \
+ signed char: HFTEST_LOG_PREFIX "lhs = %hhd (%#02hhx)", \
+ unsigned char: HFTEST_LOG_PREFIX "lhs = %hhu (%#02hhx)", \
+ signed short: HFTEST_LOG_PREFIX "lhs = %hd (%#04hx)", \
+ unsigned short: HFTEST_LOG_PREFIX "lhs = %hu (%#04hx)", \
+ signed int: HFTEST_LOG_PREFIX "lhs = %d (%#08x)", \
+ unsigned int: HFTEST_LOG_PREFIX "lhs = %u (%#08x)", \
+ signed long: HFTEST_LOG_PREFIX "lhs = %ld (%#016lx)", \
+ unsigned long: HFTEST_LOG_PREFIX "lhs = %lu (%#016lx)", \
+ signed long long: HFTEST_LOG_PREFIX "lhs = %lld (%#016llx)", \
+ unsigned long long: HFTEST_LOG_PREFIX "lhs = %llu (%#016llx)" \
+ ), lhs_value, lhs_value); \
+ dlog(_Generic(rhs_value, \
+ bool: HFTEST_LOG_PREFIX "rhs = %hhu (%#02hhx)", \
+ char: HFTEST_LOG_PREFIX "rhs = '%c' (%#02hhx)", \
+ signed char: HFTEST_LOG_PREFIX "rhs = %hhd (%#02hhx)", \
+ unsigned char: HFTEST_LOG_PREFIX "rhs = %hhu (%#02hhx)", \
+ signed short: HFTEST_LOG_PREFIX "rhs = %hd (%#04hx)", \
+ unsigned short: HFTEST_LOG_PREFIX "rhs = %hu (%#04hx)", \
+ signed int: HFTEST_LOG_PREFIX "rhs = %d (%#08x)", \
+ unsigned int: HFTEST_LOG_PREFIX "rhs = %u (%#08x)", \
+ signed long: HFTEST_LOG_PREFIX "rhs = %ld (%#016lx)", \
+ unsigned long: HFTEST_LOG_PREFIX "rhs = %lu (%#016lx)", \
+ signed long long: HFTEST_LOG_PREFIX "rhs = %lld (%#016llx)", \
+ unsigned long long: HFTEST_LOG_PREFIX "rhs = %llu (%#016llx)" \
+ ), rhs_value, rhs_value); \
} while (0)
-
#endif /* HFTEST_OPTIMIZE_FOR_SIZE */
+/* clang-format on */
#ifdef HFTEST_OPTIMIZE_FOR_SIZE
#define HFTEST_LOG_ASSERT_STRING_DETAILS(lhs, rhs, op)
diff --git a/test/linux/linux.c b/test/linux/linux.c
index fdcf695..6022e2b 100644
--- a/test/linux/linux.c
+++ b/test/linux/linux.c
@@ -115,7 +115,7 @@
FAIL("Socket send() failed: %s", strerror(errno));
return;
}
- HFTEST_LOG("Packet with length %d sent.", send_len);
+ HFTEST_LOG("Packet with length %zu sent.", send_len);
/* Receive a response, which should be an echo of the sent packet. */
recv_len = recv(socket_id, resp_buf, sizeof(resp_buf) - 1, 0);
@@ -124,7 +124,7 @@
FAIL("Socket recv() failed: %s", strerror(errno));
return;
}
- HFTEST_LOG("Packet with length %d received.", recv_len);
+ HFTEST_LOG("Packet with length %zd received.", recv_len);
EXPECT_EQ(recv_len, send_len);
EXPECT_EQ(memcmp(send_buf, resp_buf, send_len), 0);
diff --git a/test/vmapi/arch/aarch64/gicv3/timer_secondary.c b/test/vmapi/arch/aarch64/gicv3/timer_secondary.c
index 66a4bb2..5451904 100644
--- a/test/vmapi/arch/aarch64/gicv3/timer_secondary.c
+++ b/test/vmapi/arch/aarch64/gicv3/timer_secondary.c
@@ -149,8 +149,8 @@
*/
if (ret.func != expected_code && ret.func != FFA_INTERRUPT_32) {
- FAIL("Expected run to return FFA_INTERRUPT or %#x, but "
- "got %#x",
+ FAIL("Expected run to return FFA_INTERRUPT or %#lx, but "
+ "got %#lx",
expected_code, ret.func);
}
@@ -164,7 +164,7 @@
if (expected_code == HF_FFA_RUN_WAIT_FOR_INTERRUPT ||
expected_code == FFA_MSG_WAIT_32) {
EXPECT_NE(ret.arg2, FFA_SLEEP_INDEFINITE);
- dlog("%d ns remaining\n", ret.arg2);
+ dlog("%lu ns remaining\n", ret.arg2);
}
ret = ffa_run(SERVICE_VM1, 0);
}
@@ -287,7 +287,7 @@
for (size_t i = 0; i < 20; ++i) {
ret = ffa_run(SERVICE_VM1, 0);
EXPECT_EQ(ret.func, HF_FFA_RUN_WAIT_FOR_INTERRUPT);
- dlog("Primary looping until timer fires; %d ns "
+ dlog("Primary looping until timer fires; %lu ns "
"remaining\n",
ret.arg2);
}
diff --git a/test/vmapi/common/ffa.c b/test/vmapi/common/ffa.c
index dca7d73..7dbca18 100644
--- a/test/vmapi/common/ffa.c
+++ b/test/vmapi/common/ffa.c
@@ -658,7 +658,7 @@
return;
}
- HFTEST_LOG("SP boot info (%x):", (uintptr_t)boot_info_header);
+ HFTEST_LOG("SP boot info (%lx):", (uintptr_t)boot_info_header);
HFTEST_LOG(" Signature: %x", boot_info_header->signature);
HFTEST_LOG(" Version: %x", boot_info_header->version);
HFTEST_LOG(" Blob Size: %u", boot_info_header->info_blob_size);
@@ -680,7 +680,7 @@
HFTEST_LOG(" Content Format: %x",
ffa_boot_info_content_format(&boot_info_desc[i]));
HFTEST_LOG(" Size: %u", boot_info_desc[i].size);
- HFTEST_LOG(" Value: %x", boot_info_desc[i].content);
+ HFTEST_LOG(" Value: %lx", boot_info_desc[i].content);
}
}
diff --git a/test/vmapi/ffa_both_worlds_el3_spmc/services/arch/aarch64/secure/message_loop.c b/test/vmapi/ffa_both_worlds_el3_spmc/services/arch/aarch64/secure/message_loop.c
index 3688ff3..6ea3250 100644
--- a/test/vmapi/ffa_both_worlds_el3_spmc/services/arch/aarch64/secure/message_loop.c
+++ b/test/vmapi/ffa_both_worlds_el3_spmc/services/arch/aarch64/secure/message_loop.c
@@ -47,7 +47,7 @@
default:
HFTEST_LOG_FAILURE();
HFTEST_LOG(HFTEST_LOG_INDENT
- "0x%x is not a valid command from %x\n",
+ "0x%lx is not a valid command from %x\n",
res.arg3, ffa_sender(res));
abort();
}
@@ -84,7 +84,7 @@
} else {
HFTEST_LOG_FAILURE();
HFTEST_LOG(HFTEST_LOG_INDENT
- "0x%x is not a valid function\n",
+ "0x%lx is not a valid function\n",
res.func);
abort();
}
diff --git a/test/vmapi/ffa_secure_partition_el3_spmc/secure_partition.c b/test/vmapi/ffa_secure_partition_el3_spmc/secure_partition.c
index 9491025..1eaaad7 100644
--- a/test/vmapi/ffa_secure_partition_el3_spmc/secure_partition.c
+++ b/test/vmapi/ffa_secure_partition_el3_spmc/secure_partition.c
@@ -281,7 +281,7 @@
ASSERT_TRUE(fdt_info != NULL);
- HFTEST_LOG("FF-A Manifest Address: %x", fdt_info->content);
+ HFTEST_LOG("FF-A Manifest Address: %lx", fdt_info->content);
// NOLINTNEXTLINE(performance-no-int-to-ptr)
fdt_ptr = (void*)fdt_info->content;
@@ -291,7 +291,7 @@
EXPECT_TRUE(fdt_is_compatible(&root, "arm,ffa-manifest-1.0"));
EXPECT_TRUE(fdt_read_number(&root, "ffa-version", &ffa_version));
- HFTEST_LOG("FF-A Version: %x", ffa_version);
+ HFTEST_LOG("FF-A Version: %lx", ffa_version);
ASSERT_EQ(ffa_version, FFA_VERSION_COMPILED);
}
diff --git a/test/vmapi/ffa_secure_partition_only/secure_partition.c b/test/vmapi/ffa_secure_partition_only/secure_partition.c
index 23c4c41..e2c2a85 100644
--- a/test/vmapi/ffa_secure_partition_only/secure_partition.c
+++ b/test/vmapi/ffa_secure_partition_only/secure_partition.c
@@ -431,7 +431,7 @@
ASSERT_TRUE(fdt_info != NULL);
- HFTEST_LOG("FF-A Manifest Address: %x", fdt_info->content);
+ HFTEST_LOG("FF-A Manifest Address: %lx", fdt_info->content);
// NOLINTNEXTLINE(performance-no-int-to-ptr)
fdt_ptr = (void*)fdt_info->content;
@@ -441,7 +441,7 @@
EXPECT_TRUE(fdt_is_compatible(&root, "arm,ffa-manifest-1.0"));
EXPECT_TRUE(fdt_read_number(&root, "ffa-version", &ffa_version));
- HFTEST_LOG("FF-A Version: %x", ffa_version);
+ HFTEST_LOG("FF-A Version: %lx", ffa_version);
ASSERT_EQ(ffa_version, MAKE_FFA_VERSION(1, 2));
}
diff --git a/test/vmapi/ffa_secure_partitions/dir_msg.c b/test/vmapi/ffa_secure_partitions/dir_msg.c
index f93cd18..68a90d7 100644
--- a/test/vmapi/ffa_secure_partitions/dir_msg.c
+++ b/test/vmapi/ffa_secure_partitions/dir_msg.c
@@ -158,13 +158,13 @@
uintptr_t id;
id = hftest_get_cpu_id(i);
- HFTEST_LOG("Booting CPU %u - %x", i, id);
+ HFTEST_LOG("Booting CPU %zu - %lx", i, id);
EXPECT_EQ(hftest_cpu_start(id, migrate_busy_up_sp,
(uintptr_t)&args),
true);
- HFTEST_LOG("Done with CPU %u", i);
+ HFTEST_LOG("Done with CPU %zu", i);
}
/*
diff --git a/test/vmapi/ffa_secure_partitions/notifications.c b/test/vmapi/ffa_secure_partitions/notifications.c
index d8be08b..b50e30e 100644
--- a/test/vmapi/ffa_secure_partitions/notifications.c
+++ b/test/vmapi/ffa_secure_partitions/notifications.c
@@ -200,7 +200,7 @@
sl_lock(&lock);
for (size_t i = 1; i < MAX_CPUS - 1; i++) {
- HFTEST_LOG("Notifications signaling VM to SP. Booting CPU %u.",
+ HFTEST_LOG("Notifications signaling VM to SP. Booting CPU %zu.",
i);
args.vcpu_id = i;
@@ -212,7 +212,7 @@
/* Wait for CPU to release the lock. */
sl_lock(&lock);
- HFTEST_LOG("Done with CPU %u\n", i);
+ HFTEST_LOG("Done with CPU %zu\n", i);
}
}
diff --git a/test/vmapi/ffa_secure_partitions/power_mgt.c b/test/vmapi/ffa_secure_partitions/power_mgt.c
index 0f8194f..e1feafb 100644
--- a/test/vmapi/ffa_secure_partitions/power_mgt.c
+++ b/test/vmapi/ffa_secure_partitions/power_mgt.c
@@ -139,7 +139,7 @@
sl_lock(&args.lock);
for (size_t i = 1; i < MAX_CPUS - 1; i++) {
- HFTEST_LOG("Booting CPU %u", i);
+ HFTEST_LOG("Booting CPU %zu", i);
/*
* If receiver is an S-EL0 partition it is expected to have one
@@ -155,7 +155,7 @@
/* Wait for CPU to release the lock. */
sl_lock(&args.lock);
- HFTEST_LOG("Done with CPU %u", i);
+ HFTEST_LOG("Done with CPU %zu", i);
}
}
diff --git a/test/vmapi/ffa_secure_partitions/secure_interrupts.c b/test/vmapi/ffa_secure_partitions/secure_interrupts.c
index 080183b..da0e171 100644
--- a/test/vmapi/ffa_secure_partitions/secure_interrupts.c
+++ b/test/vmapi/ffa_secure_partitions/secure_interrupts.c
@@ -547,7 +547,7 @@
cpu_id = hftest_get_cpu_id(i);
args.vcpu_id = i;
- HFTEST_LOG("Booting CPU %u - %x", i, cpu_id);
+ HFTEST_LOG("Booting CPU %u - %lx", i, cpu_id);
EXPECT_EQ(hftest_cpu_start(cpu_id, cpu_entry_sp_sleep_loop,
(uintptr_t)&args),
diff --git a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/el0/sp_helpers.c b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/el0/sp_helpers.c
index b44613a..3be711c 100644
--- a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/el0/sp_helpers.c
+++ b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/el0/sp_helpers.c
@@ -71,7 +71,7 @@
struct ffa_value handle_ffa_run(struct ffa_value res)
{
HFTEST_LOG_FAILURE();
- HFTEST_LOG(HFTEST_LOG_INDENT "0x%x is not a valid function\n",
+ HFTEST_LOG(HFTEST_LOG_INDENT "0x%lx is not a valid function\n",
res.func);
abort();
}
diff --git a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/message_loop.c b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/message_loop.c
index 6122c0f..f5d9081 100644
--- a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/message_loop.c
+++ b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/message_loop.c
@@ -26,7 +26,7 @@
} else {
HFTEST_LOG_FAILURE();
HFTEST_LOG(HFTEST_LOG_INDENT
- "0x%x is not a valid command from %x\n",
+ "0x%lx is not a valid command from %x\n",
res.arg4, ffa_sender(res));
abort();
}
@@ -133,7 +133,7 @@
default:
HFTEST_LOG_FAILURE();
HFTEST_LOG(HFTEST_LOG_INDENT
- "0x%x is not a valid command from %x\n",
+ "0x%lx is not a valid command from %x\n",
res.arg3, ffa_sender(res));
abort();
}
@@ -175,7 +175,7 @@
} else {
HFTEST_LOG_FAILURE();
HFTEST_LOG(HFTEST_LOG_INDENT
- "0x%x is not a valid function\n",
+ "0x%lx is not a valid function\n",
res.func);
abort();
}
diff --git a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/notifications.c b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/notifications.c
index 6da5bfe..d615774 100644
--- a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/notifications.c
+++ b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/notifications.c
@@ -59,7 +59,7 @@
struct ffa_value res;
ffa_id_t own_id = hf_vm_get_id();
- dlog_verbose("Unbind notifications %x, from sender: %x\n", bitmap,
+ dlog_verbose("Unbind notifications %lx, from sender: %x\n", bitmap,
notif_sender);
res = ffa_notification_unbind(notif_sender, own_id, bitmap);
diff --git a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/secure_interrupts.c b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/secure_interrupts.c
index 45debf2..55b1fda 100644
--- a/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/secure_interrupts.c
+++ b/test/vmapi/ffa_secure_partitions/services/arch/aarch64/secure/secure_interrupts.c
@@ -120,7 +120,7 @@
{
ffa_id_t own_id = hf_vm_get_id();
- HFTEST_LOG("Starting TWDOG: %u ms", time);
+ HFTEST_LOG("Starting TWDOG: %lu ms", time);
sp805_twdog_refresh();
sp805_twdog_start((time * ARM_SP805_TWDG_CLK_HZ) / 1000);
@@ -162,10 +162,8 @@
}
if (sp_resp_value(ret) != expected_resp || ret.arg4 != arg) {
- HFTEST_LOG(
- "Expected response %x and %x; "
- "Obtained %x and %x",
- expected_resp, arg, sp_resp_value(ret), ret.arg4);
+ HFTEST_LOG("Expected response %x and %x; Obtained %x and %lx",
+ expected_resp, arg, sp_resp_value(ret), ret.arg4);
return false;
}
@@ -193,7 +191,7 @@
time_lapsed = sp_sleep_active_wait(sleep_ms);
/* Lapsed time should be at least equal to sleep time. */
- HFTEST_LOG("Sleep complete: %u", time_lapsed);
+ HFTEST_LOG("Sleep complete: %lu", time_lapsed);
if (func == FFA_MSG_SEND_DIRECT_REQ2_64) {
uint64_t msg[] = {0, time_lapsed};
diff --git a/test/vmapi/primary_with_secondaries/no_fdt_secondary.c b/test/vmapi/primary_with_secondaries/no_fdt_secondary.c
index 193451f..f500402 100644
--- a/test/vmapi/primary_with_secondaries/no_fdt_secondary.c
+++ b/test/vmapi/primary_with_secondaries/no_fdt_secondary.c
@@ -23,8 +23,8 @@
const size_t expected_mem_size = 0x100000;
if (mem_size != expected_mem_size) {
- FAIL("Memory size passed to VM entry %u is not expected size of"
- "%u.",
+ FAIL("Memory size passed to VM entry %zu is not expected size "
+ "of %zu.",
mem_size, expected_mem_size);
}
}
diff --git a/test/vmapi/primary_with_secondaries/services/boot.c b/test/vmapi/primary_with_secondaries/services/boot.c
index 98c12e5..58ac758 100644
--- a/test/vmapi/primary_with_secondaries/services/boot.c
+++ b/test/vmapi/primary_with_secondaries/services/boot.c
@@ -141,7 +141,7 @@
uint64_t checksum = 0;
mem_region = &ctx->partition_manifest.mem_regions[i];
- HFTEST_LOG("Accessing memory: %#x - %u pages - %#x attributes",
+ HFTEST_LOG("Accessing memory: %#lx - %u pages - %#x attributes",
mem_region->base_address, mem_region->page_count,
mem_region->attributes);
diff --git a/test/vmapi/primary_with_secondaries/sysregs.h b/test/vmapi/primary_with_secondaries/sysregs.h
index 936bc17..b7874ae 100644
--- a/test/vmapi/primary_with_secondaries/sysregs.h
+++ b/test/vmapi/primary_with_secondaries/sysregs.h
@@ -13,7 +13,7 @@
#include "../msr.h"
#include "test/hftest.h"
-#define TRY_READ(REG) dlog(#REG "=%#x\n", read_msr(REG))
+#define TRY_READ(REG) dlog(#REG "=%#lx\n", read_msr(REG))
#define CHECK_READ(REG, VALUE) \
do { \