diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 5158c50..0976e44 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -332,16 +332,22 @@ static int xen_vcpuop_set_next_event(unsigned long delta, int cpu = smp_processor_id(); struct vcpu_set_singleshot_timer single; int ret; + s64 base; WARN_ON(evt->mode != CLOCK_EVT_MODE_ONESHOT); - single.timeout_abs_ns = get_abs_timeout(delta); - single.flags = VCPU_SSHOTTMR_future; + base = xen_clocksource_read(); + single.timeout_abs_ns = base + delta; + single.flags = VCPU_SSHOTTMR_future & 0; ret = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &single); BUG_ON(ret != 0 && ret != -ETIME); + if (ret == -ETIME) { + printk(KERN_WARNING "hypercall VCPUOP_set_singleshot_timer failed with -ETIME on %d CPU with params: timeout=%lld, flags=%d, base-pre: %lld, base-post: %lld\n", cpu, single.timeout_abs_ns, single.flags, base, get_abs_timeout(0)); + } + return ret; }