Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
AMD Preparing Linux "PerfMonV2" Support In Preparation For Zen 4
AMD's Linux kernel activity around "upcoming" and "new generation" processors continues ramping up over the past number of weeks. Given the timing and AMD not at a stage of pushing out patches publicly for processor features multiple generations in advance, it basically means Zen 4.
This morning's set of Linux kernel patches is for changes enabling AMD Performance Monitoring V2 capabilities. This is about enabling support for AMD's performance counters under Linux. For years they have allowed their performance counters to be exposed through the perf subsystem and now are preparing PerfMonV2 in advance of future CPUs.
The PerfMonV2 support is checked based on a new CPU feature bit, but given the timing is surely for the Zen 4 processors coming down the pipe in a few months. AMD Performance Monitoring V2 has new "global" registers to allow enabling/disabling multiple performance counters at the same time. With the AMD Performance Monitoring up to this point, the different performance counter controls all had to be set individually while now can be set easily in one go using the global registers where present.
AMD Performance Monitoring V2 also allows for systematically detecting the number of core PMCs rather than being statically set on a per-family basis. There is also a fix to the x86 KVM code as part of this series to avoid attempting to access an invalid MSR that results in KVM guest start-up breaking when detecting PerfMonV2. This patch should get back-ported to the Linux kernel stable series and properly fix things up in time for Zen 4 CPUs appearing.
That's it as far as these initial AMD PerfMonV2 enablement patches are concerned with no other features being exposed yet by this code work. See this patch series for this initial PerfMonV2 support which given the timing will see its first opportunity for mainlining come to the v5.19 cycle this summer.