KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX
authorTom Lendacky <thomas.lendacky@amd.com>
Fri, 15 Sep 2023 20:54:32 +0000 (15:54 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 23 Sep 2023 09:35:49 +0000 (05:35 -0400)
commit916e3e5f26abc165437950daff370c0693572ef4
tree3fd011f96d5876a08e1f50b4fca66214a5f54824
parente0096d01c4fcb8c96c05643cfc2c20ab78eae4da
KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX

When the TSC_AUX MSR is virtualized, the TSC_AUX value is swap type "B"
within the VMSA. This means that the guest value is loaded on VMRUN and
the host value is restored from the host save area on #VMEXIT.

Since the value is restored on #VMEXIT, the KVM user return MSR support
for TSC_AUX can be replaced by populating the host save area with the
current host value of TSC_AUX. And, since TSC_AUX is not changed by Linux
post-boot, the host save area can be set once in svm_hardware_enable().
This eliminates the two WRMSR instructions associated with the user return
MSR support.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: <d381de38eb0ab6c9c93dda8503b72b72546053d7.1694811272.git.thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c