Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360353 > unrolled thread

[PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC

Started bySuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
First post2016-03-18 07:20 +0100
Last post2016-03-28 13:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC Paolo Bonzini <pbonzini@redhat.com> - 2016-03-18 11:30 +0100
      Re: [PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-28 13:30 +0200

#1360353 — [PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC

FromSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Date2016-03-18 07:20 +0100
Subject[PART1 RFC v3 08/12] KVM: x86: Add trace events for AVIC
Message-ID<rdVVo-1Lv-7@gated-at.bofh.it>
Introduce trace events for AMD AVIC incomplete IPI vmexit, and
AVIC unaccelerate access vmexit.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 arch/x86/kvm/trace.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c   |  2 ++
 2 files changed, 59 insertions(+)

diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index ad9f6a2..3c85a3d 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -1288,6 +1288,63 @@ TRACE_EVENT(kvm_hv_stimer_cleanup,
 		  __entry->vcpu_id, __entry->timer_index)
 );
 
+/*
+ * Tracepoint for AMD AVIC
+ */
+TRACE_EVENT(kvm_avic_incomplete_ipi,
+	    TP_PROTO(u32 vcpu, u32 icrh, u32 icrl, u32 id, u32 index),
+	    TP_ARGS(vcpu, icrh, icrl, id, index),
+
+	TP_STRUCT__entry(
+		__field(u32, vcpu)
+		__field(u32, icrh)
+		__field(u32, icrl)
+		__field(u32, id)
+		__field(u32, index)
+	),
+
+	TP_fast_assign(
+		__entry->vcpu = vcpu;
+		__entry->icrh = icrh;
+		__entry->icrl = icrl;
+		__entry->id = id;
+		__entry->index = index;
+	),
+
+	TP_printk("vcpu=%#x, icrh:icrl=%#010x:%08x, id=%u, index=%u\n",
+		  __entry->vcpu, __entry->icrh, __entry->icrl,
+		  __entry->id, __entry->index)
+);
+
+TRACE_EVENT(kvm_avic_unaccelerated_access,
+	    TP_PROTO(u32 vcpu, u32 offset, bool ft, bool rw, u32 vec),
+	    TP_ARGS(vcpu, offset, ft, rw, vec),
+
+	TP_STRUCT__entry(
+		__field(u32, vcpu)
+		__field(u32, offset)
+		__field(bool, ft)
+		__field(bool, rw)
+		__field(u32, vec)
+	),
+
+	TP_fast_assign(
+		__entry->vcpu = vcpu;
+		__entry->offset = offset;
+		__entry->ft = ft;
+		__entry->rw = rw;
+		__entry->vec = vec;
+	),
+
+	TP_printk("vcpu=%#x, offset=%#x(%s), %s, %s, vec=%#x\n",
+		  __entry->vcpu,
+		  __entry->offset,
+		  __print_symbolic(__entry->offset, kvm_trace_symbol_apic),
+		  __entry->ft ? "trap" : "fault",
+		  __entry->rw ? "write" : "read",
+		  __entry->vec)
+);
+
 #endif /* _TRACE_KVM_H */
 
 #undef TRACE_INCLUDE_PATH
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4d2961d..775de1c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8395,3 +8395,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_write_tsc_offset);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pml_full);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pi_irte_update);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_unaccelerated_access);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_incomplete_ipi);
-- 
1.9.1

[toc] | [next] | [standalone]


#1360499

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-03-18 11:30 +0100
Message-ID<rdZPj-4hr-3@gated-at.bofh.it>
In reply to#1360353

On 18/03/2016 07:09, Suravee Suthikulpanit wrote:
> Introduce trace events for AMD AVIC incomplete IPI vmexit, and
> AVIC unaccelerate access vmexit.
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
>  arch/x86/kvm/trace.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  arch/x86/kvm/x86.c   |  2 ++
>  2 files changed, 59 insertions(+)
> 
> diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> index ad9f6a2..3c85a3d 100644
> --- a/arch/x86/kvm/trace.h
> +++ b/arch/x86/kvm/trace.h
> @@ -1288,6 +1288,63 @@ TRACE_EVENT(kvm_hv_stimer_cleanup,
>  		  __entry->vcpu_id, __entry->timer_index)
>  );
>  
> +/*
> + * Tracepoint for AMD AVIC
> + */
> +TRACE_EVENT(kvm_avic_incomplete_ipi,
> +	    TP_PROTO(u32 vcpu, u32 icrh, u32 icrl, u32 id, u32 index),
> +	    TP_ARGS(vcpu, icrh, icrl, id, index),
> +
> +	TP_STRUCT__entry(
> +		__field(u32, vcpu)
> +		__field(u32, icrh)
> +		__field(u32, icrl)
> +		__field(u32, id)
> +		__field(u32, index)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->vcpu = vcpu;
> +		__entry->icrh = icrh;
> +		__entry->icrl = icrl;
> +		__entry->id = id;
> +		__entry->index = index;
> +	),
> +
> +	TP_printk("vcpu=%#x, icrh:icrl=%#010x:%08x, id=%u, index=%u\n",

vcpus are usually printed with %u.  Apart from this, the patch looks
good.  You can squash it in "svm: Add VMEXIT handlers for AVIC".

Paolo

> +		  __entry->vcpu, __entry->icrh, __entry->icrl,
> +		  __entry->id, __entry->index)
> +);
> +
> +TRACE_EVENT(kvm_avic_unaccelerated_access,
> +	    TP_PROTO(u32 vcpu, u32 offset, bool ft, bool rw, u32 vec),
> +	    TP_ARGS(vcpu, offset, ft, rw, vec),
> +
> +	TP_STRUCT__entry(
> +		__field(u32, vcpu)
> +		__field(u32, offset)
> +		__field(bool, ft)
> +		__field(bool, rw)
> +		__field(u32, vec)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->vcpu = vcpu;
> +		__entry->offset = offset;
> +		__entry->ft = ft;
> +		__entry->rw = rw;
> +		__entry->vec = vec;
> +	),
> +
> +	TP_printk("vcpu=%#x, offset=%#x(%s), %s, %s, vec=%#x\n",
> +		  __entry->vcpu,
> +		  __entry->offset,
> +		  __print_symbolic(__entry->offset, kvm_trace_symbol_apic),
> +		  __entry->ft ? "trap" : "fault",
> +		  __entry->rw ? "write" : "read",
> +		  __entry->vec)
> +);
> +
>  #endif /* _TRACE_KVM_H */
>  
>  #undef TRACE_INCLUDE_PATH
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 4d2961d..775de1c 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -8395,3 +8395,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_write_tsc_offset);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_ple_window);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pml_full);
>  EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pi_irte_update);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_unaccelerated_access);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_incomplete_ipi);
> 

[toc] | [prev] | [next] | [standalone]


#1365446

FromSuravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Date2016-03-28 13:30 +0200
Message-ID<rhDwR-6m3-3@gated-at.bofh.it>
In reply to#1360499
Hi Paolo,

On 3/18/16 17:24, Paolo Bonzini wrote:
>> +	TP_printk("vcpu=%#x, icrh:icrl=%#010x:%08x, id=%u, index=%u\n",
> vcpus are usually printed with %u.  Apart from this, the patch looks
> good.  You can squash it in "svm: Add VMEXIT handlers for AVIC".
>
> Paolo
>

Sure, thanks for the feedback.

Suravee

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web