summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorHaozhong Zhang2015-10-20 09:39:01 +0200
committerPaolo Bonzini2015-11-10 12:06:14 +0100
commitbc9b961b357ea8129d75613b7af4fdf57ced9b9f (patch)
tree48a66aa2209463b4c59bb47510400780ca83902c /arch/x86/kvm/svm.c
parentKVM: x86: declare a few variables as __read_mostly (diff)
downloadkernel-qcow2-linux-bc9b961b357ea8129d75613b7af4fdf57ced9b9f.tar.gz
kernel-qcow2-linux-bc9b961b357ea8129d75613b7af4fdf57ced9b9f.tar.xz
kernel-qcow2-linux-bc9b961b357ea8129d75613b7af4fdf57ced9b9f.zip
KVM: x86: Collect information for setting TSC scaling ratio
The number of bits of the fractional part of the 64-bit TSC scaling ratio in VMX and SVM is different. This patch makes the architecture code to collect the number of fractional bits and other related information into variables that can be accessed in the common code. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index f2c8e4917688..74712ead9787 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -908,6 +908,9 @@ static __init int svm_hardware_setup(void)
max = min(0x7fffffffULL, __scale_tsc(tsc_khz, TSC_RATIO_MAX));
kvm_max_guest_tsc_khz = max;
+
+ kvm_max_tsc_scaling_ratio = TSC_RATIO_MAX;
+ kvm_tsc_scaling_ratio_frac_bits = 32;
}
if (nested) {