From: Joerg Roedel <joro@8bytes.org>
To: Avi Kivity <avi@redhat.com>
Cc: "Roedel, Joerg" <Joerg.Roedel@amd.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
benh <benh@kernel.crashing.org>,
Anton Blanchard <anton@samba.org>, davem <davem@davemloft.net>
Subject: Re: [PATCH 2/3] perf, x86: Use GO/HO bits in perf-ctr
Date: Thu, 12 May 2011 11:21:53 +0200 [thread overview]
Message-ID: <20110512092153.GC8707@8bytes.org> (raw)
In-Reply-To: <4DCA87FA.4070902@redhat.com>
On Wed, May 11, 2011 at 03:58:34PM +0300, Avi Kivity wrote:
> On 05/10/2011 06:04 PM, Roedel, Joerg wrote:
>> On Tue, May 10, 2011 at 10:48:20AM -0400, Peter Zijlstra wrote:
>> > On Tue, 2011-05-10 at 16:35 +0200, Joerg Roedel wrote:
>> > > The AMD perf-counters support counting in guest or host-mode
>> > > only. Make use of that feature when user-space specified
>> > > guest/host-mode only counting.
>> >
>> > Subject mentions x86, does Intel have anything similar so you can make
>> > it work for them too?
>>
>> Intel does not support guest or host-only counting in the hardware (at
>> least according to my documentation). If wanted it could be approximated by
>> enabling/disabling the counters in the guest-entry path.
>
> vmx has support for atomically swapping MSRs during guest entry and exit
> (you can load guest MSRs on entry, save guest MSRs on exit, and load
> host MSRs on exit, but you can't save host MSRs on entry, so host-only
> counters cannot be 100% accurate). We'd need some kvm/perf hooks to
> program these MSR swaps, and to manually save the counters that cannot
> be done automatically.
Well, wenn host counters are not saved on vmentry then we just need to
save them manually (which is a one-time thing and does not need to
happen at every vmentry).
Thanks for that information, when I am back in office on monday I'll try
to grab a machine and hopefully get this running.
> btw, your patchset can be further improved by integrating
> exclude_guest/exclude_host into the constraints. For example if we have
> three general purpose counters, two generic perf_events in user, one
> exclude_guest perf_event, and one exclude_host perf_event, we can
> schedule them all at all times, swapping the exclude_guest and
> exclude_host events during guest entry/exit.
Well, it will need some additional code in the amd vmrun path too. I'll
take a look at it, but probably leave it as a future optimization.
Thanks for the hint.
Joerg
next prev parent reply other threads:[~2011-05-12 9:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-10 14:35 [RFC][PATCH 0/3] perf support for amd guest/host-only bits Joerg Roedel
2011-05-10 14:35 ` [PATCH 1/3] perf, core: Introduce attrs to count in either host or guest mode Joerg Roedel
2011-05-10 14:45 ` Peter Zijlstra
2011-05-10 14:59 ` Roedel, Joerg
2011-05-10 15:18 ` Peter Zijlstra
2011-05-10 15:38 ` Roedel, Joerg
2011-05-10 16:07 ` Peter Zijlstra
2011-05-10 16:25 ` Roedel, Joerg
2011-05-11 11:44 ` Avi Kivity
2011-05-11 11:45 ` Avi Kivity
2011-05-11 13:49 ` Peter Zijlstra
2011-05-11 13:52 ` Avi Kivity
2011-05-11 14:02 ` Ingo Molnar
2011-05-10 14:35 ` [PATCH 2/3] perf, x86: Use GO/HO bits in perf-ctr Joerg Roedel
2011-05-10 14:48 ` Peter Zijlstra
2011-05-10 15:04 ` Roedel, Joerg
2011-05-11 12:58 ` Avi Kivity
2011-05-12 9:21 ` Joerg Roedel [this message]
2011-05-10 14:35 ` [PATCH 3/3] perf, tools: Add support for guest/host-only profiling Joerg Roedel
2011-05-10 14:50 ` Peter Zijlstra
2011-05-10 15:08 ` Roedel, Joerg
2011-05-10 15:25 ` Peter Zijlstra
2011-05-10 15:46 ` Roedel, Joerg
2011-05-10 16:09 ` Peter Zijlstra
2011-05-10 15:21 ` [RFC][PATCH 0/3] perf support for amd guest/host-only bits Ingo Molnar
2011-05-10 15:50 ` Roedel, Joerg
2011-05-10 20:41 ` Ingo Molnar
2011-05-11 8:57 ` Joerg Roedel
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=20110512092153.GC8707@8bytes.org \
--to=joro@8bytes.org \
--cc=Joerg.Roedel@amd.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=anton@samba.org \
--cc=avi@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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