Re: [PATCH] xen: Use VCPUOP_register_{runstate,vcpu_time}_phys_area when available
From: Andrew Cooper
Date: Fri Oct 16 2026 - 12:31:38 EST
On 16/10/2026 3:10 pm, Teddy Astie wrote:
> Le 16/10/2026 à 13:20, Andrew Cooper a écrit :
>> On 16/10/2026 11:22 am, Teddy Astie wrote:
>>> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
>>> index 5c7822254a01..19ace1b78ae4 100644
>>> --- a/arch/x86/xen/time.c
>>> +++ b/arch/x86/xen/time.c
>>> @@ -37,6 +37,22 @@
>>> static u64 xen_sched_clock_offset __read_mostly;
>>> +static int xen_register_time_area(struct pvclock_vcpu_time_info
>>> *pvti)
>>
>> This needs a comment explaining what's going on (by GPA, falling back to
>> VA), including that passing NULL means unregister.
>>
>
> Will add, I guess we also want to mention that this does stuff on vCPU 0.
I was puzzled at why it only ever uses vCPU 0 for time handling.
Xen does allow there to be a time area per vCPU, and I have a suspicion
that this might matter for older systems lacking INVARIANT_TSC.
Either way, I don't suggest opening that particular can of worms now.
~Andrew