aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kvm
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-06-14 04:40:13 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-14 05:16:23 -0400
commit9887d1c75ba2f210b403d536ab025d4b2b36fb57 (patch)
treeaf76426f0e2265dd0017b2a427d898a5f4f44116 /arch/mips/kvm
parent1e09e86ac13747903501004082bf1c5b7c6262b2 (diff)
MIPS: KVM: Add kvm_asid_change trace event
Add a trace event for guest ASID changes, replacing the existing kvm_debug call. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: kvm@vger.kernel.org Cc: linux-mips@linux-mips.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm')
-rw-r--r--arch/mips/kvm/emulate.c7
-rw-r--r--arch/mips/kvm/trace.h22
2 files changed, 25 insertions, 4 deletions
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index fce08bda9ebc..ee0e61d2b6fb 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -1082,11 +1082,10 @@ enum emulation_result kvm_mips_emulate_CP0(u32 inst, u32 *opc, u32 cause,
1082 if ((KSEGX(vcpu->arch.gprs[rt]) != CKSEG0) && 1082 if ((KSEGX(vcpu->arch.gprs[rt]) != CKSEG0) &&
1083 ((kvm_read_c0_guest_entryhi(cop0) & 1083 ((kvm_read_c0_guest_entryhi(cop0) &
1084 KVM_ENTRYHI_ASID) != nasid)) { 1084 KVM_ENTRYHI_ASID) != nasid)) {
1085 kvm_debug("MTCz, change ASID from %#lx to %#lx\n", 1085 trace_kvm_asid_change(vcpu,
1086 kvm_read_c0_guest_entryhi(cop0) 1086 kvm_read_c0_guest_entryhi(cop0)
1087 & KVM_ENTRYHI_ASID, 1087 & KVM_ENTRYHI_ASID,
1088 vcpu->arch.gprs[rt] 1088 nasid);
1089 & KVM_ENTRYHI_ASID);
1090 1089
1091 /* Blow away the shadow host TLBs */ 1090 /* Blow away the shadow host TLBs */
1092 kvm_mips_flush_host_tlb(1); 1091 kvm_mips_flush_host_tlb(1);
diff --git a/arch/mips/kvm/trace.h b/arch/mips/kvm/trace.h
index ffa6ee8f2025..7daf7474d6a6 100644
--- a/arch/mips/kvm/trace.h
+++ b/arch/mips/kvm/trace.h
@@ -122,6 +122,28 @@ TRACE_EVENT(kvm_aux,
122 __entry->pc) 122 __entry->pc)
123); 123);
124 124
125TRACE_EVENT(kvm_asid_change,
126 TP_PROTO(struct kvm_vcpu *vcpu, unsigned int old_asid,
127 unsigned int new_asid),
128 TP_ARGS(vcpu, old_asid, new_asid),
129 TP_STRUCT__entry(
130 __field(unsigned long, pc)
131 __field(u8, old_asid)
132 __field(u8, new_asid)
133 ),
134
135 TP_fast_assign(
136 __entry->pc = vcpu->arch.pc;
137 __entry->old_asid = old_asid;
138 __entry->new_asid = new_asid;
139 ),
140
141 TP_printk("PC: 0x%08lx old: 0x%02x new: 0x%02x",
142 __entry->pc,
143 __entry->old_asid,
144 __entry->new_asid)
145);
146
125#endif /* _TRACE_KVM_H */ 147#endif /* _TRACE_KVM_H */
126 148
127/* This part must be outside protection */ 149/* This part must be outside protection */