j = jiffies + 1;
}
- singleshot.timeout_abs_ns = jiffies_to_st(j) + NS_PER_TICK/2;
+ singleshot.timeout_abs_ns = jiffies_to_st(j);
+ if (!singleshot.timeout_abs_ns)
+ return;
+ singleshot.timeout_abs_ns += NS_PER_TICK / 2;
singleshot.flags = 0;
rc = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &singleshot);
#if CONFIG_XEN_COMPAT <= 0x030004
static void start_hz_timer(void)
{
- cpu_clear(smp_processor_id(), nohz_cpu_mask);
+ unsigned int cpu = smp_processor_id();
+ int rc = HYPERVISOR_vcpu_op(VCPUOP_stop_singleshot_timer, cpu, NULL);
+
+#if CONFIG_XEN_COMPAT <= 0x030004
+ if (rc) {
+ BUG_ON(rc != -ENOSYS);
+ rc = HYPERVISOR_set_timer_op(0);
+ }
+#endif
+ BUG_ON(rc);
+ cpu_clear(cpu, nohz_cpu_mask);
}
void raw_safe_halt(void)