lkml.org 
[lkml]   [2018]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] kvmclock: fix nested guest always in tsc_early clocksource
Date
In nested guest tsc_read_refs always return ULLONG_MAX, and that will
call tsc_refine_calibration_work periodly. So nested guest will read
acpi timer port 0x608 periodly.

The patch set X86_FEATURE_TSC_KNOWN_FREQ for kvmclock to avoid
'refine' operation.

Thanks for PeterZijlstra's advice.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
arch/x86/kernel/kvmclock.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 8b26c9e..fc1562e 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -138,6 +138,7 @@ static unsigned long kvm_get_tsc_khz(void)
src = &hv_clock[cpu].pvti;
tsc_khz = pvclock_tsc_khz(src);
put_cpu();
+ setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
return tsc_khz;
}

--
1.8.3.1
\
 
 \ /
  Last update: 2018-07-15 22:07    [W:0.022 / U:2.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site