1. 02 7月, 2021 2 次提交
    • K
      perf/x86/intel/uncore: Add alias PMU name · 8053f2d7
      Kan Liang 提交于
      A perf PMU may have two PMU names. For example, Intel Sapphire Rapids
      server supports the discovery mechanism. Without the platform-specific
      support, an uncore PMU is named by a type ID plus a box ID, e.g.,
      uncore_type_0_0, because the real name of the uncore PMU cannot be
      retrieved from the discovery table. With the platform-specific support
      later, perf has the mapping information from a type ID to a specific
      uncore unit. Just like the previous platforms, the uncore PMU is named
      by the real PMU name, e.g., uncore_cha_0. The user scripts which work
      well with the old numeric name may not work anymore.
      
      Add a new attribute "alias" to indicate the old numeric name. The
      following userspace perf tool patch will handle both names. The user
      scripts should work properly with the updated perf tool.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Link: https://lore.kernel.org/r/1625087320-194204-13-git-send-email-kan.liang@linux.intel.com
      8053f2d7
    • K
      perf/x86/intel/uncore: Add Sapphire Rapids server framework · c54c53d9
      Kan Liang 提交于
      Intel Sapphire Rapids supports a discovery mechanism, that allows an
      uncore driver to discover the different components ("boxes") of the
      chip.
      
      All the generic information of the uncore boxes should be retrieved from
      the discovery tables. This has been enabled with the commit edae1f06
      ("perf/x86/intel/uncore: Parse uncore discovery tables"). Add
      use_discovery to indicate the case. The uncore driver doesn't need to
      hard code the generic information for each uncore box.
      But we still need to enable various functionality that cannot be
      directly discovered.
      
      To support these functionalities, the Sapphire Rapids server framework
      is introduced here. Each specific uncore unit will be added into the
      framework in the following patches.
      
      Add use_discovery to indicate that the discovery mechanism is required
      for the platform. Currently, Intel Sapphire Rapids is one of the
      platforms.
      
      The box ID from the discovery table is the accurate index. Use it if
      applicable.
      
      All the undiscovered platform-specific features will be hard code in the
      spr_uncores[]. Add uncore_type_customized_copy(), instead of the memcpy,
      to only overwrite these features.
      
      The specific uncore unit hasn't been added here. From user's
      perspective, there is nothing changed for now.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Link: https://lore.kernel.org/r/1625087320-194204-2-git-send-email-kan.liang@linux.intel.com
      c54c53d9
  2. 12 5月, 2021 1 次提交
  3. 20 4月, 2021 1 次提交
  4. 02 4月, 2021 6 次提交
  5. 14 1月, 2021 1 次提交
  6. 17 11月, 2020 1 次提交
  7. 29 10月, 2020 1 次提交
  8. 29 9月, 2020 1 次提交
  9. 24 9月, 2020 5 次提交
  10. 15 6月, 2020 4 次提交
  11. 08 4月, 2020 1 次提交
    • K
      perf/x86/intel/uncore: Add Ice Lake server uncore support · 2b3b76b5
      Kan Liang 提交于
      The uncore subsystem in Ice Lake server is similar to previous server.
      There are some differences in config register encoding and pci device
      IDs. The uncore PMON units in Ice Lake server include Ubox, Chabox, IIO,
      IRP, M2PCIE, PCU, M2M, PCIE3 and IMC.
      
       - For CHA, filter 1 register has been removed. The filter 0 register can
         be used by and of CHA events to be filterd by Thread/Core-ID. To do
         so, the control register's tid_en bit must be set to 1.
       - For IIO, there are some changes on event constraints. The MSR address
         and MSR offsets among counters are also changed.
       - For IRP, the MSR address and MSR offsets among counters are changed.
       - For M2PCIE, the counters are accessed by MSR now. Add new MSR address
         and MSR offsets. Change event constraints.
       - To determine the number of CHAs, have to read CAPID6(Low) and CAPID7
         (High) now.
       - For M2M, update the PCICFG address and Device ID.
       - For UPI, update the PCICFG address, Device ID and counter address.
       - For M3UPI, update the PCICFG address, Device ID, counter address and
         event constraints.
       - For IMC, update the formular to calculate MMIO BAR address, which is
         MMIO_BASE + specific MEM_BAR offset.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Link: https://lkml.kernel.org/r/1585842411-150452-1-git-send-email-kan.liang@linux.intel.com
      2b3b76b5
  12. 25 3月, 2020 1 次提交
  13. 11 2月, 2020 1 次提交
  14. 28 10月, 2019 1 次提交
    • K
      perf/x86/uncore: Fix event group support · 75be6f70
      Kan Liang 提交于
      The events in the same group don't start or stop simultaneously.
      Here is the ftrace when enabling event group for uncore_iio_0:
      
        # perf stat -e "{uncore_iio_0/event=0x1/,uncore_iio_0/event=0xe/}"
      
                  <idle>-0     [000] d.h.  8959.064832: read_msr: a41, value
        b2b0b030		//Read counter reg of IIO unit0 counter0
                  <idle>-0     [000] d.h.  8959.064835: write_msr: a48, value
        400001			//Write Ctrl reg of IIO unit0 counter0 to enable
        counter0. <------ Although counter0 is enabled, Unit Ctrl is still
        freezed. Nothing will count. We are still good here.
                  <idle>-0     [000] d.h.  8959.064836: read_msr: a40, value
        30100                   //Read Unit Ctrl reg of IIO unit0
                  <idle>-0     [000] d.h.  8959.064838: write_msr: a40, value
        30000			//Write Unit Ctrl reg of IIO unit0 to enable all
        counters in the unit by clear Freeze bit  <------Unit0 is un-freezed.
        Counter0 has been enabled. Now it starts counting. But counter1 has not
        been enabled yet. The issue starts here.
                  <idle>-0     [000] d.h.  8959.064846: read_msr: a42, value 0
      			//Read counter reg of IIO unit0 counter1
                  <idle>-0     [000] d.h.  8959.064847: write_msr: a49, value
        40000e			//Write Ctrl reg of IIO unit0 counter1 to enable
        counter1.   <------ Now, counter1 just starts to count. Counter0 has
        been running for a while.
      
      Current code un-freezes the Unit Ctrl right after the first counter is
      enabled. The subsequent group events always loses some counter values.
      
      Implement pmu_enable and pmu_disable support for uncore, which can help
      to batch hardware accesses.
      
      No one uses uncore_enable_box and uncore_disable_box. Remove them.
      Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: linux-drivers-review@eclists.intel.com
      Cc: linux-perf@eclists.intel.com
      Fixes: 087bfbb0 ("perf/x86: Add generic Intel uncore PMU support")
      Link: https://lkml.kernel.org/r/1572014593-31591-1-git-send-email-kan.liang@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      75be6f70
  15. 28 8月, 2019 4 次提交
  16. 17 6月, 2019 6 次提交
  17. 14 6月, 2019 1 次提交
  18. 23 5月, 2019 2 次提交