lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1568401242-260374-6-git-send-email-suravee.suthikulpanit@amd.com>
Date:   Fri, 13 Sep 2019 19:00:55 +0000
From:   "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@....com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>
CC:     "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "rkrcmar@...hat.com" <rkrcmar@...hat.com>,
        "joro@...tes.org" <joro@...tes.org>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "graf@...zon.com" <graf@...zon.com>,
        "jschoenh@...zon.de" <jschoenh@...zon.de>,
        "karahmed@...zon.de" <karahmed@...zon.de>,
        "rimasluk@...zon.com" <rimasluk@...zon.com>,
        "Grimm, Jon" <Jon.Grimm@....com>,
        "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@....com>
Subject: [PATCH v3 05/16] kvm: x86: Add APICv activate/deactivate request
 trace points

Add trace points when sending request to activate/deactivate APICv.

Suggested-by: Alexander Graf <graf@...zon.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
---
 arch/x86/kvm/trace.h | 30 ++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c   |  7 +++++++
 2 files changed, 37 insertions(+)

diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index b5c831e..e3f745a 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -1297,6 +1297,36 @@
 		  __entry->vcpu_id, __entry->timer_index)
 );
 
+TRACE_EVENT(kvm_apicv_activate_request,
+	    TP_PROTO(u32 vcpu),
+	    TP_ARGS(vcpu),
+
+	TP_STRUCT__entry(__field(u32, vcpu)),
+
+	TP_fast_assign(__entry->vcpu = vcpu;),
+
+	TP_printk("vcpu=%u", __entry->vcpu)
+);
+
+TRACE_EVENT(kvm_apicv_deactivate_request,
+	    TP_PROTO(u32 vcpu, bool disable),
+	    TP_ARGS(vcpu, disable),
+
+	TP_STRUCT__entry(
+		__field(u32, vcpu)
+		__field(bool, disable)
+	),
+
+	TP_fast_assign(
+		__entry->vcpu = vcpu;
+		__entry->disable = disable;
+	),
+
+	TP_printk("vcpu=%u, disable=%s",
+		  __entry->vcpu,
+		  __entry->disable ? "disabled" : "suspended")
+);
+
 /*
  * Tracepoint for AMD AVIC
  */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 446df2b..bc74876 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7756,6 +7756,8 @@ void kvm_make_apicv_activate_request(struct kvm_vcpu *vcpu)
 	struct kvm_vcpu *v;
 	struct kvm *kvm = vcpu->kvm;
 
+	trace_kvm_apicv_activate_request(vcpu->vcpu_id);
+
 	mutex_lock(&kvm->arch.apicv_lock);
 	if (kvm->arch.apicv_state != APICV_SUSPENDED) {
 		mutex_unlock(&kvm->arch.apicv_lock);
@@ -7782,6 +7784,8 @@ void kvm_make_apicv_deactivate_request(struct kvm_vcpu *vcpu, bool disable)
 	struct kvm_vcpu *v;
 	struct kvm *kvm = vcpu->kvm;
 
+	trace_kvm_apicv_deactivate_request(vcpu->vcpu_id, disable);
+
 	mutex_lock(&kvm->arch.apicv_lock);
 	if (kvm->arch.apicv_state != APICV_ACTIVATED) {
 		mutex_unlock(&kvm->arch.apicv_lock);
@@ -10194,3 +10198,6 @@ bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pi_irte_update);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_unaccelerated_access);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_incomplete_ipi);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_apicv_activate_request);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_apicv_deactivate_request);
+
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ