[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: Wed, 13 Oct 2021 08:03:16 +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=u4pG7VayPm+u5jMzBACF1Bm/9rJgUS4ItFuoNWrmdhY=; b=Z08FmuNkp7deKuUwnsfeQAcQaHwXQgXwjiQ3zzaV28BIhGlAqyQtZDKazATfDMq2k1lvuSE7Wu7R58hgGDrAdjXuyFodvHpz0D8ARobfmwgYW2J6hF7znY0eYejVA63VHWgopT1x2N+I3J6xaPFcu00390FXS0Oq3GbjmAwW13iDoQLMACDWUALTmCdmJuDZvvbQIHgpl57nbKxdpMzqLtsfefnGaWshG0x/FPYtuWe5ZQBygDwsZxucoQNbB3EgOVslhwBS0nLmbVDTY6MO88U/rBS0hErgFZx4rck05QabCLk+2Yr0RPBRXvQy2YglsS2koJIGIX9K2gxvUEXcMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ExC+72lwj2KESJRAySfbV6fFmrVEJRSHGcs1ig/BSkzjUIr2CsA28jTogXdEpcwCMu5A5GMslWMNTcBRu2foar7fbUtlzoXCNRZW84BYh3w+8CSC6/v47zeRKgqR9tiDwEiBcindflpqL1ZGnDk7kOzBd+Jy4f64L5+zkGR+IGNgwcVLmVurcOa7A/jPerwoJtgXygTg51eVJEd0KX41NXtP+QaEfzKK2DNZiGNgGoTFwItFl+nfDnCyy9E4/TNRadcyGU7nF/0Jehvea8+SG6yZ1QvaCpFRnmX5GEpXNiT5Kf2E5RvRwRPb0cDGXGNZgAVj4ARWUC6RB7Or42tUZQ==
  • 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: Wed, 13 Oct 2021 06:03:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.10.2021 18:15, Dongli Zhang wrote:
> Hi Jan,
> 
> On 10/12/21 8:49 AM, Jan Beulich wrote:
>> On 12.10.2021 17:43, Dongli Zhang wrote:
>>> 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'd much prefer to avoid this. I don't think the function can be that
>> difficult to introduce. And I'm sure the Arm maintainers will apply
>> extra care during review if you point out that you weren't able to
>> actually test this.
>>
> 
> I do not see pvclock used by arm/arm64 in linux kernel for xen.
> 
> In addition, the implementation at xen hypervisor side is empty.
> 
> 348 /* VCPU PV clock. */
> 349 void update_vcpu_system_time(struct vcpu *v)
> 350 {
> 351     /* XXX update shared_info->wc_* */
> 352 }
> 
> I will add a wrapper for it.
> 
> The bad thing is I see riscv is supported by xen and we may need to add the
> function for riscv as well.

There's not really any code for RISC-V yet, so that'll be of concern to
those who are working on adding actual code later on. I'm actually
wondering about the status of that effort - after the initial bits were
added over 3 months ago, no further activity has been visible.

Jan




 


Rackspace

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