+
+static int xen_setup_vsyscall_time_info(int cpu)
+{
+ struct pvclock_vsyscall_time_info *ti;
+ struct vcpu_register_time_memory_area t;
+ struct pvclock_vcpu_time_info *pvti;
+ unsigned long mem;
+ int ret, size;
+ u8 flags;
+
+ ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area,
+ cpu, NULL);
+ if (ret == -ENOSYS) {
+ pr_debug("xen: vcpu_time_info placement not supported\n");
+ return -ENOTSUPP;
+ }
+
+ size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info));
+ mem = memblock_alloc(size, PAGE_SIZE);
+ if (!mem)
+ return -ENOMEM;
+
+ ti = __va(mem);
+ memset(ti, 0, size);