From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v3 3/6] xen/PMU: Initialization code for Xen PMU Date: Mon, 07 Jul 2014 10:17:40 -0400 Message-ID: <53BAAC04.7000009@oracle.com> References: <1404414899-1773-1-git-send-email-boris.ostrovsky@oracle.com> <1404414899-1773-4-git-send-email-boris.ostrovsky@oracle.com> <53B6877C.5040902@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53B6877C.5040902@citrix.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: David Vrabel , konrad.wilk@oracle.com Cc: andrew.cooper3@citrix.com, kevin.tian@intel.com, dietmar.hahn@ts.fujitsu.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 07/04/2014 06:52 AM, David Vrabel wrote: > On 03/07/14 20:14, Boris Ostrovsky wrote: >> Map shared data structure that will hold CPU registers, VPMU context, V/PCPU IDs >> of the CPU interrupted by PMU interrupt. Hypervisor fills this information in >> its handler and passes it to the guest for further processing. >> >> Set up PMU VIRQ. >> >> Now that perf infrastructure will assume that PMU is availble on a PV guest we >> need to be careful and make sure that accesses via RDPMC instruction don't >> cause fatal traps by the hypervisor. Provide a nop RDPMC handler. >> >> For the same reason avoid issuing a warning on a write to APIC's LVTPC. >> >> Both of these will be made functional in later patches. > [...] >> +int xen_pmu_init(int cpu) >> +{ >> + int ret = 0; >> + struct xen_pmu_params xp; >> + unsigned long pfn; >> + struct xen_pmu_data *xenpmu_data; >> + >> + BUILD_BUG_ON(sizeof(struct xen_pmu_data) > PAGE_SIZE); >> + xenpmu_data = vzalloc(PAGE_SIZE); > Why vzalloc() for something that is only a page in size? I need it page-aligned and I don't think kmalloc() guarantees that (the implementation might, but not the interface itself). I can use __get_free_page(), I suppose. -boris