The guest may access the pv vcpu_time_info immediately after
VCPUOP_register_vcpu_info. This is to borrow the idea of
VCPUOP_register_vcpu_time_memory_area, where the
force_update_vcpu_system_time() is called immediately when the new memory
area is registered.
Otherwise, we may observe clock drift at the VM side if the VM accesses
the clocksource immediately after VCPUOP_register_vcpu_info().
Reference: https://lists.xenproject.org/archives/html/xen-devel/2021-10/msg00571.html
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
/* XXX update shared_info->wc_* */
}
+void force_update_vcpu_system_time(struct vcpu *v)
+{
+ update_vcpu_system_time(v);
+}
+
void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
{
d->time_offset.seconds = time_offset_seconds;
rc = map_vcpu_info(v, info.mfn, info.offset);
domain_unlock(d);
+ force_update_vcpu_system_time(v);
+
break;
}
void preinit_xen_time(void);
+void force_update_vcpu_system_time(struct vcpu *v);
+
#endif /* __ARM_TIME_H__ */
/*
* Local variables: