Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp921755ybz; Wed, 29 Apr 2020 11:46:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKLSow3IcNHAbUw8n/sKY23qs41Swjt98UKnZVfc/sb73QtuEG/kx6X0S8tySnilqXUiISk X-Received: by 2002:a17:906:405a:: with SMTP id y26mr3860830ejj.31.1588185996498; Wed, 29 Apr 2020 11:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588185996; cv=none; d=google.com; s=arc-20160816; b=f/FliDHs4OtZT4JVewB03hO3UbKrU/CmT4iKD/6zlWYHcoSi9wglZz6iaLXphcGt6H w/WfQUA300o5A7+Z/BYKv0vzS6+XsB/gskVfV8X7hBzRjK75iy6jiTKuZyiMfXEUx05E 2UwjYJHLNIvT09gpaV4sJSIRwNSQ9UHv3qGHBE3TfUiAob3gcaGBxjgmmLYbu3NcnV3F mMZuuuNrs1TxrlF2n+7w4wspIjNcWkC5NSVqGNGLJUG+zYoWeGZmZaFDv43MxOVLRDVT UykiiPL/Y2i0V1udKagPGLQ6IoDp/vu8NKEIxhHSi2pvg2zOHl6ClkWfLLDHwCxLl+05 4KYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=0KU1TAai0vzwstep6jn99riCkqQKymH/q5N7JrK2r5I=; b=SfWSYGfwgQnN6rO/R7v7i0w4XZ+UyjwL+KBHAG5dac97BD+3Cre0MnBK8DZk0RQyRt 5dzj+MgvuRJhOSF/N6rACa+4PlrML0Eu6iDS5wKnXgZzvj/oM9DrG1ntTITqClvrogsO QK9RqZftyWoJocKCs0kIRqRBFTWZEhWfs7m8VXKF4WhyTgxET9Y6ke4K2ctRDaMETjNt Ts1MeCM1RhheTMcvXfRBPw5kgbzRLAxQVwEMblQcMTMXFWnPl5ru6fnWaNvOlb0rNV3q OZa+oLXNXeVyVaJb8C68rwseUgKT9fzX1czIgph+55uVQAZuun0bqKvQ9Q6f4P1eKPHT 849A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si4170587edq.404.2020.04.29.11.46.12; Wed, 29 Apr 2020 11:46:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727023AbgD2SmF (ORCPT + 99 others); Wed, 29 Apr 2020 14:42:05 -0400 Received: from mga07.intel.com ([134.134.136.100]:19663 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgD2SmF (ORCPT ); Wed, 29 Apr 2020 14:42:05 -0400 IronPort-SDR: 3A0ySfikSO6rqK6P190+42619h6h73IbUuc186G2miZ/8gFjd6+qAFsWQsNBAixdI5PPaZUkOK 0+CG/WUGX22w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 11:42:04 -0700 IronPort-SDR: Zyukxp0GZrKgrYBy2Q4V3lJkWfXkgn0LdHF9H7i4bh8DKSAOKpNLMjRZbQKit/XJdmqPFHgC1w sAaF0CAN+6/A== X-IronPort-AV: E=Sophos;i="5.73,332,1583222400"; d="scan'208";a="432657402" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.255.229.38]) ([10.255.229.38]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 11:42:04 -0700 Subject: Re: [PATCH 2/2] x86/resctrl: Support CPUID enumeration of MBM counter width To: Borislav Petkov 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 References: <76dc65631c373e0c1c9f3e8aaa768f022a2c989c.1585763047.git.reinette.chatre@intel.com> <20200429181149.GE16407@zn.tnic> From: Reinette Chatre Message-ID: <6fb58472-88f2-925b-3a4e-4692957a9582@intel.com> Date: Wed, 29 Apr 2020 11:42:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200429181149.GE16407@zn.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Borislav, On 4/29/2020 11:11 AM, Borislav Petkov wrote: > 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... I am not familiar with the history to clarify to you why the RDT feature enumeration is not consistent. Even so, there was an effort to consolidate this in [1] but it was found to go against the goal of centralizing the CPUID information [2] and was not pursued further. I would be happy to revisit this if this is the direction that you prefer. This would essentially be resubmitting [1] though. Do you expect that this change would receive a different reception at this time? Thank you Reinette [1] https://lore.kernel.org/lkml/1560705250-211820-2-git-send-email-fenghua.yu@intel.com/ [2] https://lore.kernel.org/lkml/alpine.DEB.2.21.1906162141301.1760@nanos.tec.linutronix.de/