mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 05:39:42 -04:00
LoongArch: KVM: Add tracepoints for CPUCFG and CSR emulation exits
This patch adds tracepoints to track KVM exits caused by CPUCFG and CSR emulation. Note that IOCSR emulation tracing is already covered by the generic trace_kvm_iocsr(). Reviewed-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Yulong Han <wheatfox17@icloud.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
@@ -289,9 +289,11 @@ static int kvm_trap_handle_gspr(struct kvm_vcpu *vcpu)
|
||||
er = EMULATE_FAIL;
|
||||
switch (((inst.word >> 24) & 0xff)) {
|
||||
case 0x0: /* CPUCFG GSPR */
|
||||
trace_kvm_exit_cpucfg(vcpu, KVM_TRACE_EXIT_CPUCFG);
|
||||
er = kvm_emu_cpucfg(vcpu, inst);
|
||||
break;
|
||||
case 0x4: /* CSR{RD,WR,XCHG} GSPR */
|
||||
trace_kvm_exit_csr(vcpu, KVM_TRACE_EXIT_CSR);
|
||||
er = kvm_handle_csr(vcpu, inst);
|
||||
break;
|
||||
case 0x6: /* Cache, Idle and IOCSR GSPR */
|
||||
|
||||
@@ -46,11 +46,15 @@ DEFINE_EVENT(kvm_transition, kvm_out,
|
||||
/* Further exit reasons */
|
||||
#define KVM_TRACE_EXIT_IDLE 64
|
||||
#define KVM_TRACE_EXIT_CACHE 65
|
||||
#define KVM_TRACE_EXIT_CPUCFG 66
|
||||
#define KVM_TRACE_EXIT_CSR 67
|
||||
|
||||
/* Tracepoints for VM exits */
|
||||
#define kvm_trace_symbol_exit_types \
|
||||
{ KVM_TRACE_EXIT_IDLE, "IDLE" }, \
|
||||
{ KVM_TRACE_EXIT_CACHE, "CACHE" }
|
||||
{ KVM_TRACE_EXIT_CACHE, "CACHE" }, \
|
||||
{ KVM_TRACE_EXIT_CPUCFG, "CPUCFG" }, \
|
||||
{ KVM_TRACE_EXIT_CSR, "CSR" }
|
||||
|
||||
DECLARE_EVENT_CLASS(kvm_exit,
|
||||
TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
|
||||
@@ -82,6 +86,14 @@ DEFINE_EVENT(kvm_exit, kvm_exit_cache,
|
||||
TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
|
||||
TP_ARGS(vcpu, reason));
|
||||
|
||||
DEFINE_EVENT(kvm_exit, kvm_exit_cpucfg,
|
||||
TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
|
||||
TP_ARGS(vcpu, reason));
|
||||
|
||||
DEFINE_EVENT(kvm_exit, kvm_exit_csr,
|
||||
TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
|
||||
TP_ARGS(vcpu, reason));
|
||||
|
||||
DEFINE_EVENT(kvm_exit, kvm_exit,
|
||||
TP_PROTO(struct kvm_vcpu *vcpu, unsigned int reason),
|
||||
TP_ARGS(vcpu, reason));
|
||||
|
||||
Reference in New Issue
Block a user