]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: SVM: fix tsc scaling when the host doesn't support it
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 22 Mar 2022 17:24:48 +0000 (19:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Apr 2022 09:37:26 +0000 (05:37 -0400)
commit92c79ab8ad3e88d17f1ed996b6c6ed76774b6c4d
treeb586f8d40d19238f593bf0cf3b13eef90129912a
parent9838459017b045f4add321c9957d2a76d09321ec
KVM: x86: SVM: fix tsc scaling when the host doesn't support it

It was decided that when TSC scaling is not supported,
the virtual MSR_AMD64_TSC_RATIO should still have the default '1.0'
value.

However in this case kvm_max_tsc_scaling_ratio is not set,
which breaks various assumptions.

Fix this by always calculating kvm_max_tsc_scaling_ratio regardless of
host support.  For consistency, do the same for VMX.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220322172449.235575-8-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c