Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp892371ybz; Wed, 29 Apr 2020 11:13:58 -0700 (PDT) X-Google-Smtp-Source: APiQypLyfW55UTeaRvFDfnzQI9r+SyAMbwLb/a6s5LUk0e0r2m1MrrMUBu4v7jPs9wmlljwaHim/ X-Received: by 2002:a05:6402:1d93:: with SMTP id dk19mr3588988edb.170.1588184038782; Wed, 29 Apr 2020 11:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588184038; cv=none; d=google.com; s=arc-20160816; b=t0q7ZSkIkclwH4BPZaIqPif1/8Dl7F9p0vDVoBMrmh/lNWbGowhyRoyA9Tn3md9ojx XNeNTfhB3SxVztPrEgupNZJU086laqKUwBl4FRkG07Y8N1J2KR88UDSHo6CsQI89C1x2 wdQY8VS2C6UzZ1vGYpZQvKDIsjzzeR3LBXoyDTndBKugVwD25WfMDiemHlQoaAatzGlj hWs6Gmepgn7L3FZonu16qhN8a9gFDBFmVFiouPEhBOOKLQs74YGMoB+HIZAUvvxZOpcI Qlr1bPCYXY2E1RmUSMwJ/3TyHB14XujS/n57sqR/+jFJKwQGC+43PXX7wzfgRGkCKx4m sY9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=axjw/GEGANJFfy0IqY7WI3SgF7XxKuwgsDRnXRuS/xQ=; b=jWcxGPC/GIK55nGfjh+LtGkAkW8VUhvwQdlkEOPO5aq8+sy/T0tzxu9yM/HlrmzYxZ WwTnAadURB3svbj9AOZ/T5R+PEapowzG/APpd0UGDwCeKB6CjvgSuGfP4olUOopXQ62/ ykCs7m6yQeqJ9KHm+QexS8uLW4sjdS85pW6PSzxieZJW/NqAPw1aHWi2JUQ3/zb+azOk q72+qDQ8kb8V9myHOZaN79R9HRFAK02SnhnZGUVPbe6mZp95jmiwvSGn7QPti6gfo//+ 2DebJBfxcH0irg3PzLSVaSAL8U9J12taGtYhzH7xhrBGMExmwTxGhrJpSESydzqOA5W7 QsyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=rQU9Z3DM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si3955897edr.596.2020.04.29.11.13.31; Wed, 29 Apr 2020 11:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=rQU9Z3DM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgD2SL7 (ORCPT + 99 others); Wed, 29 Apr 2020 14:11:59 -0400 Received: from mail.skyhub.de ([5.9.137.197]:44908 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgD2SL5 (ORCPT ); Wed, 29 Apr 2020 14:11:57 -0400 Received: from zn.tnic (p200300EC2F0B95002CAA38EA2C11A9F5.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:9500:2caa:38ea:2c11:a9f5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D90501EC0CDA; Wed, 29 Apr 2020 20:11:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1588183916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=axjw/GEGANJFfy0IqY7WI3SgF7XxKuwgsDRnXRuS/xQ=; b=rQU9Z3DMooY4/X/btqU5GD2O/BH5NqyzC0k7gABxrR/LLlGL07EPpUgD5Tio+9fwSyiktH pZGUidOuc93OTm6stOJp2V98adImUyIsQb3HdHJlZoHsHr5J0fFyrznk+AL/mi3ZmxtXRQ Yt1UmMn0hY2VpsmNYOxzGknldchMg5E= Date: Wed, 29 Apr 2020 20:11:49 +0200 From: Borislav Petkov To: Reinette Chatre Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, kuo-lang.tseng@intel.com, mingo@redhat.com, babu.moger@amd.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] x86/resctrl: Support CPUID enumeration of MBM counter width Message-ID: <20200429181149.GE16407@zn.tnic> References: <76dc65631c373e0c1c9f3e8aaa768f022a2c989c.1585763047.git.reinette.chatre@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <76dc65631c373e0c1c9f3e8aaa768f022a2c989c.1585763047.git.reinette.chatre@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 01, 2020 at 10:51:02AM -0700, Reinette Chatre wrote: > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index 4cdb123ff66a..8552d2fadc15 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -856,6 +856,8 @@ static void init_speculation_control(struct cpuinfo_x86 *c) > > static void init_cqm(struct cpuinfo_x86 *c) > { > + c->x86_cache_mbm_width_offset = -1; > + > if (!cpu_has(c, X86_FEATURE_CQM_LLC)) { > c->x86_cache_max_rmid = -1; > c->x86_cache_occ_scale = -1; > @@ -875,6 +877,9 @@ static void init_cqm(struct cpuinfo_x86 *c) > > c->x86_cache_max_rmid = ecx; > c->x86_cache_occ_scale = ebx; > + /* EAX contents is only defined for Intel CPUs */ > + if (c->x86_vendor == X86_VENDOR_INTEL) > + c->x86_cache_mbm_width_offset = eax & 0xff; Remind me again pls why is all this RDT stuff replicated per CPU instead of it being properly detected somewhere down in resctrl_late_init()? Looking at get_rdt_resources(), it kinda wants to have that in there too? IOW, how about moving all that gunk in init_cqm() to resctrl/ where it truly belongs? Doesn't have to be this patchset but this patchset can start moving it... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette