From: "Jan Beulich" Subject: Re: [PATCH v8 02/13] x86: detect and initialize Intel CAT feature Date: Fri, 29 May 2015 09:03:30 +0100 Message-ID: <55683972020000780007ED2E@mail.emea.novell.com> References: <1432197704-20816-1-git-send-email-chao.p.peng@linux.intel.com> <1432197704-20816-3-git-send-email-chao.p.peng@linux.intel.com> <55672C2F020000780007E960@mail.emea.novell.com> <20150529024016.GB18422@pengc-linux.bj.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150529024016.GB18422@pengc-linux.bj.intel.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: Chao Peng Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, keir@xen.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 29.05.15 at 04:40, wrote: > On Thu, May 28, 2015 at 01:54:39PM +0100, Jan Beulich wrote: >> >>> On 21.05.15 at 10:41, wrote: >> > + >> > + if ( !cpu_has(c, X86_FEATURE_CAT) ) >> > + return; >> > + >> > + socket = cpu_to_socket(cpu); >> > + if ( test_bit(socket, cat_socket_enable) ) >> > + return; >> > + >> > + cpuid_count(PSR_CPUID_LEVEL_CAT, 0, &eax, &ebx, &ecx, &edx); >> >> While one would hope that X86_FEATURE_CAT implies the respective >> CPUID leaf being available, I think explicitly checking this should still >> be done just like is the case elsewhere. > > Against cpuid_level? Of course. >> > +static void __init init_psr_cat(void) >> > +{ >> > + if ( opt_cos_max < 1 ) >> > + { >> > + printk(XENLOG_INFO "CAT: disabled, cos_max is too small\n"); >> > + return; >> > + } >> >> Is opt_cos_max == 1 really useful for anything? > > That means two COSes are available. cos=0 is reserved and cos=1 can > still be used anyway. Ah, sorry, this is _max_, not _count_. Jan