From: Amit Shah <amit@kernel.org>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
x86@kernel.org, linux-doc@vger.kernel.org
Cc: amit.shah@amd.com, thomas.lendacky@amd.com, bp@alien8.de,
tglx@linutronix.de, peterz@infradead.org, jpoimboe@kernel.org,
pawan.kumar.gupta@linux.intel.com, corbet@lwn.net,
mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com,
seanjc@google.com, pbonzini@redhat.com,
daniel.sneddon@linux.intel.com, kai.huang@intel.com,
sandipan.das@amd.com, boris.ostrovsky@oracle.com,
Babu.Moger@amd.com, david.kaplan@amd.com, dwmw@amazon.co.uk,
andrew.cooper3@citrix.com
Subject: [RFC PATCH v4 2/2] debug: add tracepoint for flush_rap_on_vmrun
Date: Wed, 2 Apr 2025 10:28:33 +0200 [thread overview]
Message-ID: <20250402082833.9835-3-amit@kernel.org> (raw)
In-Reply-To: <20250402082833.9835-1-amit@kernel.org>
From: Amit Shah <amit.shah@amd.com>
---
arch/x86/kvm/svm/svm.c | 4 +++-
arch/x86/kvm/trace.h | 16 ++++++++++++++++
arch/x86/kvm/x86.c | 1 +
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index b5de6341080b..c47d4dfcc1d4 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3607,8 +3607,10 @@ static int svm_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)
trace_kvm_nested_vmexit(vcpu, KVM_ISA_SVM);
- if (vmcb_is_extended_rap(svm->vmcb01.ptr))
+ if (vmcb_is_extended_rap(svm->vmcb01.ptr)) {
vmcb_flush_guest_rap(svm->vmcb01.ptr);
+ trace_kvm_svm_eraps_flush_rap(svm->vmcb01.ptr);
+ }
vmexit = nested_svm_exit_special(svm);
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index ccda95e53f62..059dfc744a22 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -346,6 +346,22 @@ TRACE_EVENT(name, \
*/
TRACE_EVENT_KVM_EXIT(kvm_exit);
+TRACE_EVENT(kvm_svm_eraps_flush_rap, \
+ TP_PROTO(struct vmcb *vmcb), \
+ TP_ARGS(vmcb), \
+ \
+ TP_STRUCT__entry( \
+ __field( struct vmcb *, vmcb ) \
+ ), \
+ \
+ TP_fast_assign( \
+ __entry->vmcb = vmcb; \
+ ), \
+ \
+ TP_printk("vmcb: 0x%p", \
+ __entry->vmcb) \
+)
+
/*
* Tracepoint for kvm interrupt injection:
*/
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c841817a914a..414a0e6c9c4b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -14024,6 +14024,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_msr_protocol_enter);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_msr_protocol_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_rmp_fault);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_svm_eraps_flush_rap);
static int __init kvm_x86_init(void)
{
--
2.49.0
prev parent reply other threads:[~2025-04-02 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 8:28 [RFC PATCH v4 0/2] KVM: Add support for the ERAPS feature Amit Shah
2025-04-02 8:28 ` [RFC PATCH v4 1/2] x86: kvm: svm: set up ERAPS support for guests Amit Shah
2025-04-02 8:28 ` Amit Shah [this message]
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=20250402082833.9835-3-amit@kernel.org \
--to=amit@kernel.org \
--cc=Babu.Moger@amd.com \
--cc=amit.shah@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=david.kaplan@amd.com \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=jpoimboe@kernel.org \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=sandipan.das@amd.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.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;
as well as URLs for NNTP newsgroup(s).