From nobody Sat Feb 7 07:11:55 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8B6E374187; Wed, 28 Jan 2026 20:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769632086; cv=none; b=MR+Nh60g5xb8OF/6ebpq7yDidT+PwZYRJ/w4RbnKHyHNbLBykA3hql3CYZCvyXB/0LlglqWUaMg7XCHsNP2ohje8HGGz4IE00g0NlAHT2bPaJz8YpAZm5ayMoDYcE5N1nn9n+fz1vax8XLwpOtHzXGJhOhEOcVMDRvMrwDujK3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769632086; c=relaxed/simple; bh=nRtrIHSuWEDHEeDXLCrpmYAAH9Hp3uZpgjylkcnSlpU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BKTmyosd/Qs4ufVM8wkqKO6Tybn7UR3LcPs73ytZs0/eqh8poVKssG5hSexYt77vINm+HVShEgyTCsHJafjWMf7BrNsOtQksJJmUDckzsP81DQOp/YvA9OJ93hNenS1KCcf9ZJoJuR5+7iOo8/d80BqLjevTSYejzTx+oV1TuRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QyoMgQ1P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QyoMgQ1P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B31DC2BCAF; Wed, 28 Jan 2026 20:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769632086; bh=nRtrIHSuWEDHEeDXLCrpmYAAH9Hp3uZpgjylkcnSlpU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QyoMgQ1PlpsL25i4MmYfj4pTfftDnw7v3FsxFrm0jEker86I3vX4LLM3Vfp5/3oX2 0CNeldeXnjcgDuhembANRxNc0zAi7xPH2f7N0zKk9Ql/qiff+RbvLIyJspncWrBJO6 gSg1zmnP5UtM7ZF2EVg5Bw3fmIeQZZSpqWOcst/dkdR32o/2GF72e7Z3VR6xOjowhI X4SNGkZm/4G4g0pf9+V7X0VNFnul2tCcpiK7MwzdyfGDpNYwnSNAle1sxZ3UL/qCGJ MPtURsWZmNvZY7R0JKskU0HYVIUF+LxDzIU+i3GXfI39kDlCd0Ue6jqQ5jtJxFC9YJ gFTNMoLDM+uyA== From: Drew Fustini Date: Wed, 28 Jan 2026 12:27:27 -0800 Subject: [PATCH RFC v2 06/17] RISC-V: QoS: define CBQRI resctrl resources and domains Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260128-ssqosid-cbqri-v2-6-dca586b091b9@kernel.org> References: <20260128-ssqosid-cbqri-v2-0-dca586b091b9@kernel.org> In-Reply-To: <20260128-ssqosid-cbqri-v2-0-dca586b091b9@kernel.org> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?utf-8?q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , Samuel Holland , Adrien Ricciardi , Nicolas Pitre , =?utf-8?q?Kornel_Dul=C4=99ba?= , Atish Patra , Atish Kumar Patra , Vasudevan Srinivasan , Ved Shanbhogue , yunhui cui , Chen Pei , Liu Zhiwei , Weiwei Li , guo.wenjia23@zte.com.cn, liu.qingtao2@zte.com.cn, Reinette Chatre , Tony Luck , Babu Moger , Peter Newman , Fenghua Yu , James Morse , Ben Horgan , Dave Martin , Drew Fustini , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, Rob Herring , "Rafael J. Wysocki" , Len Brown , Robert Moore , Sunil V L , Krzysztof Kozlowski , Conor Dooley Cc: Paul Walmsley , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, devicetree@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1671; i=fustini@kernel.org; h=from:subject:message-id; bh=nRtrIHSuWEDHEeDXLCrpmYAAH9Hp3uZpgjylkcnSlpU=; b=owGbwMvMwCV2+43O4ZsaG3kYT6slMWRWFQZcWOafc1mIUyQrfPft57MCLq6xf8c35WlDxxZ/h trtfz886ShlYRDjYpAVU2TZ9CHvwhKv0K8L5r/YBjOHlQlkCAMXpwBMZFsMw2+2eX9Mbvuknzs9 +9bmf3fmG1k9iFq368zirCNn7MIYrle0MTIszUg6Kj236ZH6fPNX17YwnmDmXZb4seOg0E0T+23 drwOZAA== X-Developer-Key: i=fustini@kernel.org; a=openpgp; fpr=1B6F948213EA489734F3997035D5CD577C1E6010 Define data structures to encapsulate the resctrl resource and domain structures. Co-developed-by: Adrien Ricciardi Signed-off-by: Adrien Ricciardi [fustini: rebased current upstream] Signed-off-by: Drew Fustini --- arch/riscv/kernel/qos/internal.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/riscv/kernel/qos/internal.h b/arch/riscv/kernel/qos/inter= nal.h index ff2c7eff50be..c0402dd06cfa 100644 --- a/arch/riscv/kernel/qos/internal.h +++ b/arch/riscv/kernel/qos/internal.h @@ -65,6 +65,11 @@ #define CBQRI_BC_ALLOC_CTL_OP_READ_LIMIT 2 #define CBQRI_BC_ALLOC_CTL_STATUS_SUCCESS 1 =20 +int qos_resctrl_setup(void); +void qos_resctrl_exit(void); +int qos_resctrl_online_cpu(unsigned int cpu); +int qos_resctrl_offline_cpu(unsigned int cpu); + /* Capacity Controller hardware capabilities */ struct riscv_cbqri_capacity_caps { u16 ncblks; /* number of capacity blocks */ @@ -125,4 +130,26 @@ struct cbqri_controller { bool mon_capable; }; =20 +struct cbqri_resctrl_res { + struct rdt_resource resctrl_res; + struct cbqri_controller controller; + u32 max_rcid; + u32 max_mcid; +}; + +struct cbqri_resctrl_dom { + struct rdt_domain_hdr resctrl_dom_hdr; + struct rdt_ctrl_domain resctrl_ctrl_dom; + struct rdt_mon_domain resctrl_mon_dom; + u64 cbm; + u64 rbwb; + u64 *ctrl_val; + struct cbqri_controller *hw_ctrl; +}; + +struct cbqri_config { + u64 cbm; /* capacity block mask */ + u64 rbwb; /* reserved bandwidth blocks */ +}; + #endif /* _ASM_RISCV_QOS_INTERNAL_H */ --=20 2.43.0