time.c (6e2d6b2728fcb408eabd7991804f8cb33ff59f20) time.c (5c83511bdb9832c86be20fb86b783356e2f58062)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Xen time implementation.
4 *
5 * This is implemented in terms of a clocksource driver which uses
6 * the hypervisor clock as a nanosecond timebase, and a clockevent
7 * driver which uses the hypervisor's timer mechanism.
8 *

--- 499 unchanged lines hidden (view full) ---

508
509 if (xen_initial_domain())
510 pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
511}
512
513void __init xen_init_time_ops(void)
514{
515 xen_sched_clock_offset = xen_clocksource_read();
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Xen time implementation.
4 *
5 * This is implemented in terms of a clocksource driver which uses
6 * the hypervisor clock as a nanosecond timebase, and a clockevent
7 * driver which uses the hypervisor's timer mechanism.
8 *

--- 499 unchanged lines hidden (view full) ---

508
509 if (xen_initial_domain())
510 pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
511}
512
513void __init xen_init_time_ops(void)
514{
515 xen_sched_clock_offset = xen_clocksource_read();
516 pv_time_ops = xen_time_ops;
516 pv_ops.time = xen_time_ops;
517
518 x86_init.timers.timer_init = xen_time_init;
519 x86_init.timers.setup_percpu_clockev = x86_init_noop;
520 x86_cpuinit.setup_percpu_clockev = x86_init_noop;
521
522 x86_platform.calibrate_tsc = xen_tsc_khz;
523 x86_platform.get_wallclock = xen_get_wallclock;
524 /* Dom0 uses the native method to set the hardware RTC. */

--- 25 unchanged lines hidden (view full) ---

550 return;
551
552 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {
553 pr_info("Xen doesn't support pvclock on HVM, disable pv timer");
554 return;
555 }
556
557 xen_sched_clock_offset = xen_clocksource_read();
517
518 x86_init.timers.timer_init = xen_time_init;
519 x86_init.timers.setup_percpu_clockev = x86_init_noop;
520 x86_cpuinit.setup_percpu_clockev = x86_init_noop;
521
522 x86_platform.calibrate_tsc = xen_tsc_khz;
523 x86_platform.get_wallclock = xen_get_wallclock;
524 /* Dom0 uses the native method to set the hardware RTC. */

--- 25 unchanged lines hidden (view full) ---

550 return;
551
552 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {
553 pr_info("Xen doesn't support pvclock on HVM, disable pv timer");
554 return;
555 }
556
557 xen_sched_clock_offset = xen_clocksource_read();
558 pv_time_ops = xen_time_ops;
558 pv_ops.time = xen_time_ops;
559 x86_init.timers.setup_percpu_clockev = xen_time_init;
560 x86_cpuinit.setup_percpu_clockev = xen_hvm_setup_cpu_clockevents;
561
562 x86_platform.calibrate_tsc = xen_tsc_khz;
563 x86_platform.get_wallclock = xen_get_wallclock;
564 x86_platform.set_wallclock = xen_set_wallclock;
565}
566#endif
559 x86_init.timers.setup_percpu_clockev = xen_time_init;
560 x86_cpuinit.setup_percpu_clockev = xen_hvm_setup_cpu_clockevents;
561
562 x86_platform.calibrate_tsc = xen_tsc_khz;
563 x86_platform.get_wallclock = xen_get_wallclock;
564 x86_platform.set_wallclock = xen_set_wallclock;
565}
566#endif