[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH xen 2/2] xen: update system time immediately when VCPUOP_register_vcpu_info


  • To: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 12 Oct 2021 10:40:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JJrnzztcgpAUtNQ9QtKq8z2DdFZssTkvFswiHvb4aLg=; b=feUryQlUXsrUphk53oqfvex7WBSOlshLGRgPph8ISvdqfzQT4dRdfDlprOGSRbARPj9lyjDfJ3kW7PS3/izaodd19nMYsQ+azNX6/GTPOgrtmrPP+S16xZpS9VGkEWf+sttn343vMGtpdG2OG4Fa9jkp9Ni37S76z2/3KHtCM8Ha7xR98LirRYrwNg19y27EU9WdRZlPPOkbL8KNM26rIZGrOOuHD6ASdjWpuG1yl2Wf2iaRqVaXehkGW3ke8fycgUqZv1XZFkes1I/2XTofTCJISCQhnRxzl7FzUDMzl4pQShQW71gx+AUa7Zd00rOufv74XABHXwqYRJuD/UQv3w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xz8BiXZG0ZxM/iUBDufux8NmZE6L0IwQUa0QvA4SnqD0I9ipVX6tfeyJrgrnx6aUIjer7kIL90UO6VkXfOFTCe1RmmOPCDfE65SBHHsJ2tgSKwacrFQTTnWIyd1ZQrsWaAIiY0KSDILXJ0FGKWdzmMjY78okCqcRt6CXkG7w0U/MsX1p7dbcF34MyTV18gv9vDZPNDKXutskzeoP5zltQ6nI6m5GMTFx3PJGZ8UX6VXpdl14x5ycdsGcXRjB6SA2GcRQTFaNv7pSVnKD+uA0Wd7ZzBJMdwiJ+4szPAlxI47sUDxOV8IvxNL5xI/P7VwT2y5Nt23uca1DjWkRNiug/A==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, iwj@xxxxxxxxxxxxxx, julien@xxxxxxx, wl@xxxxxxx, joe.jin@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 12 Oct 2021 08:40:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.10.2021 09:24, Dongli Zhang wrote:
> 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@xxxxxxxxxx>
> Signed-off-by: Dongli Zhang <dongli.zhang@xxxxxxxxxx>

While I agree with the change in principle, ...

> --- 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);

... I'm afraid you're breaking the Arm build here. Arm will first need
to gain this function.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.