From: "Jan Beulich" Subject: Re: [PATCH v2 08/13] x86/PMU: Interface for setting PMU mode and flags Date: Wed, 25 Sep 2013 15:11:32 +0100 Message-ID: <52430B3402000078000F64C2@nat28.tlf.novell.com> References: <1379670132-1748-1-git-send-email-boris.ostrovsky@oracle.com> <1379670132-1748-9-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VOpo8-0002ni-DX for xen-devel@lists.xenproject.org; Wed, 25 Sep 2013 14:11:12 +0000 In-Reply-To: <1379670132-1748-9-git-send-email-boris.ostrovsky@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: suravee.suthikulpanit@amd.com, George.Dunlap@eu.citrix.com, jacob.shin@amd.com, eddie.dong@intel.com, dietmar.hahn@ts.fujitsu.com, jun.nakajima@intel.com, xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 20.09.13 at 11:42, Boris Ostrovsky wrote: > --- a/xen/include/public/xen.h > +++ b/xen/include/public/xen.h > @@ -101,6 +101,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); > #define __HYPERVISOR_kexec_op 37 > #define __HYPERVISOR_tmem_op 38 > #define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */ > +#define __HYPERVISOR_xenpmu_op 40 > > /* Architecture-specific hypercall definitions. */ > #define __HYPERVISOR_arch_0 48 I wonder whether you wouldn't better use an arch-specific hypercall number here - there's really very little that's generic in what I have seen so far. > +/* Parameters structure for HYPERVISOR_xenpmu_op call */ > +struct xenpmu_params { > + /* IN/OUT parameters */ > + union { > + struct version { > + uint8_t maj; > + uint8_t min; > + } version; > + uint64_t pad; > + }; > + union { > + uint64_t val; > + void *valp; Without there also being a handle here I can't see how you could make use of the pointer. > + }; > + > + /* IN parameters */ > + uint64_t vcpu; Do you really want a 64-bit quantity here? > @@ -139,6 +140,9 @@ do_tmem_op( > extern long > do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg); > > +extern long > +do_xenpmu_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg); This seems wrong - the interface above makes it so that you would only ever pass this a struct xenpmu_params, so the handle should be of that kind from the beginning. Jan