From: Fenghua Yu <fenghua.yu@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: tglx@linutronix.de, bp@alien8.de, 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
Date: Thu, 2 Apr 2020 17:05:27 -0700 [thread overview]
Message-ID: <20200403000527.GI188393@romley-ivt3.sc.intel.com> (raw)
In-Reply-To: <76dc65631c373e0c1c9f3e8aaa768f022a2c989c.1585763047.git.reinette.chatre@intel.com>
On Wed, Apr 01, 2020 at 10:51:02AM -0700, Reinette Chatre wrote:
> The original Memory Bandwidth Monitoring (MBM) architectural
> definition defines counters of up to 62 bits in the
> IA32_QM_CTR MSR while the first-generation MBM implementation
> uses statically defined 24 bit counters.
>
> @@ -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;
Is it reliable to read eax which is reserved on older platforms that
don't support the feature?
Seems the code assumes the reserved eax is 0 on those platforms. Is it
reliable?
> int rdt_get_mon_l3_config(struct rdt_resource *r)
> {
> + unsigned int mbm_offset = boot_cpu_data.x86_cache_mbm_width_offset;
> unsigned int cl_size = boot_cpu_data.x86_cache_size;
> int ret;
>
> r->mon_scale = boot_cpu_data.x86_cache_occ_scale;
> r->num_rmid = boot_cpu_data.x86_cache_max_rmid + 1;
> - r->mbm_width = MBM_CNTR_WIDTH;
> + r->mbm_width = MBM_CNTR_WIDTH_BASE;
> +
> + if (mbm_offset > 0 && mbm_offset <= MBM_CNTR_WIDTH_OFFSET_MAX)
> + r->mbm_width += mbm_offset;
> + else if (mbm_offset > MBM_CNTR_WIDTH_OFFSET_MAX)
> + pr_warn("Ignoring impossible MBM counter offset\n");
>
Thanks.
-Fenghua
next prev parent reply other threads:[~2020-04-03 0:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 17:51 [PATCH 0/2] x86/resctrl: Support wider MBM counters Reinette Chatre
2020-04-01 17:51 ` [PATCH 1/2] x86/resctrl: Maintain MBM counter width per resource Reinette Chatre
2020-04-01 17:51 ` [PATCH 2/2] x86/resctrl: Support CPUID enumeration of MBM counter width Reinette Chatre
2020-04-03 0:05 ` Fenghua Yu [this message]
2020-04-03 15:31 ` Reinette Chatre
2020-04-29 18:11 ` Borislav Petkov
2020-04-29 18:42 ` Reinette Chatre
2020-04-30 9:59 ` Borislav Petkov
2020-05-03 18:51 ` Reinette Chatre
2020-05-04 7:56 ` Borislav Petkov
2020-05-05 4:19 ` Reinette Chatre
2020-05-05 22:15 ` Reinette Chatre
2020-04-23 16:40 ` [PATCH 0/2] x86/resctrl: Support wider MBM counters Reinette Chatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200403000527.GI188393@romley-ivt3.sc.intel.com \
--to=fenghua.yu@intel.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=kuo-lang.tseng@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).