[PW_SID:1127792] riscv: Add Ssqosid and initial CBQRI resctrl support#2285
[PW_SID:1127792] riscv: Add Ssqosid and initial CBQRI resctrl support#2285linux-riscv-bot wants to merge 10 commits into
Conversation
setup_smp() calls set_cpu_possible() for CPUs 1..nr_cpu_ids-1 but never for CPU 0 (the boot CPU). x86 handles this via init_cpu_possible(cpumask_of(0)); RISC-V has no equivalent. Without CPU 0 in cpu_possible_mask, rcu_init_one()'s for_each_possible_cpu() loop skips it, leaving rdp->mynode=NULL. rcutree_prepare_cpu() then dereferences NULL and hangs. Exposed on Sophgo SG2042 (64-hart, 4-NUMA) with Linux 7.2-rc3. Cc: stable@vger.kernel.org Fixes: a4166ae ("riscv: Deduplicate code in setup_smp()") Signed-off-by: Paul Sherman <shermanpauldylan@gmail.com> Link: https://patch.msgid.link/20260714223301.5265-1-shermanpauldylan@gmail.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
Document the ratified Supervisor-mode Quality of Service ID (Ssqosid) extension v1.0. Link: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0 Acked-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Ssqosid is the RISC-V Quality-of-Service (QoS) Identifiers specification which defines the Supervisor Resource Management Configuration (srmcfg) register. Link: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0 Co-developed-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add support for the srmcfg CSR defined in the Ssqosid ISA extension. The CSR contains two fields: - Resource Control ID (RCID) for resource allocation - Monitoring Counter ID (MCID) for tracking resource usage Requests from a hart to shared resources are tagged with these IDs, allowing resource usage to be associated with the running task. Add a srmcfg field to thread_struct with the same format as the CSR. The context-switch path writes the field to the CSR, and resctrl_arch_set_closid_rmid() updates it when a task is assigned to a resctrl control or monitoring group. A per-cpu cpu_srmcfg_default holds the default srmcfg for each CPU, set by resctrl_arch_set_cpu_default_closid_rmid() on CPU group assignment. On context switch, RCID and MCID inherit from the CPU default independently: a task whose thread RCID field is zero takes the CPU default's RCID, and likewise for MCID. A per-cpu cpu_srmcfg variable mirrors the CSR state to avoid redundant writes. L1D-hot memory access is faster than a CSR read and avoids traps under virtualization. Link: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0 Assisted-by: Claude:claude-opus-4-7 Co-developed-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add support for the RISC-V CBQRI capacity controller. A platform driver passes a cbqri_controller_info descriptor together with the cache level to riscv_cbqri_register_cc_dt(), which probes the controller and adds it to the controller list. Assisted-by: Claude:claude-opus-4-8 Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Wire CBQRI capacity controllers into resctrl as RDT_RESOURCE_L2 and RDT_RESOURCE_L3 schemata. resctrl exposes a single cap set per rid, so when more than one capacity controller backs a cache level they must agree on those caps. A level whose controllers disagree is left unexposed. Other levels are unaffected. Control domains are created in the cpuhp online callback and keyed on the onlining CPU's cache id from cacheinfo, so a CPU that is offline at probe time still joins its domain once it comes online. A domain is published on the ctrl_domains RCU list only after it is fully initialized and brought online, and removed from the list before it is taken offline, following the documented safe traversal rules. Assisted-by: Claude:claude-opus-4-8 Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Make RISCV_CBQRI a user-selectable option (default y) that depends on RISCV_ISA_SSQOSID, rather than having RISCV_ISA_SSQOSID select it unconditionally. A user with Ssqosid hardware can now build a kernel without the CBQRI resctrl support if they do not want it, while the default keeps it enabled. RISCV_CBQRI selects ARCH_HAS_CPU_RESCTRL, which makes RESCTRL_FS available on RISC-V, since resctrl is only meaningful when the CBQRI core that backs it is built. The resctrl filesystem integration is gated separately by RISCV_CBQRI_RESCTRL_FS, a silent option that defaults to y when both RISCV_CBQRI and RESCTRL_FS are enabled. Enabling the resctrl filesystem itself stays a user choice via the standard fs/Kconfig MISC_FILESYSTEMS menu. Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Document the device tree binding for RISC-V CBQRI capacity and bandwidth controllers. Each controller is named by a device-specific compatible followed by the generic compatible. The binding also describes the common riscv,cbqri-rcid and riscv,cbqri-mcid properties, and the optional riscv,cbqri-cache phandle that links a capacity controller to the cache whose capacity it allocates. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a device-tree platform driver, bound to the generic riscv,cbqri-capacity-controller compatible, that registers a CBQRI capacity controller as the resctrl cache-allocation resource for the cache it governs. The driver follows the node's riscv,cbqri-cache phandle to that cache, reads its level, and matches it against cacheinfo to get the resctrl domain id. It then hands the controller to riscv_cbqri_register_cc_dt() with the riscv,cbqri-rcid count from the node. Nothing is vendor-specific, and the DT "reg" is the CBQRI register block itself, so any SoC that describes a CBQRI capacity controller in device tree can reuse the driver unchanged. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[v5,1/8] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 2: "[v5,2/8] riscv: Detect the Ssqosid extension" |
|
Patch 6: "[v5,6/8] riscv: Enable resctrl filesystem for Ssqosid" |
|
Patch 6: "[v5,6/8] riscv: Enable resctrl filesystem for Ssqosid" |
|
Patch 6: "[v5,6/8] riscv: Enable resctrl filesystem for Ssqosid" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 7: "[v5,7/8] dt-bindings: riscv: Add binding for CBQRI controllers" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
|
Patch 8: "[v5,8/8] riscv_cbqri: Add CBQRI capacity allocation platform driver" |
8ca72ef to
60e0882
Compare
PR for series 1127792 applied to workflow__riscv__fixes
Name: riscv: Add Ssqosid and initial CBQRI resctrl support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1127792
Version: 5