[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210205100317.24174-8-fengzhimin@bytedance.com>
Date: Fri, 5 Feb 2021 18:03:15 +0800
From: Zhimin Feng <fengzhimin@...edance.com>
To: x86@...nel.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: pbonzini@...hat.com, seanjc@...gle.com, vkuznets@...hat.com,
wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
fweisbec@...il.com, zhouyibo@...edance.com,
zhanghaozhong@...edance.com, Zhimin Feng <fengzhimin@...edance.com>
Subject: [RFC: timer passthrough 7/9] KVM: vmx: save the initial value of host tscd
Record the host tscd value.
Signed-off-by: Zhimin Feng <fengzhimin@...edance.com>
---
arch/x86/kvm/vmx/vmx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index a12da3cef86d..98eca70d4251 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -251,8 +251,11 @@ static void vmx_host_timer_passth_init(void *junk)
{
struct timer_passth_info *local_timer_info;
int cpu = smp_processor_id();
+ u64 tscd;
local_timer_info = &per_cpu(passth_info, cpu);
+ rdmsrl(MSR_IA32_TSC_DEADLINE, tscd);
+ local_timer_info->host_tscd = tscd;
local_timer_info->curr_dev = per_cpu(tick_cpu_device, cpu).evtdev;
local_timer_info->orig_set_next_event =
local_timer_info->curr_dev->set_next_event;
@@ -266,6 +269,7 @@ static void vmx_host_timer_restore(void *junk)
local_timer_info = &per_cpu(passth_info, smp_processor_id());
local_timer_info->curr_dev->set_next_event =
local_timer_info->orig_set_next_event;
+ local_timer_info->host_tscd = 0;
}
#define L1D_CACHE_ORDER 4
--
2.11.0
Powered by blists - more mailing lists