public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Haiwei Li <lihaiwei.kernel@gmail.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "hpa@zytor.com" <hpa@zytor.com>, "bp@alien8.de" <bp@alien8.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	joro@8bytes.org, "jmattson@google.com" <jmattson@google.com>,
	"wanpengli@tencent.com" <wanpengli@tencent.com>,
	vkuznets@redhat.com, sean.j.christopherson@intel.com,
	"pbonzini@redhat.com" <pbonzini@redhat.com>
Subject: [PATCH] KVM: SVM: Add tracepoint for cr_interception
Date: Fri, 4 Sep 2020 19:25:29 +0800	[thread overview]
Message-ID: <f3031602-db3b-c4fe-b719-d402663b0a2b@gmail.com> (raw)

From: Haiwei Li <lihaiwei@tencent.com>

Add trace_kvm_cr_write and trace_kvm_cr_read for svm.

Signed-off-by: Haiwei Li <lihaiwei@tencent.com>
---
  arch/x86/kvm/svm/svm.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 03dd7bac8034..2c6dea48ba62 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2261,6 +2261,7 @@ static int cr_interception(struct vcpu_svm *svm)
  	if (cr >= 16) { /* mov to cr */
  		cr -= 16;
  		val = kvm_register_read(&svm->vcpu, reg);
+		trace_kvm_cr_write(cr, val);
  		switch (cr) {
  		case 0:
  			if (!check_selective_cr0_intercepted(svm, val))
@@ -2306,6 +2307,7 @@ static int cr_interception(struct vcpu_svm *svm)
  			return 1;
  		}
  		kvm_register_write(&svm->vcpu, reg, val);
+		trace_kvm_cr_read(cr, val);
  	}
  	return kvm_complete_insn_gp(&svm->vcpu, err);
  }
--
2.18.4

             reply	other threads:[~2020-09-04 11:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 11:25 Haiwei Li [this message]
2020-09-04 12:01 ` [PATCH] KVM: SVM: Add tracepoint for cr_interception Vitaly Kuznetsov
2020-09-04 12:44   ` Haiwei Li
2020-09-23  6:24 ` Haiwei Li
2020-09-24  0:44 ` Wanpeng Li

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=f3031602-db3b-c4fe-b719-d402663b0a2b@gmail.com \
    --to=lihaiwei.kernel@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox