Messages in this thread Patch in this message | | | From | Dongli Zhang <> | Subject | [PATCH xen 2/2] xen: update system time immediately when VCPUOP_register_vcpu_info | Date | Tue, 12 Oct 2021 00:24:28 -0700 |
| |
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().
Cc: Joe Jin <joe.jin@oracle.com> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> --- xen/common/domain.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/xen/common/domain.c b/xen/common/domain.c index 40d67ec342..c879f6723b 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1695,6 +1695,8 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg) rc = map_vcpu_info(v, info.mfn, info.offset); domain_unlock(d); + force_update_vcpu_system_time(v); + break; } -- 2.17.1
| |