[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 05/10] x86: update GADDR based secondary time area
- To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 18 Jan 2023 10:25:18 +0100
- 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=q00CwzZYgjFUSgH0jbxOOZfZ1NsMwDeapivnXGKnI4M=; b=lWI/M48e3/yQQwamD3AhN3GZDRNSckP5/JSP9IcQT3GmJ0vrYpbjn46Of1hOqib+724h6zTop+7Ld0UKHCpTORZuUnW5mnOMcW74lDHcufxEmurCVbdK81JQxljNucMlyzKrzLXercXyyvJm+gYpPXMJnyj6stdWAx3MKUay3iRILsqFjnL1dJUgK0+fl0YV87Mk7ZGQ7Kngs3PgFNoolB7S1AnJrdpPoxEyDqvmdwAwsu8RRDWlDM32XCzSMjeQd8VkqhB+FdKJ6axqqUq9ZeQT13brzfKGsFP03iW0NByOj6Gr0vc7tLzK+5VT8Qxog86ioeKzzlYneCTMexNLuw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NOczQuQRhOJIZxztP/7SsvB+38bAtNgKsAxF7GOEYE4Zx5w2rOApA2eMElQSldsQVcS4d46Lp+ubZ/MFvmVV5EM0IqoDmJgjUDvClKthMlSNTzJkHSv3Y9xyKoSePV5JgNIXJAb+QmT2DcV0L5ZEt1lMbiE45y5EdZVjp3MR/yS+K5JExJHQ3z6carrnl7DhkB96fF91aSQtIDkjyZumJOW3Hz/81tfKF1XS+CgOU5byVtN9N02/zxUIBArvUlgLI8Mt1eh/C7IC9VwqrESH9KnDpSXg+i//miZdAbQOHYuV0aQTGryL+5ZxBiQbT6G70R6Dqk/64I+KrUIExKaMvw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: George Dunlap <George.Dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 18 Jan 2023 09:25:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 17.01.2023 21:31, Andrew Cooper wrote:
> On 19/10/2022 8:41 am, Jan Beulich wrote:
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -1462,12 +1462,34 @@ static void __update_vcpu_system_time(st
>> v->arch.pv.pending_system_time = _u;
>> }
>>
>> +static void write_time_guest_area(struct vcpu_time_info *map,
>> + const struct vcpu_time_info *src)
>> +{
>> + /* 1. Update userspace version. */
>> + write_atomic(&map->version, src->version);
>
> version_update_begin()
Not really, no. src->version was already bumped, and the above is
the equivalent of
/* 2. Update all other userspace fields. */
__copy_to_guest(user_u, u, 1);
in pre-existing code (which also doesn't bump).
However, you point out a bug in patch 9: There I need to set the
version to ~0 between collect_time_info() and write_time_guest_area(),
to cover for the subsequent version_update_end(). (Using
version_update_begin() there wouldn't be correct, as
force_update_secondary_system_time() is used to first populate the
area, and we also shouldn't leave version at 2 once done, as that
might get in conflict with subsequent updates mirroring the version
from the "main" area.)
Jan
|