Skip to content

Commit 7304910

Browse files
committed
hyperv: Fix usage of wrong time ref MSR on x86
When 668afda ("arm64: hyperv: Fix build breakage for non-ARM64 architectures") was forward ported to 6.18, the similarly named HV_REGISTER_TIME_REF_COUNT was used instead of HV_MSR_TIME_REF_COUNT. The HV_REGISTER_TIME_REF_COUNT register is ARM64-specific, so when it was used on x86, it produced garbage. This entirely breaks timekeeping on guests without a TSC. Use HV_MSR_TIME_REF_COUNT instead, which results to the correct MSR for the current arch. Fixes: 668afda ("arm64: hyperv: Fix build breakage for non-ARM64 architectures") Signed-off-by: Mitchell Levy <levymitchell0@gmail.com>
1 parent ea0cd9a commit 7304910

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/clocksource/hyperv_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ static __always_inline u64 read_hv_clock_msr(void)
393393
* it doesn't need the GHCB path.
394394
*/
395395
#ifdef CONFIG_ARM64
396-
return hv_get_msr(HV_REGISTER_TIME_REF_COUNT);
396+
return hv_get_msr(HV_MSR_TIME_REF_COUNT);
397397
#else
398-
return hv_raw_get_msr(HV_REGISTER_TIME_REF_COUNT);
398+
return hv_raw_get_msr(HV_MSR_TIME_REF_COUNT);
399399
#endif
400400
}
401401

0 commit comments

Comments
 (0)