From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH RFC 2/3] x86/xen/time: setup vcpu 0 time info page Date: Mon, 4 Jan 2016 11:07:53 -0500 Message-ID: <568A98D9.9090501__40210.9744064093$1451923748$gmane$org@oracle.com> References: <1451339557-24473-1-git-send-email-joao.m.martins@oracle.com> <1451339557-24473-3-git-send-email-joao.m.martins@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1451339557-24473-3-git-send-email-joao.m.martins@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Joao Martins , linux-kernel@vger.kernel.org, xen-devel@lists.xen.org Cc: x86@kernel.org, Ingo Molnar , David Vrabel , "H. Peter Anvin" , Thomas Gleixner List-Id: xen-devel@lists.xenproject.org On 12/28/2015 04:52 PM, Joao Martins wrote: > + > +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; > + } I don't think this is necessary. > + > + 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); Can you just use get_zeroed_page()? (struct pvclock_vsyscall_time_info is always less than a page, isn't it?). -boris