Linux-PCI Archive on
 help / color / Atom feed
	Kan Liang <>
Subject: [PATCH 0/7] Support PCIe3 uncore PMU on Snow Ridge
Date: Thu,  2 Jul 2020 10:05:10 -0700
Message-ID: <> (raw)

From: Kan Liang <>

The Snow Ridge integrated PCIe3 uncore performance monitoring unit (PMU)
can be used to collect the performance data, e.g., the utilization
between the PCIe devices and the components (in M2IOSF) which are
responsible for translating and managing the requests to/from the
device. The performance data is very useful for analyzing the
performance of the PCIe devices.

The PCIe3 uncore PMU was once supported in the Linux kernel, but it was
removed by the commit id 2167f1625c2f ("perf/x86/intel/uncore: Remove
PCIe3 unit for SNR") due to the conflict between the PCIe Root Port
driver and the perf uncore driver. The counters of the PCIe3 uncore PMU
are located in the configuration space of the PCIe Root Port device,
which already has a bonded driver portdrv_pci. One device can only have
one bonded driver. The uncore driver is always failed to be loaded.

To re-enable the PCIe3 uncore PMU support in the uncore driver, a new
solution should be introduced, which has to meet the requirements as
- must have a reliable way to find the PCIe Root Port device from the
  uncore driver;
- must be able to access the uncore counters of the PCIe Root Port
  device from the uncore driver;
- must support hotplug. When the PCIe Root Port device is removed, the
  uncore driver has to be notified and unregisters the PCIe3 uncore

A new platform device 'perf_uncore_pcieport' as a child device of the
PCIe Root Port device is introduced to address the issue, which:
- can be probed by a unique name, 'perf_uncore_pcieport'. The uncore
  driver is the only driver for the new platform device.
- can provide the struct pci_dev of its parent, aka the PCIe Root Port
  device. The struct pci_dev can be used by the uncore driver to
  register a PMU for accessing the counters in the PCIe Root Port
- can be notified if its parent PCIe Root Port device is removed.
  The uncore driver can unregister the PMU accordingly.

Kan Liang (7):
  PCI/portdrv: Create a platform device for the perf uncore driver
  perf/x86/intel/uncore: Factor out uncore_pci_get_die_info()
  perf/x86/intel/uncore: Factor out uncore_find_pmu_by_pci_dev()
  perf/x86/intel/uncore: Factor out uncore_pci_pmu_register()
  perf/x86/intel/uncore: Factor out uncore_pci_pmu_unregister()
  perf/x86/intel/uncore: Generic support for the platform device
  perf/x86/intel/uncore: Support PCIe3 unit on Snow Ridge

 arch/x86/events/intel/uncore.c       | 213 +++++++++++++++++++++++++----------
 arch/x86/events/intel/uncore.h       |  19 ++++
 arch/x86/events/intel/uncore_snbep.c |  60 ++++++++++
 drivers/pci/pcie/portdrv_pci.c       |  38 +++++++
 4 files changed, 271 insertions(+), 59 deletions(-)


             reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 17:05 kan.liang [this message]
2020-07-02 17:05 ` [PATCH 1/7] PCI/portdrv: Create a platform device for the perf uncore driver kan.liang
2020-07-07 19:48   ` Bjorn Helgaas
2020-07-08  3:01     ` Liang, Kan
2020-07-08 18:30       ` Bjorn Helgaas
2020-07-02 17:05 ` [PATCH 2/7] perf/x86/intel/uncore: Factor out uncore_pci_get_die_info() kan.liang
2020-07-02 17:05 ` [PATCH 3/7] perf/x86/intel/uncore: Factor out uncore_find_pmu_by_pci_dev() kan.liang
2020-07-02 17:05 ` [PATCH 4/7] perf/x86/intel/uncore: Factor out uncore_pci_pmu_register() kan.liang
2020-07-02 17:05 ` [PATCH 5/7] perf/x86/intel/uncore: Factor out uncore_pci_pmu_unregister() kan.liang
2020-07-02 17:05 ` [PATCH 6/7] perf/x86/intel/uncore: Generic support for the platform device kan.liang
2020-07-02 17:05 ` [PATCH 7/7] perf/x86/intel/uncore: Support PCIe3 unit on Snow Ridge kan.liang

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-PCI Archive on

Archives are clonable:
	git clone --mirror linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ \
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone