diff options
author | Michael Kelley <mikelley@microsoft.com> | 2021-03-02 22:38:21 +0100 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2021-03-08 18:33:00 +0100 |
commit | 4c78738ead4e195c7032c31fe56135c1b00e1784 (patch) | |
tree | 94af0e1acba521dacc39ac8c40964190377cca95 /arch/x86/hyperv/hv_init.c | |
parent | clocksource/drivers/hyper-v: Handle sched_clock differences inline (diff) | |
download | linux-4c78738ead4e195c7032c31fe56135c1b00e1784.tar.xz linux-4c78738ead4e195c7032c31fe56135c1b00e1784.zip |
clocksource/drivers/hyper-v: Set clocksource rating based on Hyper-V feature
On x86/x64, the TSC clocksource is available in a Hyper-V VM only if
Hyper-V provides the TSC_INVARIANT flag. The rating on the Hyper-V
Reference TSC page clocksource is currently set so that it will not
override the TSC clocksource in this case. Alternatively, if the TSC
clocksource is not available, then the Hyper-V clocksource is used.
But on ARM64, the Hyper-V Reference TSC page clocksource should
override the ARM arch counter, since the Hyper-V clocksource provides
scaling and offsetting during live migrations that is not provided
for the ARM arch counter.
To get the needed behavior for both x86/x64 and ARM64, tweak the
logic by defaulting the Hyper-V Reference TSC page clocksource
rating to a large value that will always override. If the Hyper-V
TSC_INVARIANT flag is set, then reduce the rating so that it will not
override the TSC.
While the logic for getting there is slightly different, the net
result in the normal cases is no functional change.
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1614721102-2241-10-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'arch/x86/hyperv/hv_init.c')
0 files changed, 0 insertions, 0 deletions