Re: [PATCH v8 2/5] riscv_cbqri: resctrl: Add cache allocation via capacity block mask
From: sashiko-bot
Date: Thu Sep 17 2026 - 18:05:09 EST
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] cbqri: late-registered capacity controllers bypass capability agreement check
--
commit d3ff1ae1d79d6e8e4041b4efbc3516187f2222a6
Author: Drew Fustini <fustini@xxxxxxxxxx>
riscv_cbqri: resctrl: Add cache allocation via capacity block mask
This commit wires up CBQRI capacity controllers into resctrl for L2 and
L3 resources. It manages control domains during CPU hotplug and requires
all controllers at the same cache level to report identical capabilities.
> diff --git a/drivers/resctrl/cbqri_resctrl.c b/drivers/resctrl/cbqri_resctrl.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/resctrl/cbqri_resctrl.c
[ ... ]
> +static int cbqri_attach_cpu_to_all_ctrls(unsigned int cpu)
> +{
> + static const u32 levels[] = { 2, 3 };
> + struct cbqri_controller *ctrl, *c;
> + struct cbqri_resctrl_res *hw_res;
> + struct rdt_ctrl_domain *d;
[ ... ]
> + d = cbqri_find_ctrl_domain(&hw_res->resctrl_res.ctrl_domains,
> + ci->id);
> + if (d) {
> + cpumask_set_cpu(cpu, &d->hdr.cpu_mask);
> + continue;
> + }
> +
> + d = cbqri_create_ctrl_domain(ctrl, &hw_res->resctrl_res, cpu,
> + ci->id);
[Severity: Medium]
Does this bypass the capability agreement check for dynamically registered
controllers?
If a CBQRI capacity controller is registered late (for instance, via a DT
overlay) and its CPU is subsequently onlined,
cbqri_attach_cpu_to_all_ctrls() will discover the controller backing the
new CPU and create a domain for it.
However, I don't see a call to cbqri_cc_caps_agree(hw_res->ctrl, ctrl)
before creation to verify that the late controller's capabilities match.
If the new controller has capabilities (like block mask size or RCID count)
that differ from the boot-time selected controller, will this group
mismatched controllers into the same resctrl resource?
Could this cause capacity configuration operations to fail gracefully with
-EIO when hardware limits are exceeded, or otherwise abort CPU hotplug?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-dfustini-atl-sc-cbqri-dt-v8-0-7964e8d73fe8@xxxxxxxxxx?part=2