From: Avi Kivity <avi@redhat.com>
To: Jiaqing Du <jiaqing@gmail.com>
Cc: kvm@vger.kernel.org, Nipun sehrawat <nipunsehrawatns@gmail.com>
Subject: Re: Some Code for Performance Profiling
Date: Wed, 07 Apr 2010 22:30:02 +0300 [thread overview]
Message-ID: <4BBCDD3A.1050003@redhat.com> (raw)
In-Reply-To: <o2t6d8082041004071223w27234ca5ga591a80f7a4dde99@mail.gmail.com>
On 04/07/2010 10:23 PM, Jiaqing Du wrote:
>
>> Can your implementation support both simultaneously?
>>
> What do you mean "simultaneously"? With my implementation, you either
> do guest-wide profiling or system-wide profiling. They are achieved
> through different patches. Actually, the result of guest-wide
> profiling is a subset of system-wide profiling.
>
>
A guest admin monitors the performance of their guest via a vpmu.
Meanwhile the host admin monitors the performance of the host (including
all guests) using the host pmu. Given that the host pmu and the vpmu
may select different counters, it is difficult to support both
simultaneously.
>>> For guest-wide profiling, there are two possible places to save and
>>> restore the related MSRs. One is where the CPU switches between guest
>>> mode and host mode. We call this *CPU-switch*. Profiling with this
>>> enabled reflects how the guest behaves on the physical CPU, plus other
>>> virtualized, not emulated, devices. The other place is where the CPU
>>> switches between the KVM context and others. Here KVM context means
>>> the CPU is executing guest code or KVM code, both kernel space and
>>> user space. We call this *domain-switch*. Profiling with this enabled
>>> discloses how the guest behaves on both the physical CPU and KVM.
>>> (Some emulated operations are really expensive in a virtualized
>>> environment.)
>>>
>>>
>> Which method do you use? Or do you support both?
>>
> I post two patches in my previous email. One is for CPU-switch, and
> the other is for domain-switch.
>
>
I see. I'm not sure I know which one is better!
>> Note disclosing host pmu data to the guest is sometimes a security issue.
>>
>>
> For instance?
>
The standard example is hyperthreading where the memory bus unit is
shared among two logical processors. A guest sampling a vcpu on one
thread can gain information about what is happening on the other - the
number of bus transactions the other thread has issued. This can be
used to establish a communication channel between two guests that
shouldn't be communicating, or to eavesdrop on another guest. A similar
problem happens with multicores.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
prev parent reply other threads:[~2010-04-07 19:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 16:53 Some Code for Performance Profiling Jiaqing Du
2010-04-05 8:34 ` Avi Kivity
2010-04-07 19:23 ` Jiaqing Du
2010-04-07 19:30 ` 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=4BBCDD3A.1050003@redhat.com \
--to=avi@redhat.com \
--cc=jiaqing@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=nipunsehrawatns@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