[SRU][J:linux-azure][PATCH 2/2] Revert "UBUNTU: SAUCE: clocksource: hyper-v: do not use an insanely big TSC in hv_read_tsc_page_tsc()"

John Cabaj john.cabaj at canonical.com
Tue Sep 22 20:53:53 UTC 2026


BugLink: https://bugs.launchpad.net/bugs/2167893

This reverts commit b549a6883d3d1b062c1b4df210b7fdd89f5dd332.

Signed-off-by: John Cabaj <john.cabaj at canonical.com>
---
 drivers/clocksource/hyperv_timer.c | 4 +---
 include/clocksource/hyperv_timer.h | 4 ----
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index eb4be58f37552..d8da92bdb3067 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -399,10 +399,8 @@ static __always_inline u64 read_hv_clock_tsc(void)
 	 * times are in sync and monotonic. Therefore we can fall back
 	 * to the MSR in case the TSC page indicates unavailability.
 	 */
-	if (!hv_read_tsc_page_tsc(tsc_page, &cur_tsc, &time)) {
-		WARN_ONCE(((s64)cur_tsc) < 0, "TSC is too big: %llx\n", cur_tsc);
+	if (!hv_read_tsc_page_tsc(tsc_page, &cur_tsc, &time))
 		time = read_hv_clock_msr();
-	}
 
 	return time;
 }
diff --git a/include/clocksource/hyperv_timer.h b/include/clocksource/hyperv_timer.h
index 9a0bf217f2bca..d9579aa836e18 100644
--- a/include/clocksource/hyperv_timer.h
+++ b/include/clocksource/hyperv_timer.h
@@ -73,10 +73,6 @@ hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page *tsc_pg,
 		offset = READ_ONCE(tsc_pg->tsc_offset);
 		*cur_tsc = hv_get_raw_timer();
 
-		/* In case the TSC is insanely big, do not use it. */
-		if (((s64)*cur_tsc) < 0)
-			return false;
-
 		/*
 		 * Make sure we read sequence after we read all other values
 		 * from TSC page.
-- 
2.43.0




More information about the kernel-team mailing list