This QEMU series exposes AMD's Last Branch Record Extension Version 2
(LbrExtV2) and the dependent LBR/PMC freeze feature to guests, so that
they can use the LBRv2 virtualization provided by KVM.
LbrExtV2, introduced on Zen 4, is a branch sampling facility. It records
the last taken branches in a 16-entry stack of dedicated MSRs:
* MSR 0xC000010E - Last Branch Stack Select (LBR_SELECT)
* MSR 0xC000010F - Debug Extension Control (DBG_EXTN_CFG)
* MSR 0xC0010300..0xC001031F - 16 LBR FROM/TO MSR pairs
v1: https://lore.kernel.org/qemu-devel/20260724201203.633799-1-shivansh.dhiman@amd.com/
Regards,
Shivansh
---
Changelog:
v1 -> v2:
* Rebased on v11.1.2.
* New patch to read and write the LbrExtV2 MSRs with KVM_GET_MSRS and
KVM_SET_MSRS (patch 1).
* New patch to migrate the LbrExtV2 MSRs in a new VMState subsection
(patch 2).
* Moved the CPUID_8000_0022_EAX_LBREXT_V2 definition to patch 1.
---
Shivansh Dhiman (4):
target/i386: Add MSR access interface for AMD LbrExtV2
target/i386: Add AMD LbrExtV2 states to vmstate
target/i386: Add support for AMD LbrExtV2
target/i386: Add support for AMD LBR/PMC freeze
target/i386/cpu.c | 26 +++++++++++++++++++++++---
target/i386/cpu.h | 15 ++++++++++++++-
target/i386/kvm/kvm.c | 31 +++++++++++++++++++++++++++++++
target/i386/machine.c | 24 ++++++++++++++++++++++++
4 files changed, 92 insertions(+), 4 deletions(-)
base-commit: 4fc49f46dc95d4a27de2509e7fceb2931e91faeb
--
2.43.0