[PW_SID:1081333] RISC-V: QoS: add CBQRI resctrl interface#1769
[PW_SID:1081333] RISC-V: QoS: add CBQRI resctrl interface#1769linux-riscv-bot wants to merge 11 commits into
Conversation
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 so the scheduler can set the RCID and MCID for each task on context switch. A per-cpu cpu_srmcfg variable mirrors the CSR state to avoid redundant writes, as L1D-hot memory access is faster than a CSR read and avoids traps under virtualization. Add a per-cpu cpu_srmcfg_default variable to store the default srmcfg for each CPU, as set by resctrl CPU group assignment. On context switch, if the next task belongs to the default resource group (srmcfg == 0), the CPU's default value is used instead. This implements resctrl resource allocation rule 2: default-group tasks on a CPU assigned to a specific group receive that group's allocations. 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 the CBQRI controller hardware interface layer. Define data structures representing CBQRI controller properties (cbqri_controller) and hardware capabilities for capacity and bandwidth controllers (riscv_cbqri_capacity_caps, riscv_cbqri_bandwidth_caps) in include/linux/riscv_qos.h. Define MMIO register offsets, field masks, and internal wrapper structs (cbqri_resctrl_res, cbqri_resctrl_dom, cbqri_config) in internal.h. Implement MMIO helpers for capacity block mask and bandwidth reservation, alloc control operations for capacity and bandwidth controllers, and probe functions to discover controller capabilities. A per-controller spinlock serializes multi-step MMIO sequences. 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>
Implement the resctrl architecture callbacks required by the resctrl filesystem and expose them via arch/riscv/include/asm/resctrl.h. These include capability reporting, CDP enable/disable, CLOSID/RMID encoding, scheduler integration (sched_in, set_closid_rmid, sync_cpu_closid_rmid), domain config read/write (update_one, update_domains, get_config), and stub implementations for monitoring operations not yet supported on RISC-V. The function prototypes and inline stubs are declared in include/linux/riscv_qos.h alongside the implementations in arch/riscv/kernel/qos/qos_resctrl.c. 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 the setup and domain management layer: domain allocation (qos_new_domain), controller value initialization (qos_init_domain_ctrlval), resource struct initialization for cache and bandwidth resources, domain registration with the resctrl filesystem (qos_resctrl_add_controller_domain), and the top-level setup function (qos_resctrl_setup) that probes all controllers and calls resctrl_init(). Also add qos_resctrl_online_cpu() and qos_resctrl_offline_cpu() for CPU hotplug integration. 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 up the RISC-V QoS resctrl implementation: Add a late_initcall that checks for the Ssqosid extension and, if present, calls qos_resctrl_setup() to probe CBQRI controllers and initialize the resctrl filesystem, then registers CPU hotplug callbacks. Make CONFIG_RISCV_ISA_SSQOSID select ARCH_HAS_CPU_RESCTRL and RESCTRL_FS, and depends on MISC_FILESYSTEMS. Add qos_resctrl.o to the build when CONFIG_RISCV_ISA_SSQOSID is set. 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 helper to look up a cache's size from its cache ID in the PPTT table. This is needed by the RISC-V RQSC parser to determine the cache size for CBQRI capacity controllers. The implementation follows the pattern established by find_acpi_cache_level_from_id() and acpi_pptt_get_cpumask_from_cache_id(): uses acpi_get_pptt(), upgrade_pptt_cache(), checks all three cache types, and uses the do/while empty-detection loop. Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add structs for the RQSC table which describes the properties of the RISC-V QoS controllers (CBQRI) in the system. The table also describes the topological arrangement of the QoS controllers and resources in the system. The topology is expressed in terms of the location of the resources within the system and the relation between the QoS Controller and the resource it manages. Note: This is a placeholder for RFC review purposes. The actbl2.h change must go through upstream ACPICA first and will be replaced by the auto-generated ACPICA commit once the RQSC spec is ratified. Link: https://github.com/riscv-non-isa/riscv-cbqri/releases/tag/v1.0 Link: https://github.com/riscv-non-isa/riscv-rqsc/blob/main/src/chapter2.adoc Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add parser for the ACPI RQSC table which describes the capacity and bandwidth QoS controllers in a system. For each table entry, allocate a cbqri_controller struct and populate it with the controller type, MMIO base address, RCID/MCID counts, and resource identifiers (cache ID for capacity controllers, proximity domain for bandwidth controllers). Cache controller cpumasks are resolved via acpi_pptt_get_cpumask_from_cache_id(). Bandwidth controller cpumasks are derived from the proximity domain's NUMA node. Controllers with invalid addresses or failed cpumask lookups are skipped with a warning. The populated controller list is consumed by qos_resctrl_setup() in arch/riscv/kernel/qos/ to probe the hardware and register resctrl domains. Link: https://github.com/riscv-non-isa/riscv-cbqri/releases/tag/v1.0 Link: https://github.com/riscv-non-isa/riscv-rqsc/blob/main/src/ Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…QSC) Call acpi_parse_rqsc() from acpi_arch_init() to discover CBQRI controllers when an RQSC table is present. The RQSC table is optional; AE_NOT_FOUND is silenced since many systems will not have QoS controllers. Other ACPI failures are reported as errors. Link: https://github.com/riscv-non-isa/riscv-cbqri/releases/tag/v1.0 Link: https://github.com/riscv-non-isa/riscv-rqsc/blob/main/src/ Signed-off-by: Drew Fustini <fustini@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 1: "[RFC,v3,01/11] dt-bindings: riscv: Add Ssqosid extension description" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 2: "[RFC,v3,02/11] RISC-V: Detect the Ssqosid extension" |
|
Patch 9: "[RFC,v3,09/11] DO NOT MERGE: include: acpi: actbl2: Add structs for RQSC table" |
|
Patch 9: "[RFC,v3,09/11] DO NOT MERGE: include: acpi: actbl2: Add structs for RQSC table" |
|
Patch 9: "[RFC,v3,09/11] DO NOT MERGE: include: acpi: actbl2: Add structs for RQSC table" |
|
Patch 9: "[RFC,v3,09/11] DO NOT MERGE: include: acpi: actbl2: Add structs for RQSC table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 10: "[RFC,v3,10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
|
Patch 11: "[RFC,v3,11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC)" |
PR for series 1081333 applied to workflow__riscv__fixes
Name: RISC-V: QoS: add CBQRI resctrl interface
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1081333
Version: 3