Skip to content

Commit 3b77809

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Remove debug tracepoints
The debug tracepoints are a useless firehose of information that track implementation detail rather than well-defined events. These are going to be rather difficult to uphold now that the implementation is getting redone, so throw them out instead of bending over backwards. Tested-by: James Clark <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] [maz: fixed compilation after trace-ectomy] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 58db67e commit 3b77809

File tree

3 files changed

+0
-120
lines changed

3 files changed

+0
-120
lines changed

arch/arm64/kvm/debug.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <asm/kvm_arm.h>
1515
#include <asm/kvm_emulate.h>
1616

17-
#include "trace.h"
1817

1918
/*
2019
* save/restore_guest_debug_regs
@@ -35,10 +34,6 @@ static void save_guest_debug_regs(struct kvm_vcpu *vcpu)
3534
u64 val = vcpu_read_sys_reg(vcpu, MDSCR_EL1);
3635

3736
vcpu->arch.guest_debug_preserved.mdscr_el1 = val;
38-
39-
trace_kvm_arm_set_dreg32("Saved MDSCR_EL1",
40-
vcpu->arch.guest_debug_preserved.mdscr_el1);
41-
4237
vcpu->arch.guest_debug_preserved.pstate_ss =
4338
(*vcpu_cpsr(vcpu) & DBG_SPSR_SS);
4439
}
@@ -49,9 +44,6 @@ static void restore_guest_debug_regs(struct kvm_vcpu *vcpu)
4944

5045
vcpu_write_sys_reg(vcpu, val, MDSCR_EL1);
5146

52-
trace_kvm_arm_set_dreg32("Restored MDSCR_EL1",
53-
vcpu_read_sys_reg(vcpu, MDSCR_EL1));
54-
5547
if (vcpu->arch.guest_debug_preserved.pstate_ss)
5648
*vcpu_cpsr(vcpu) |= DBG_SPSR_SS;
5749
else
@@ -110,8 +102,6 @@ static void kvm_arm_setup_mdcr_el2(struct kvm_vcpu *vcpu)
110102
write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2);
111103

112104
preempt_enable();
113-
114-
trace_kvm_arm_set_dreg32("MDCR_EL2", vcpu->arch.mdcr_el2);
115105
}
116106

117107
/**
@@ -158,8 +148,6 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu)
158148
{
159149
unsigned long mdscr;
160150

161-
trace_kvm_arm_setup_debug(vcpu, vcpu->guest_debug);
162-
163151
kvm_arm_setup_mdcr_el2(vcpu);
164152

165153
/* Check if we need to use the debug registers. */
@@ -209,8 +197,6 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu)
209197
vcpu_write_sys_reg(vcpu, mdscr, MDSCR_EL1);
210198
}
211199

212-
trace_kvm_arm_set_dreg32("SPSR_EL2", *vcpu_cpsr(vcpu));
213-
214200
/*
215201
* HW Breakpoints and watchpoints
216202
*
@@ -228,14 +214,6 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu)
228214
vcpu->arch.debug_ptr = &vcpu->arch.external_debug_state;
229215
vcpu_set_flag(vcpu, DEBUG_DIRTY);
230216

231-
trace_kvm_arm_set_regset("BKPTS", get_num_brps(),
232-
&vcpu->arch.debug_ptr->dbg_bcr[0],
233-
&vcpu->arch.debug_ptr->dbg_bvr[0]);
234-
235-
trace_kvm_arm_set_regset("WAPTS", get_num_wrps(),
236-
&vcpu->arch.debug_ptr->dbg_wcr[0],
237-
&vcpu->arch.debug_ptr->dbg_wvr[0]);
238-
239217
/*
240218
* The OS Lock blocks debug exceptions in all ELs when it is
241219
* enabled. If the guest has enabled the OS Lock, constrain its
@@ -257,14 +235,10 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu)
257235
/* If KDE or MDE are set, perform a full save/restore cycle. */
258236
if (vcpu_read_sys_reg(vcpu, MDSCR_EL1) & (DBG_MDSCR_KDE | DBG_MDSCR_MDE))
259237
vcpu_set_flag(vcpu, DEBUG_DIRTY);
260-
261-
trace_kvm_arm_set_dreg32("MDSCR_EL1", vcpu_read_sys_reg(vcpu, MDSCR_EL1));
262238
}
263239

264240
void kvm_arm_clear_debug(struct kvm_vcpu *vcpu)
265241
{
266-
trace_kvm_arm_clear_debug(vcpu->guest_debug);
267-
268242
/*
269243
* Restore the guest's debug registers if we were using them.
270244
*/
@@ -286,14 +260,6 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu)
286260
*/
287261
if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW) {
288262
kvm_arm_reset_debug_ptr(vcpu);
289-
290-
trace_kvm_arm_set_regset("BKPTS", get_num_brps(),
291-
&vcpu->arch.debug_ptr->dbg_bcr[0],
292-
&vcpu->arch.debug_ptr->dbg_bvr[0]);
293-
294-
trace_kvm_arm_set_regset("WAPTS", get_num_wrps(),
295-
&vcpu->arch.debug_ptr->dbg_wcr[0],
296-
&vcpu->arch.debug_ptr->dbg_wvr[0]);
297263
}
298264
}
299265
}

arch/arm64/kvm/sys_regs.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,6 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu,
657657
vcpu_set_flag(vcpu, DEBUG_DIRTY);
658658

659659
kvm_debug_set_guest_ownership(vcpu);
660-
trace_trap_reg(__func__, r->reg, p->is_write, p->regval);
661-
662660
return true;
663661
}
664662

@@ -711,8 +709,6 @@ static bool trap_bvr(struct kvm_vcpu *vcpu,
711709
else
712710
dbg_to_reg(vcpu, p, rd, dbg_reg);
713711

714-
trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);
715-
716712
return true;
717713
}
718714

@@ -748,8 +744,6 @@ static bool trap_bcr(struct kvm_vcpu *vcpu,
748744
else
749745
dbg_to_reg(vcpu, p, rd, dbg_reg);
750746

751-
trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);
752-
753747
return true;
754748
}
755749

@@ -785,9 +779,6 @@ static bool trap_wvr(struct kvm_vcpu *vcpu,
785779
else
786780
dbg_to_reg(vcpu, p, rd, dbg_reg);
787781

788-
trace_trap_reg(__func__, rd->CRm, p->is_write,
789-
vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm]);
790-
791782
return true;
792783
}
793784

@@ -823,8 +814,6 @@ static bool trap_wcr(struct kvm_vcpu *vcpu,
823814
else
824815
dbg_to_reg(vcpu, p, rd, dbg_reg);
825816

826-
trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);
827-
828817
return true;
829818
}
830819

arch/arm64/kvm/trace_handle_exit.h

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -46,38 +46,6 @@ TRACE_EVENT(kvm_hvc_arm64,
4646
__entry->vcpu_pc, __entry->r0, __entry->imm)
4747
);
4848

49-
TRACE_EVENT(kvm_arm_setup_debug,
50-
TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
51-
TP_ARGS(vcpu, guest_debug),
52-
53-
TP_STRUCT__entry(
54-
__field(struct kvm_vcpu *, vcpu)
55-
__field(__u32, guest_debug)
56-
),
57-
58-
TP_fast_assign(
59-
__entry->vcpu = vcpu;
60-
__entry->guest_debug = guest_debug;
61-
),
62-
63-
TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
64-
);
65-
66-
TRACE_EVENT(kvm_arm_clear_debug,
67-
TP_PROTO(__u32 guest_debug),
68-
TP_ARGS(guest_debug),
69-
70-
TP_STRUCT__entry(
71-
__field(__u32, guest_debug)
72-
),
73-
74-
TP_fast_assign(
75-
__entry->guest_debug = guest_debug;
76-
),
77-
78-
TP_printk("flags: 0x%08x", __entry->guest_debug)
79-
);
80-
8149
/*
8250
* The dreg32 name is a leftover from a distant past. This will really
8351
* output a 64bit value...
@@ -99,49 +67,6 @@ TRACE_EVENT(kvm_arm_set_dreg32,
9967
TP_printk("%s: 0x%llx", __entry->name, __entry->value)
10068
);
10169

102-
TRACE_DEFINE_SIZEOF(__u64);
103-
104-
TRACE_EVENT(kvm_arm_set_regset,
105-
TP_PROTO(const char *type, int len, __u64 *control, __u64 *value),
106-
TP_ARGS(type, len, control, value),
107-
TP_STRUCT__entry(
108-
__field(const char *, name)
109-
__field(int, len)
110-
__array(u64, ctrls, 16)
111-
__array(u64, values, 16)
112-
),
113-
TP_fast_assign(
114-
__entry->name = type;
115-
__entry->len = len;
116-
memcpy(__entry->ctrls, control, len << 3);
117-
memcpy(__entry->values, value, len << 3);
118-
),
119-
TP_printk("%d %s CTRL:%s VALUE:%s", __entry->len, __entry->name,
120-
__print_array(__entry->ctrls, __entry->len, sizeof(__u64)),
121-
__print_array(__entry->values, __entry->len, sizeof(__u64)))
122-
);
123-
124-
TRACE_EVENT(trap_reg,
125-
TP_PROTO(const char *fn, int reg, bool is_write, u64 write_value),
126-
TP_ARGS(fn, reg, is_write, write_value),
127-
128-
TP_STRUCT__entry(
129-
__field(const char *, fn)
130-
__field(int, reg)
131-
__field(bool, is_write)
132-
__field(u64, write_value)
133-
),
134-
135-
TP_fast_assign(
136-
__entry->fn = fn;
137-
__entry->reg = reg;
138-
__entry->is_write = is_write;
139-
__entry->write_value = write_value;
140-
),
141-
142-
TP_printk("%s %s reg %d (0x%016llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
143-
);
144-
14570
TRACE_EVENT(kvm_handle_sys_reg,
14671
TP_PROTO(unsigned long hsr),
14772
TP_ARGS(hsr),

0 commit comments

Comments
 (0)