Patch "x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-hyperv-set-x86_feature_tsc_known_freq-when-hyper.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2b9b9241d9dcde22387a4869e2cd6e9986bef9ef
Author: Michael Kelley <mhklinux@xxxxxxxxxxx>
Date:   Wed Jun 5 19:55:59 2024 -0700

    x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency
    
    [ Upstream commit 8fcc514809de41153b43ccbe1a0cdf7f72b78e7e ]
    
    A Linux guest on Hyper-V gets the TSC frequency from a synthetic MSR, if
    available. In this case, set X86_FEATURE_TSC_KNOWN_FREQ so that Linux
    doesn't unnecessarily do refined TSC calibration when setting up the TSC
    clocksource.
    
    With this change, a message such as this is no longer output during boot
    when the TSC is used as the clocksource:
    
    [    1.115141] tsc: Refined TSC clocksource calibration: 2918.408 MHz
    
    Furthermore, the guest and host will have exactly the same view of the
    TSC frequency, which is important for features such as the TSC deadline
    timer that are emulated by the Hyper-V host.
    
    Signed-off-by: Michael Kelley <mhklinux@xxxxxxxxxxx>
    Reviewed-by: Roman Kisel <romank@xxxxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240606025559.1631-1-mhklinux@xxxxxxxxxxx
    Signed-off-by: Wei Liu <wei.liu@xxxxxxxxxx>
    Message-ID: <20240606025559.1631-1-mhklinux@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 9b039e9635e40..542b818c0d20d 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -324,6 +324,7 @@ static void __init ms_hyperv_init_platform(void)
 	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
 		x86_platform.calibrate_tsc = hv_get_tsc_khz;
 		x86_platform.calibrate_cpu = hv_get_tsc_khz;
+		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	}
 
 	if (ms_hyperv.priv_high & HV_ISOLATION) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux