In order to support pvclock vdso on xen we need to setup the time
info page for vcpu 0 and register the page with Xen using the VCPUOP_register_vcpu_time_memory_area hypercall. This hypercall
will also forcefully update the pvti which will set some of the
necessary flags for vdso. Afterwards we check if it supports the PVCLOCK_TSC_STABLE_BIT flag which is mandatory for having
vdso/vsyscall support. And if so, it will set the cpu 0 pvti that
will be later on used when mapping the vdso image.
The xen headers are also updated to include the new hypercall for
registering the secondary vcpu_time_info struct.
Signed-off-by: Joao Martins <
[email protected]>
Reviewed-by: Juergen Gross <
[email protected]>
---
Changes since v4:
* Remove pvclock_set_flags since predecessor patch will set in
xen_time_init. Consequently pvti local variable is not so useful
and doesn't make things more clear - therefore remove it.
* Adjust comment on xen_setup_vsyscall_time_info()
* Add Juergen's Reviewed-by (Retained as there wasn't functional
changes)
Changes since v3:
(Comments from Juergen)
* Remove _t added suffix from *GUEST_HANDLE* when sync vcpu.h
with the latest
Changes since v2:
(Comments from Juergen)
* Omit the blank after the cast on all 3 occurrences.
* Change last VCLOCK_PVCLOCK message to be more descriptive
* Sync the complete vcpu.h header instead of just adding the
needed one. (IOW adding VCPUOP_get_physid)
Changes since v1:
* Check flags ahead to see if the primary clock can use
PVCLOCK_TSC_STABLE_BIT even if secondary registration fails.
(Comments from Boris)
* Remove addr, addr variables;
* Change first pr_debug to pr_warn;
* Change last pr_debug to pr_notice;