All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <wei@redhat.com>
To: Gleb Natapov <gleb@kernel.org>
Cc: pbonzini@redhat.com, KVM <kvm@vger.kernel.org>
Subject: Re: [RFC] vPMU support for AMD system
Date: Mon, 06 Oct 2014 09:26:33 -0500	[thread overview]
Message-ID: <5432A699.20302@redhat.com> (raw)
In-Reply-To: <20141004070016.GR26540@minantech.com>

This

On 10/4/14 2:00 AM, Gleb Natapov wrote:
> Hi,
>
> On Tue, Sep 30, 2014 at 09:07:22PM -0500, Wei Huang wrote:
>> Hi Paolo and Gleb,
>>
>> The attached file is a preliminary version of AMD vPMU support for KVM.
>> Currently I am working on a formal patch set; but realized that there are
>> some design choice to make (see below). I thought it is better to send it
>> out now, asking for your comments before sending out patchset v1.
>>
>> If you are OK with current approach, please let me know. Otherwise please
>> share your suggestions/comments on the design choice (see suggestions
>> below). I will send out split patch set soon.
>>
> I am not very familiar with AMD PMU, but IIRC is lacks architectural PMU, so the
> first question that comes to my mind is:
>
>> +static struct kvm_event_hw_type_mapping amd_event_mapping[] = {
>> +	[0] = { 0x76, 0x00, PERF_COUNT_HW_CPU_CYCLES },
>> +	[1] = { 0xc0, 0x00, PERF_COUNT_HW_INSTRUCTIONS },
>> +	[3] = { 0x80, 0x00, PERF_COUNT_HW_CACHE_REFERENCES },
>> +	[4] = { 0x81, 0x00, PERF_COUNT_HW_CACHE_MISSES },
>> +	[5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
>> +	[6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES },
>> +};
>> +
> Are those evens count exactly same things on all AMD cpus?
These mappings were pulled off from Linux perf code. From the code and 
several AMD BKDGs I read, they were consistent across CPU families.

If there is no guaranteed consistency, I think we can fall back to raw 
perf counters. So this amd_event_mapping table can be removed.

-Wei

>
>
> --
> 			Gleb.
>

      reply	other threads:[~2014-10-06 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01  2:07 [RFC] vPMU support for AMD system Wei Huang
2014-10-02 13:50 ` Radim Krčmář
2014-10-02 14:15   ` Wei Huang
2014-10-04  7:00 ` Gleb Natapov
2014-10-06 14:26   ` Wei Huang [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=5432A699.20302@redhat.com \
    --to=wei@redhat.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.