Re: [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page

From: Joao Martins
Date: Mon Oct 02 2017 - 16:59:14 EST




On 10/02/2017 07:44 PM, Boris Ostrovsky wrote:
>
>> +
>> +static void xen_setup_vsyscall_time_info(void)
>> +{
>> + struct vcpu_register_time_memory_area t;
>> + struct pvclock_vsyscall_time_info *ti;
>> + int ret;
>
>
> In the previous version you'd return immediately if
> PVCLOCK_TSC_STABLE_BIT was not set. Don't you still need to check this?
> Especially give...
>
Yes, my mistake.

When moving the primary info check I changed the comment below, but should have
moved the call to xen_setup_vsyscall_time_info() into the newly added if ()
clause added in the previous patch. Let me move that inside the conditional and
respin in v6.

Joao

>
>> +
>> + ti = (struct pvclock_vsyscall_time_info *)get_zeroed_page(GFP_KERNEL);
>> + if (!ti)
>> + return;
>> +
>> + t.addr.v = &ti->pvti;
>> +
>> + ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area, 0, &t);
>> + if (ret) {
>> + pr_notice("xen: VCLOCK_PVCLOCK not supported (err %d)\n", ret);
>> + free_page((unsigned long)ti);
>> + return;
>> + }
>> +
>> + /*
>> + * If primary time info had this bit set, secondary should too since
>
> ... this comment?
>
> -boris