Skip to content

Commit 376426b

Browse files
author
Marc Zyngier
committed
KVM: arm64: Fix address truncation in traces
Owing to their ARMv7 origins, the trace events are truncating most address values to 32bits. That's not really helpful. Expand the printing of such values to their full glory. Signed-off-by: Marc Zyngier <[email protected]>
1 parent 3fb884f commit 376426b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

arch/arm64/kvm/trace_arm.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TRACE_EVENT(kvm_entry,
2323
__entry->vcpu_pc = vcpu_pc;
2424
),
2525

26-
TP_printk("PC: 0x%08lx", __entry->vcpu_pc)
26+
TP_printk("PC: 0x%016lx", __entry->vcpu_pc)
2727
);
2828

2929
TRACE_EVENT(kvm_exit,
@@ -42,7 +42,7 @@ TRACE_EVENT(kvm_exit,
4242
__entry->vcpu_pc = vcpu_pc;
4343
),
4444

45-
TP_printk("%s: HSR_EC: 0x%04x (%s), PC: 0x%08lx",
45+
TP_printk("%s: HSR_EC: 0x%04x (%s), PC: 0x%016lx",
4646
__print_symbolic(__entry->ret, kvm_arm_exception_type),
4747
__entry->esr_ec,
4848
__print_symbolic(__entry->esr_ec, kvm_arm_exception_class),
@@ -69,7 +69,7 @@ TRACE_EVENT(kvm_guest_fault,
6969
__entry->ipa = ipa;
7070
),
7171

72-
TP_printk("ipa %#llx, hsr %#08lx, hxfar %#08lx, pc %#08lx",
72+
TP_printk("ipa %#llx, hsr %#08lx, hxfar %#08lx, pc %#016lx",
7373
__entry->ipa, __entry->hsr,
7474
__entry->hxfar, __entry->vcpu_pc)
7575
);
@@ -131,7 +131,7 @@ TRACE_EVENT(kvm_mmio_emulate,
131131
__entry->cpsr = cpsr;
132132
),
133133

134-
TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)",
134+
TP_printk("Emulate MMIO at: 0x%016lx (instr: %08lx, cpsr: %08lx)",
135135
__entry->vcpu_pc, __entry->instr, __entry->cpsr)
136136
);
137137

@@ -149,7 +149,7 @@ TRACE_EVENT(kvm_unmap_hva_range,
149149
__entry->end = end;
150150
),
151151

152-
TP_printk("mmu notifier unmap range: %#08lx -- %#08lx",
152+
TP_printk("mmu notifier unmap range: %#016lx -- %#016lx",
153153
__entry->start, __entry->end)
154154
);
155155

@@ -165,7 +165,7 @@ TRACE_EVENT(kvm_set_spte_hva,
165165
__entry->hva = hva;
166166
),
167167

168-
TP_printk("mmu notifier set pte hva: %#08lx", __entry->hva)
168+
TP_printk("mmu notifier set pte hva: %#016lx", __entry->hva)
169169
);
170170

171171
TRACE_EVENT(kvm_age_hva,
@@ -182,7 +182,7 @@ TRACE_EVENT(kvm_age_hva,
182182
__entry->end = end;
183183
),
184184

185-
TP_printk("mmu notifier age hva: %#08lx -- %#08lx",
185+
TP_printk("mmu notifier age hva: %#016lx -- %#016lx",
186186
__entry->start, __entry->end)
187187
);
188188

@@ -198,7 +198,7 @@ TRACE_EVENT(kvm_test_age_hva,
198198
__entry->hva = hva;
199199
),
200200

201-
TP_printk("mmu notifier test age hva: %#08lx", __entry->hva)
201+
TP_printk("mmu notifier test age hva: %#016lx", __entry->hva)
202202
);
203203

204204
TRACE_EVENT(kvm_set_way_flush,

arch/arm64/kvm/trace_handle_exit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TRACE_EVENT(kvm_wfx_arm64,
2222
__entry->is_wfe = is_wfe;
2323
),
2424

25-
TP_printk("guest executed wf%c at: 0x%08lx",
25+
TP_printk("guest executed wf%c at: 0x%016lx",
2626
__entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
2727
);
2828

@@ -42,7 +42,7 @@ TRACE_EVENT(kvm_hvc_arm64,
4242
__entry->imm = imm;
4343
),
4444

45-
TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
45+
TP_printk("HVC at 0x%016lx (r0: 0x%016lx, imm: 0x%lx)",
4646
__entry->vcpu_pc, __entry->r0, __entry->imm)
4747
);
4848

@@ -135,7 +135,7 @@ TRACE_EVENT(trap_reg,
135135
__entry->write_value = write_value;
136136
),
137137

138-
TP_printk("%s %s reg %d (0x%08llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
138+
TP_printk("%s %s reg %d (0x%016llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
139139
);
140140

141141
TRACE_EVENT(kvm_handle_sys_reg,

0 commit comments

Comments
 (0)