Lines Matching +full:no +full:- +full:tick +full:- +full:in +full:- +full:suspend

1 // SPDX-License-Identifier: GPL-2.0
5 * provided by the Hyper-V hypervisor to guest VMs, as described
6 * in the Hyper-V Top Level Functional Spec (TLFS). This driver
22 #include <asm/hyperv-tlfs.h>
31 * mechanism is used when running on older versions of Hyper-V
32 * that don't support Direct Mode. While Hyper-V provides
36 * message, stimer interrupts can be enabled earlier in the
39 * However, for legacy versions of Hyper-V when Direct Mode
51 * ISR for when stimer0 is operating in Direct Mode. Direct Mode
53 * in the VMbus driver code.
60 ce->event_handler(ce); in hv_stimer0_isr()
113 * hv_stimer_init - Per-cpu initialization of the clockevent
123 ce->name = "Hyper-V clockevent"; in hv_stimer_init()
124 ce->features = CLOCK_EVT_FEAT_ONESHOT; in hv_stimer_init()
125 ce->cpumask = cpumask_of(cpu); in hv_stimer_init()
126 ce->rating = 1000; in hv_stimer_init()
127 ce->set_state_shutdown = hv_ce_shutdown; in hv_stimer_init()
128 ce->set_state_oneshot = hv_ce_set_oneshot; in hv_stimer_init()
129 ce->set_next_event = hv_ce_set_next_event; in hv_stimer_init()
139 * hv_stimer_cleanup - Per-cpu cleanup of the clockevent
149 * In the legacy case where Direct Mode is not enabled in hv_stimer_cleanup()
151 * relatively early in the CPU offlining process. We in hv_stimer_cleanup()
152 * must unbind the stimer-based clockevent device so in hv_stimer_cleanup()
154 * are no longer needed in the offlining process. Note in hv_stimer_cleanup()
160 * there are no other clockevent devices to fallback to. in hv_stimer_cleanup()
172 /* hv_stimer_alloc - Global initialization of the clockevent and stimer0 */
179 * Hyper-V on x86. In that case, return as error as Linux will use a in hv_stimer_alloc()
183 return -EINVAL; in hv_stimer_alloc()
187 return -ENOMEM; in hv_stimer_alloc()
198 * Since we are in Direct Mode, stimer initialization in hv_stimer_alloc()
199 * can be done now with a CPUHP value in the same range in hv_stimer_alloc()
221 * hv_stimer_legacy_init -- Called from the VMbus driver to handle
223 * must be initialized late in the CPU onlining process.
234 * not ideal, but the value passed in is always the same and in hv_stimer_legacy_init()
236 * clocksource driver just to set the sint in the legacy case. in hv_stimer_legacy_init()
244 * hv_stimer_legacy_cleanup -- Called from the VMbus driver to
246 * stimer must be cleaned up early in the CPU offlining
258 /* hv_stimer_free - Free global resources allocated by hv_stimer_alloc() */
300 * Code and definitions for the Hyper-V clocksources. Two
301 * clocksources are defined: one that reads the Hyper-V defined MSR, and
302 * the other that uses the TSC reference page feature as defined in the
304 * Hyper-V and 32-bit x86. The TSC reference page version is preferred.
306 * The Hyper-V clocksource ratings of 250 are chosen to be below the
307 * TSC clocksource rating of 300. In configurations where Hyper-V offers
310 * default. On older hardware and Hyper-V versions, the TSC is marked
311 * "unstable", so no TSC clocksource is created and the selected Hyper-V
346 return (read_hv_clock_tsc() - hv_sched_clock_offset) * in read_hv_sched_clock_tsc()
366 /* Re-enable the TSC page */ in resume_hv_clock_tsc()
385 .suspend= suspend_hv_clock_tsc,
394 * Read the partition counter to get the current tick count. This count in read_hv_clock_msr()
395 * is set to 0 when the partition is created and is incremented in in read_hv_clock_msr()
409 return (read_hv_clock_msr() - hv_sched_clock_offset) * in read_hv_sched_clock_msr()
433 * The Hyper-V TLFS specifies to preserve the value of reserved in hv_init_tsc_clocksource()
434 * bits in registers. So read the existing value, preserve the in hv_init_tsc_clocksource()
435 * low order 12 bits, and add in the guest physical address in hv_init_tsc_clocksource()
459 * Hyper-V on x86. In that case we won't have a Hyper-V in hv_init_clocksource()