From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/6] x86: detect and initialize Intel CAT feature Date: Tue, 17 Mar 2015 09:00:27 -0400 Message-ID: <20150317130027.GE11161@l.oracle.com> References: <1426241605-4114-1-git-send-email-chao.p.peng@linux.intel.com> <1426241605-4114-2-git-send-email-chao.p.peng@linux.intel.com> <20150313134013.GE5378@l.oracle.com> <20150317081133.GA5371@pengc-linux.bj.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20150317081133.GA5371@pengc-linux.bj.intel.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: Chao Peng Cc: keir@xen.org, Ian.Campbell@citrix.com, 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, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On Tue, Mar 17, 2015 at 04:11:33PM +0800, Chao Peng wrote: > On Fri, Mar 13, 2015 at 09:40:13AM -0400, Konrad Rzeszutek Wilk wrote: > > On Fri, Mar 13, 2015 at 06:13:20PM +0800, Chao Peng wrote: > > > Detect Intel Cache Allocation Technology(CAT) feature and store the > > > cpuid information for later use. Currently only L3 cache allocation is > > > supported. The L3 CAT features may vary among sockets so per-socket > > > feature information is stored. The initialization can happen either at > > > boot time or when CPU(s) is hot plugged after booting. > > > > > > Signed-off-by: Chao Peng > > > --- > > > docs/misc/xen-command-line.markdown | 15 +++- > > > xen/arch/x86/psr.c | 151 +++++++++++++++++++++++++++++++++--- > > > xen/include/asm-x86/cpufeature.h | 1 + > > > 3 files changed, 155 insertions(+), 12 deletions(-) > > > > > > + cat_cpu_init(smp_processor_id()); > > > > Do 'if (!cat_cpu_init(..)).`' > > > > as the CPU might not support this. > > > > At which point you should also free the cat_socket_info and > > not register the cpu notifier. > > Even the booting CPU does not support this, other CPUs may still support > this. Generally the feature is a per-socket feature. So break here is > not the intention. Oooh, and you did mention that in the git commit description and I dived right in the code - without looking there - sorry for that noise! Thought I am curious - what if all the sockets don't support and the user does try enable it on the command line (user error)? Shouldn't we then figure out that all of the CPUs don't support and xfree cat_socket_info and not register the CPU notifier? > > Except this, all other comments will be addressed by the next version. thank you! > Thanks for your time. > > Chao > > > > > + register_cpu_notifier(&cpu_nfb); > > > +} > > > +