kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[]
authorFares Mehanna <faresx@amazon.de>
Wed, 15 Sep 2021 13:39:50 +0000 (13:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Oct 2021 12:40:58 +0000 (14:40 +0200)
commitae34f26d4a8487e37ab9cfdca72f447c1ef49aa5
tree45ff7845ceb95275256c36bdb06a35aefb5d305e
parent6d0ff920599960a22ea520afda99eed3096c0e12
kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[]

[ Upstream commit e1fc1553cd78292ab3521c94c9dd6e3e70e606a1 ]

Intel PMU MSRs is in msrs_to_save_all[], so add AMD PMU MSRs to have a
consistent behavior between Intel and AMD when using KVM_GET_MSRS,
KVM_SET_MSRS or KVM_GET_MSR_INDEX_LIST.

We have to add legacy and new MSRs to handle guests running without
X86_FEATURE_PERFCTR_CORE.

Signed-off-by: Fares Mehanna <faresx@amazon.de>
Message-Id: <20210915133951.22389-1-faresx@amazon.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c