[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
  • Date: Tue, 12 Oct 2021 08:43:05 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.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=m/j0VXFfTgww0jA+0/BLqc1t2J21ixLL93BdHs9cfMQ=; b=HKngeEmtIzGcda+mWkQSGzumFmSZfie+ok8iJAXDZkL5VfC1VUgOmsnPQBwptwgpqbsU02pBJVDnPNx+UDEEWdHTqA8w5kIWN24SEuMQ6Lugwf+m0AjzCvLD4E4bZ/V+ZT5UAh1eDBZuLlTJphff5IwvJ2WzW5rFVMDwiodv+hZxuYM3vEacDJ9DMpABWKKEsxkKsvbHEjIpnefNXnHt79xiphCJ6Wc+BjkO2i5VUFy1sAvgKKWN7mQZx7TE3IOM18jSRCfONEnctS6b2wVh3G19wLWfoT/RW9Je5TuActY1rrHMxn3yiKt10j9UBTb/a8EyWzWB6GlA19QpTzAGUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ewBsFxHGrnsuqZEMCGnn/FsgYpCdCMpkiqu2VvW0mrHlyv/rIQEbfXvI2IgqEYvnvmUej7Ki9dzvx7mDflKfeRWwDLoC7Fu+F/js2royQKdA6awtM3Qj6/aO8tTBxHfwFCB1Oq+PDLooD7EdwkFfi9uXzra2b65kZSrecx+F0ip9LZgCAcRzw+PUvCi2Jvi3fEjpkZYswedfxIJXS/U5j541CliqFbfzIRrJphzAj1RboOo7AZ9w48ONfKUprI2ITxwqoYSWsHSfMVmNjX85I+bno3g7ede6MeVQFdrjSvEy5H+UyPag/mfrh/f0BAi9nY0Ac5YktvDUh0+4VM33nA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=oracle.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 15:44:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jan,

On 10/12/21 1:40 AM, Jan Beulich wrote:
> 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.
> 

Since I am not familiar with the Xen ARM, would you please let me your
suggestion if I just leave ARM as TODO to the ARM developers to verify
and implement force_update_vcpu_system_time()?

I have tested that the below can build with arm64/aarch64.

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 40d67ec342..644c65ecd3 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1695,6 +1695,13 @@ 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);

+#ifdef CONFIG_X86
+        /*
+         * TODO: ARM does not have force_update_vcpu_system_time().
+         */
+        force_update_vcpu_system_time(v);
+#endif
+
         break;
     }



Thank you very much!

Dongli Zhang



 


Rackspace

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