target/i386: Add MSR access interface for Arch LBR
authorYang Weijiang <weijiang.yang@intel.com>
Tue, 15 Feb 2022 19:52:56 +0000 (14:52 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 14 May 2022 10:32:41 +0000 (12:32 +0200)
commit12703d4e7523a7841764200e1a7838736495da10
tree78f5b6069a58d2eecf815565eb9bbf76af49fe84
parent10f0abcb3b8a74a4db1412e844b9192dc9768e94
target/i386: Add MSR access interface for Arch LBR

In the first generation of Arch LBR, the max support
Arch LBR depth is 32, both host and guest use the value
to set depth MSR. This can simplify the implementation
of patch given the side-effect of mismatch of host/guest
depth MSR: XRSTORS will reset all recording MSRs to 0s
if the saved depth mismatches MSR_ARCH_LBR_DEPTH.

In most of the cases Arch LBR is not in active status,
so check the control bit before save/restore the big
chunck of Arch LBR MSRs.

Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
Message-Id: <20220215195258.29149-7-weijiang.yang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.h
target/i386/kvm/kvm.c