lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1531582109-73498-1-git-send-email-peng.hao2@zte.com.cn>
Date:   Sat, 14 Jul 2018 23:28:29 +0800
From:   Peng Hao <peng.hao2@....com.cn>
To:     pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
        x86@...nel.org, peterz@...radead.org, mingo@...hat.com
Cc:     linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        Peng Hao <peng.hao2@....com.cn>
Subject: [PATCH v2] kvmclock: fix nested guest always in tsc_early clocksource

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ