AMD Preparing Linux "PerfMonV2" Support In Preparation For Zen 4

Written by Michael Larabel in AMD on 17 March 2022 at 05:50 AM EDT. 1 Comment
The latest Linux kernel patch activity out of AMD in preparation for next-generation "Zen 4" processors is enabling AMD Performance Monitoring Version Two "PerfMonV2" support.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week