public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	kvm@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: RFC: convert KVMTRACE to event traces
Date: Sun, 17 May 2009 23:21:33 +0300	[thread overview]
Message-ID: <4A1071CD.1000908@redhat.com> (raw)
In-Reply-To: <20090515180819.GA11166@amt.cnet>

Marcelo Tosatti wrote:
> On Fri, May 15, 2009 at 01:10:34PM -0400, Christoph Hellwig wrote:
>   
>> On Thu, May 14, 2009 at 05:30:16PM -0300, Marcelo Tosatti wrote:
>>     
>>> +		trace_kvm_cr_write(cr, val);
>>>  		switch (cr) {
>>>  		case 0:
>>> -			kvm_set_cr0(vcpu, kvm_register_read(vcpu, reg));
>>> +			kvm_set_cr0(vcpu, val);
>>>  			skip_emulated_instruction(vcpu);
>>>       
>> Do we really need one trace point covering all cr writes, _and_ one for
>> each specific register?
>>     
>
> There is one tracepoint named kvm_cr that covers cr reads and writes.
>
> kvm_trace_cr_read/kvm_trace_cr_write are macros that expand to
> kvm_trace_cr(rw=1 or rw=0). Perhaps that is not a very good idea.
>   

If the framework allows us to filter on arguments, that's fine (I think 
it does).  We need a way to look at, say, cr4 reads in a sea of cr3 
read/writes.

>> Again this seems a bit cumbersome.  Why not just one tracepoint for
>> page faults, with a flag if we're using npt or not?
>>     
>
> Issue is the meaning of these faults is different. With npt disabled the
> fault is a guest fault (like a normal pagefault), but with npt enabled
> the fault indicates the host pagetables the hardware uses to do the
> translation are not set up correctly.
>   

No, with npt disabled a fault is either a guest fault or a shadow fault 
or a host (minor/major) fault.
With npt enabled it cannot be a guest fault, but may be a shadow fault 
or a host fault.

> I did unify them as you suggest but reverted back to separate
> tracepoints because the unification might be confusing.
>
> Can be unified later if desirable.
>   

I think you can unify them, especially as they will never occur together 
in the same run.  We'll need tracepoints later in the mmu code for 
dealing with the different fault types.  Guest faults are marked by 
injecting a #GP, shadow faults by populating an spte, and host faults 
somewhere in the bowels of get_user_pages().  Isn't it wonderful how 
everything is integrated?

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


      reply	other threads:[~2009-05-17 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 20:30 RFC: convert KVMTRACE to event traces Marcelo Tosatti
2009-05-15 17:10 ` Christoph Hellwig
2009-05-15 18:08   ` Marcelo Tosatti
2009-05-17 20:21     ` Avi Kivity [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=4A1071CD.1000908@redhat.com \
    --to=avi@redhat.com \
    --cc=hch@infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=rostedt@goodmis.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