mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Stefano De Venuto <stefano.devenuto99@gmail.com>
Cc: linux-kernel@vger.kernel.org, vkuznets@redhat.com,
	wanpengli@tencent.com, jmattson@google.com, x86@kernel.org,
	hpa@zytor.com, kvm@vger.kernel.org, rostedt@goodmis.org,
	y.karadz@gmail.com
Subject: Re: [PATCH] Move VMEnter and VMExit tracepoints closer to the actual event
Date: Fri, 28 May 2021 18:55:43 +0200	[thread overview]
Message-ID: <d7dc2464a8aa3caf64f955fe6c9df0cb8fe3b746.camel@suse.com> (raw)
In-Reply-To: <ab44e5b1-4448-d6c8-6cda-5e41866f69f1@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

On Thu, 2021-05-20 at 18:18 +0200, Paolo Bonzini wrote:
> On 20/05/21 17:32, Sean Christopherson wrote:
> > On VMX, I think the tracepoint can be moved below the VMWRITEs
> > without much
> > contention (though doing so is likely a nop), but moving it below
> > kvm_load_guest_xsave_state() requires a bit more discussion.
> 
> Indeed; as a rule of thumb, the tracepoint on SVM could match the 
> clgi/stgi region, and on VMX it could be placed in a similar location.
> 
So, we played a little bit with this and, as envisioned, we can confirm
that moving the tracepoint outside of the xsave handling calls results
in the actual trace looking pretty much the same as it does right now.

Still, I think we should go for it, and we're planning to send a v2 of
this patch that does exactly that. In fact, I think it's still better
to have the tracepoint closer to the actual instruction (provided they
don't end up too close, as we were saying in this thread).

For instance, despite the sequence of events being the same in the
"output", the timestamp of the event that we see in the trace would be
more accurate (although, we're of course talking about very small
differences) and, more importantly, we reduce the chances that more
events creeps in, if tracepoints for them are added in the code between
where the trace_kvm_enter/exit() code are now and where we'd like to
move them.

So, Paolo, just to be sure, when you said "the tracepoint on SVM could
match the clgi/stgi region", did you mean they should be outside of
this region (i.e., trace_kvm_enter() just before clgi() and
trace_kvm_exit() after stgi())? Or vice versa? :-)

Thanks and Regards

Dario
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-05-28 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 18:23 Stefano De Venuto
2021-05-20  6:05 ` Dario Faggioli
2021-05-20  7:21 ` Thomas Gleixner
2021-05-21  7:13   ` Dario Faggioli
2021-05-20 15:32 ` Sean Christopherson
2021-05-20 16:18   ` Paolo Bonzini
2021-05-21  7:58     ` Dario Faggioli
2021-05-28 16:55     ` Dario Faggioli [this message]
2021-05-28 16:57       ` Paolo Bonzini
2021-05-21  7:51   ` Dario Faggioli
2021-05-25 16:20     ` Sean Christopherson
2021-05-28 17:03       ` Dario Faggioli

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=d7dc2464a8aa3caf64f955fe6c9df0cb8fe3b746.camel@suse.com \
    --to=dfaggioli@suse.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=seanjc@google.com \
    --cc=stefano.devenuto99@gmail.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    --cc=y.karadz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®