[SRU][J:linux-azure][PATCH 4/6] clocksource: hyper-v: Introduce a pointer to TSC page

John Cabaj john.cabaj at canonical.com
Tue Jan 20 19:15:53 UTC 2026


From: Stanislav Kinsburskiy <stanislav.kinsburskiy at gmail.com>

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

Will be used later keep the address of the remapped page for the root
partition as it will be Microsoft Hypervisor defined (and thus won't be a
static address).

Signed-off-by: Stanislav Kinsburskiy <stanislav.kinsburskiy at gmail.com>
CC: "K. Y. Srinivasan" <kys at microsoft.com>
CC: Haiyang Zhang <haiyangz at microsoft.com>
CC: Wei Liu <wei.liu at kernel.org>
CC: Dexuan Cui <decui at microsoft.com>
CC: Daniel Lezcano <daniel.lezcano at linaro.org>
CC: Thomas Gleixner <tglx at linutronix.de>
CC: linux-hyperv at vger.kernel.org
CC: linux-kernel at vger.kernel.org
Reviewed-by: Michael Kelley <mikelley at microsoft.com>
Reviewed-by: Anirudh Rayabharam <anrayabh at linux.microsoft.com>
Link: https://lore.kernel.org/r/166749832893.218190.16503272948154953294.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net
Signed-off-by: Wei Liu <wei.liu at kernel.org>
(backported from commit 76be6331a81607359cb41ca20ec5388c68c855e3)
[john-cabaj: leaving out unrelated change from u64 to
union hv_reference_tsc_msr of tsc_msr variable]
Signed-off-by: John Cabaj <john.cabaj at canonical.com>
---
 drivers/clocksource/hyperv_timer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 527649ac40fe1..d8da92bdb3067 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -381,9 +381,11 @@ static union {
 	u8 reserved[PAGE_SIZE];
 } tsc_pg __aligned(PAGE_SIZE);
 
+static struct ms_hyperv_tsc_page *tsc_page = &tsc_pg.page;
+
 struct ms_hyperv_tsc_page *hv_get_tsc_page(void)
 {
-	return &tsc_pg.page;
+	return tsc_page;
 }
 EXPORT_SYMBOL_GPL(hv_get_tsc_page);
 
@@ -427,7 +429,7 @@ static void suspend_hv_clock_tsc(struct clocksource *arg)
 
 static void resume_hv_clock_tsc(struct clocksource *arg)
 {
-	phys_addr_t phys_addr = virt_to_phys(&tsc_pg);
+	phys_addr_t phys_addr = virt_to_phys(tsc_page);
 	u64 tsc_msr;
 
 	/* Re-enable the TSC page */
-- 
2.43.0




More information about the kernel-team mailing list