All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	Siddharth Chandrasekaran <sidcha@amazon.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] KVM: x86: Introduce trace_kvm_hv_hypercall_done()
Date: Fri, 30 Jul 2021 14:26:23 +0200	[thread overview]
Message-ID: <20210730122625.112848-3-vkuznets@redhat.com> (raw)
In-Reply-To: <20210730122625.112848-1-vkuznets@redhat.com>

Hypercall failures are unusual with potentially far going consequences
so it would be useful to see their results when tracing.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 arch/x86/kvm/hyperv.c |  1 +
 arch/x86/kvm/trace.h  | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index cb7e045905a5..2945b93dbadd 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -2016,6 +2016,7 @@ static void kvm_hv_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result)
 
 static int kvm_hv_hypercall_complete(struct kvm_vcpu *vcpu, u64 result)
 {
+	trace_kvm_hv_hypercall_done(result);
 	kvm_hv_hypercall_set_result(vcpu, result);
 	++vcpu->stat.hypercalls;
 	return kvm_skip_emulated_instruction(vcpu);
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index b484141ea15b..03ebe368333e 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -92,6 +92,21 @@ TRACE_EVENT(kvm_hv_hypercall,
 		  __entry->outgpa)
 );
 
+TRACE_EVENT(kvm_hv_hypercall_done,
+	TP_PROTO(u64 result),
+	TP_ARGS(result),
+
+	TP_STRUCT__entry(
+		__field(__u64, result)
+	),
+
+	TP_fast_assign(
+		__entry->result	= result;
+	),
+
+	TP_printk("result 0x%llx", __entry->result)
+);
+
 /*
  * Tracepoint for Xen hypercall.
  */
-- 
2.31.1


  parent reply	other threads:[~2021-07-30 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 12:26 [PATCH 0/4] KVM: x86: hyper-v: Check if guest is allowed to use XMM registers for hypercall input Vitaly Kuznetsov
2021-07-30 12:26 ` [PATCH 1/4] KVM: x86: hyper-v: Check access to hypercall before reading XMM registers Vitaly Kuznetsov
2021-07-30 14:29   ` Siddharth Chandrasekaran
2021-07-30 12:26 ` Vitaly Kuznetsov [this message]
2021-07-30 14:30   ` [PATCH 2/4] KVM: x86: Introduce trace_kvm_hv_hypercall_done() Siddharth Chandrasekaran
2021-07-30 12:26 ` [PATCH 3/4] KVM: x86: hyper-v: Check if guest is allowed to use XMM registers for hypercall input Vitaly Kuznetsov
2021-07-30 14:30   ` Siddharth Chandrasekaran
2021-07-30 12:26 ` [PATCH 4/4] KVM: selftests: Test access to XMM fast hypercalls Vitaly Kuznetsov
2021-07-30 14:35   ` Siddharth Chandrasekaran
2021-07-30 14:50     ` Vitaly Kuznetsov
2021-07-30 15:01       ` Siddharth Chandrasekaran
2021-08-03 10:10       ` Paolo Bonzini
2021-08-03 10:10 ` [PATCH 0/4] KVM: x86: hyper-v: Check if guest is allowed to use XMM registers for hypercall input Paolo Bonzini
2021-08-03 10:17 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730122625.112848-3-vkuznets@redhat.com \
    --to=vkuznets@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=sidcha@amazon.de \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.