Re: [PATCH v8 2/5] riscv_cbqri: resctrl: Add cache allocation via capacity block mask
From: Drew Fustini
Date: Thu Sep 17 2026 - 16:39:22 EST
On Thu, Sep 17, 2026 at 04:57:42PM +0000, sashiko-bot@xxxxxxxxxx wrote:
> > + 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?
This is a valid point. cbqri_resctrl_pick_caches() only compares the
controllers present at late_initcall, and riscv_cbqri_register_cc_dt()
does not refuse a later registration. The scope is limited as this
driver is built-in, and DT overlay is not likely for a cache controller.
> Could this cause capacity configuration operations to fail gracefully with
> -EIO when hardware limits are exceeded, or otherwise abort CPU hotplug?
It depends on the mismatch:
- If the late controller has fewer capacity blocks the read-back check
in cbqri_apply_cache_config() fails with -EIO, the domain is not
created and the CPU online is rolled back.
- If it has more blocks the domain comes up and only the upper blocks
stay unused.
I will add the cbqri_cc_caps_agree() check to
cbqri_attach_cpu_to_all_ctrls() to eliminate the above issues.
Drew