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>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Apr 2018 09:08:54 +0800
From:   Peng Hao <peng.hao2@....com.cn>
To:     tglx@...utronix.de, pbonzini@...hat.com, mingo@...hat.com,
        x86@...nel.org, peterz@...radead.org, len.brown@...el.com
Cc:     linux-kernel@...r.kernel.org, Peng Hao <peng.hao2@....com.cn>
Subject: [PATCH] x86: tsc: fix L2 guest always in tsc_early clocksource

In L2 guest tsc_read_refs always return ULLONG_MAX, and that will
call tsc_refine_calibration_work periodly. So L2 guest will read
acpi timer port 0x608 periodly.
The patch will let it out of "if(tsc_start == -1){}" infinite loop.

Signed-off-by: Peng Hao <peng.hao2@....com.cn>
---
 arch/x86/kernel/tsc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ef32297..828ef50 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1236,7 +1236,7 @@ struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns)
  */
 static void tsc_refine_calibration_work(struct work_struct *work)
 {
-	static u64 tsc_start = -1, ref_start;
+	static u64 tsc_start = 0, ref_start;
 	static int hpet;
 	u64 tsc_stop, ref_stop, delta;
 	unsigned long freq;
@@ -1251,7 +1251,7 @@ static void tsc_refine_calibration_work(struct work_struct *work)
 	 * delayed the first time we expire. So set the workqueue
 	 * again once we know timers are working.
 	 */
-	if (tsc_start == -1) {
+	if (tsc_start == 0) {
 		/*
 		 * Only set hpet once, to avoid mixing hardware
 		 * if the hpet becomes enabled later.
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ