From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Peng Subject: Re: [PATCH v8 2/5] tools: add routine to get CMT L3 event mask Date: Thu, 29 Jan 2015 16:32:14 +0800 Message-ID: <20150129083214.GC3579@pengc-linux.bj.intel.com> References: <1422432286-7276-1-git-send-email-chao.p.peng@linux.intel.com> <1422432286-7276-3-git-send-email-chao.p.peng@linux.intel.com> <1422452425.14124.48.camel@citrix.com> Reply-To: Chao Peng Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1422452425.14124.48.camel@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: Ian Campbell Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, JBeulich@suse.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, Jan 28, 2015 at 01:40:25PM +0000, Ian Campbell wrote: > On Wed, 2015-01-28 at 16:04 +0800, Chao Peng wrote: > > This is the tools side wrapper for XEN_SYSCTL_PSR_CMT_get_l3_event_mask > > of XEN_SYSCTL_psr_cmt_op. > > > > Signed-off-by: Chao Peng > > --- > > tools/libxc/include/xenctrl.h | 1 + > > tools/libxc/xc_psr.c | 17 +++++++++++++++++ > > tools/libxl/libxl.h | 1 + > > This needs a LIBXL_HAVE #define in libxl.h to advertise the new > functionality. OK. > > > +int xc_psr_cmt_get_l3_event_mask(xc_interface *xch, uint32_t *event_mask); > > What are the possible values of the event mask? Is there a guarantee > from somewhere that 32-bits is always sufficient? It comes directly from cpuid which is 32 bit now and look like not possible to extend it to 64 bit. Only bits[0:2] is used at present. > > How can the libxl caller decode the meaning of the bits since they are > not defined in the libxl.h header? > > Perhaps a struct of booleans would be a better interface at the libxl > level? > > Or perhaps the interface should be more along the lines of "is psr > feature X available", like libxl_psr_..._feature_enabled(ctx, > SOME_SYMBOL)? > > Or perhaps the function to actual access the info should have an > ERROR_PSR_FUNCTION NOT_SUPPORTED return? As answered in another reply, I'd use it as: int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type); Thanks, Chao