riscv: Add Ssqosid and initial CBQRI resctrl support
| From: | Drew Fustini <fustini-AT-kernel.org> | |
| To: | Adrien Ricciardi <aricciardi-AT-baylibre.com>, Alexandre Ghiti <alex-AT-ghiti.fr>, Atish Kumar Patra <atishp-AT-rivosinc.com>, Atish Patra <atish.patra-AT-linux.dev>, Babu Moger <babu.moger-AT-amd.com>, Ben Horgan <ben.horgan-AT-arm.com>, Borislav Petkov <bp-AT-alien8.de>, Chen Pei <cp0613-AT-linux.alibaba.com>, Conor Dooley <conor.dooley-AT-microchip.com>, Conor Dooley <conor+dt-AT-kernel.org>, Dave Hansen <dave.hansen-AT-linux.intel.com>, Dave Martin <Dave.Martin-AT-arm.com>, Fenghua Yu <fenghua.yu-AT-intel.com>, Gong Shuai <gong.shuai-AT-sanechips.com.cn>, Gong Shuai <gsh517-AT-gmail.com>, guo.wenjia23-AT-zte.com.cn, James Morse <james.morse-AT-arm.com>, Kornel Dulęba <mindal-AT-semihalf.com>, Krzysztof Kozlowski <krzk+dt-AT-kernel.org>, liu.qingtao2-AT-zte.com.cn, Liu Zhiwei <zhiwei_liu-AT-linux.alibaba.com>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Paul Walmsley <pjw-AT-kernel.org>, Peter Newman <peternewman-AT-google.com>, Radim Krčmář <rkrcmar-AT-ventanamicro.com>, Reinette Chatre <reinette.chatre-AT-intel.com>, Rob Herring <robh-AT-kernel.org>, Samuel Holland <samuel.holland-AT-sifive.com>, Sebastian Andrzej Siewior <bigeasy-AT-linutronix.de>, Tony Luck <tony.luck-AT-intel.com>, Vasudevan Srinivasan <vasu-AT-rivosinc.com>, Ved Shanbhogue <ved-AT-rivosinc.com>, Weiwei Li <liwei1518-AT-gmail.com>, yunhui cui <cuiyunhui-AT-bytedance.com>, Drew Fustini <fustini-AT-kernel.org> | |
| Subject: | [PATCH 0/8] riscv: Add Ssqosid and initial CBQRI resctrl support | |
| Date: | Fri, 19 Jun 2026 11:29:35 -0700 | |
| Message-ID: | <20260619-dfustini-atl-sc-cbqri-dt-v1-0-e79a7723fab0@kernel.org> | |
| Cc: | linux-kernel-AT-vger.kernel.org, linux-riscv-AT-lists.infradead.org, x86-AT-kernel.org, devicetree-AT-vger.kernel.org, linux-rt-devel-AT-lists.linux.dev, linux-doc-AT-vger.kernel.org | |
| Archive-link: | Article |
This series adds initial RISC-V QoS support: the Ssqosid extension [1] (srmcfg CSR), the CBQRI controller interface [2] integrated with resctrl [3], and DT-based platform driver for cache controllers. It has been tested both on the Tenstorrent Ascalon Shared Cache controller as well as a Qemu implementation [4]. Note that this series only implements support for resctrl CAT using CBQRI capacity allocation control. cc_block_mask maps onto resctrl's existing cbm schema. However, cc_cunits is not supported as there is no existing equivalent for capacity units in the resctrl schemata. I had previously been iterating on an RFC series [5] that did a full implementation of CBQRI including capacity monitoring, bandwidth allocation and monitoring, as well as a parser for the ACPI RQSC table. The bandwidth controls for CBQRI do not fit well into resctrl's existing throttle based MB schemata. I believe that the path forward is Reinette's generic schema description proof of concept [6] but that will take time to mature. My plan is to rebase the full support of CBQRI on to the generic schema once it is ready. [1] https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0 [2] https://github.com/riscv-non-isa/riscv-cbqri/releases/tag... [3] https://docs.kernel.org/filesystems/resctrl.html [4] https://github.com/riscv-non-isa/riscv-rqsc/blob/main/src/ [5] https://lore.kernel.org/linux-riscv/20260601-ssqosid-cbqr... [6] https://lore.kernel.org/all/aab804b9-e8b5-40ad-a85b-af703... --- Drew Fustini (8): dt-bindings: riscv: Add Ssqosid extension description riscv: Detect the Ssqosid extension riscv: Add support for srmcfg CSR from Ssqosid extension riscv_cbqri: Add capacity controller probe and allocation device ops riscv_cbqri: resctrl: Add cache allocation via capacity block mask riscv: Enable resctrl filesystem for Ssqosid dt-bindings: riscv: Add generic CBQRI controller binding riscv_cbqri: Add CBQRI cache capacity-allocation platform driver .../devicetree/bindings/riscv/extensions.yaml | 6 + .../devicetree/bindings/riscv/riscv,cbqri.yaml | 109 +++ MAINTAINERS | 15 + arch/riscv/Kconfig | 20 + arch/riscv/include/asm/csr.h | 5 + arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/include/asm/processor.h | 3 + arch/riscv/include/asm/qos.h | 86 +++ arch/riscv/include/asm/resctrl.h | 152 ++++ arch/riscv/include/asm/switch_to.h | 3 + arch/riscv/kernel/Makefile | 2 + arch/riscv/kernel/cpufeature.c | 1 + arch/riscv/kernel/qos.c | 91 +++ drivers/resctrl/Kconfig | 44 ++ drivers/resctrl/Makefile | 7 + drivers/resctrl/cbqri_capacity.c | 132 ++++ drivers/resctrl/cbqri_devices.c | 511 ++++++++++++++ drivers/resctrl/cbqri_internal.h | 110 +++ drivers/resctrl/cbqri_resctrl.c | 774 +++++++++++++++++++++ include/linux/riscv_cbqri.h | 47 ++ 20 files changed, 2119 insertions(+) --- base-commit: 4fa3f5fabb30bf00d7475d5a33459ea83d639bf9 change-id: 20260610-dfustini-atl-sc-cbqri-dt-410c8e2711dd Best regards, -- Drew Fustini <fustini@kernel.org>
