Re: [RFC] vPMU support for AMD system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux