lkml.org 
[lkml]   [2015]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 10/12] KVM: VMX: Setup TSC scaling ratio when a vcpu is loaded
    Date
    This patch makes kvm-intel module to load TSC scaling ratio into TSC
    multiplier field of VMCS when a vcpu is loaded, so that TSC scaling
    ratio can take effect if VMX TSC scaling is enabled.

    Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
    ---
    arch/x86/kvm/vmx.c | 6 ++++++
    1 file changed, 6 insertions(+)

    diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
    index ef19eb8..e282eb8 100644
    --- a/arch/x86/kvm/vmx.c
    +++ b/arch/x86/kvm/vmx.c
    @@ -1952,6 +1952,12 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)

    rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp);
    vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */
    +
    + /* Setup TSC multiplier */
    + if (cpu_has_vmx_tsc_scaling())
    + vmcs_write64(TSC_MULTIPLIER,
    + vcpu->arch.tsc_scaling_ratio);
    +
    vmx->loaded_vmcs->cpu = cpu;
    }
    }
    --
    2.4.8


    \
     
     \ /
      Last update: 2015-09-28 08:01    [W:4.082 / U:0.672 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site