]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource: hyper-v: Skip unnecessary checks for the root partition
authorWei Liu <wei.liu@kernel.org>
Tue, 12 Aug 2025 19:48:45 +0000 (19:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:36 +0000 (15:37 -0500)
commit78d6283bad9060fb5ee54656ae4cf6fd39a7de8e
tree71e3306cdc4a6d27933e71c18c2265816667eca0
parent33f9fab3c20bbbdb7e5360402fd8fa71c264bf3c
clocksource: hyper-v: Skip unnecessary checks for the root partition

[ Upstream commit 47691ced158ab3a7ce2189b857b19c0c99a9aa80 ]

The HV_ACCESS_TSC_INVARIANT bit is always zero when Linux runs as the
root partition. The root partition will see directly what the hardware
provides.

The old logic in ms_hyperv_init_platform caused the native TSC clock
source to be incorrectly marked as unstable on x86. Fix it.

Skip the unnecessary checks in code for the root partition. Add one
extra comment in code to clarify the behavior.

Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kernel/cpu/mshyperv.c
drivers/clocksource/hyperv_timer.c