From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: fenghua.yu@intel.com, reinette.chatre@intel.com, babu.moger@amd.com
Subject: [PATCH] x86/resctrl: fix min_cbm_bits for AMD
Date: Sun, 15 May 2022 22:50:55 -0700 [thread overview]
Message-ID: <20220516055055.2734840-1-eranian@google.com> (raw)
AMD supports cbm with no bits set as reflected in rdt_init_res_defs_amd() by:
r->cache.arch_has_empty_bitmaps = true;
However given the unified code in cbm_validate(), checking for
val == 0 && !arch_has_empty_bitmaps
is not enough because you also have in cbm_validate():
if ((zero_bit - first_bit) < r->cache.min_cbm_bits)
Default value for if r->cache.min_cbm_bits = 1
Leading to:
$ cd /sys/fs/resctrl
$ mkdir foo
$ cd foo
$ echo L3:0=0 > schemata
-bash: echo: write error: Invalid argument
Patch initializes r->cache.min_cbm_bits to 0 for AMD.
Signed-off-by: Stephane Eranian <eranian@google.com>
---
arch/x86/kernel/cpu/resctrl/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index bb1c3f5f60c8..14782361ebb7 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -897,6 +897,7 @@ static __init void rdt_init_res_defs_amd(void)
r->cache.arch_has_sparse_bitmaps = true;
r->cache.arch_has_empty_bitmaps = true;
r->cache.arch_has_per_cpu_cfg = true;
+ r->cache.min_cbm_bits = 0;
} else if (r->rid == RDT_RESOURCE_MBA) {
hw_res->msr_base = MSR_IA32_MBA_BW_BASE;
hw_res->msr_update = mba_wrmsr_amd;
--
2.36.0.550.gb090851708-goog
next reply other threads:[~2022-05-16 5:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 5:50 Stephane Eranian [this message]
2022-05-16 16:35 ` Reinette Chatre
2022-05-16 19:07 ` Stephane Eranian
2022-05-16 20:51 ` 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=20220516055055.2734840-1-eranian@google.com \
--to=eranian@google.com \
--cc=babu.moger@amd.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
/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
all inboxes | Powered by JetHome®