lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260128-ssqosid-cbqri-v2-10-dca586b091b9@kernel.org>
Date: Wed, 28 Jan 2026 12:27:31 -0800
From: Drew Fustini <fustini@...nel.org>
To: Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>, 
 Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>, 
 Radim Krčmář <rkrcmar@...tanamicro.com>, 
 Samuel Holland <samuel.holland@...ive.com>, 
 Adrien Ricciardi <aricciardi@...libre.com>, 
 Nicolas Pitre <npitre@...libre.com>, 
 Kornel Dulęba <mindal@...ihalf.com>, 
 Atish Patra <atish.patra@...ux.dev>, 
 Atish Kumar Patra <atishp@...osinc.com>, 
 Vasudevan Srinivasan <vasu@...osinc.com>, Ved Shanbhogue <ved@...osinc.com>, 
 yunhui cui <cuiyunhui@...edance.com>, Chen Pei <cp0613@...ux.alibaba.com>, 
 Liu Zhiwei <zhiwei_liu@...ux.alibaba.com>, Weiwei Li <liwei1518@...il.com>, 
 guo.wenjia23@....com.cn, liu.qingtao2@....com.cn, 
 Reinette Chatre <reinette.chatre@...el.com>, 
 Tony Luck <tony.luck@...el.com>, Babu Moger <babu.moger@....com>, 
 Peter Newman <peternewman@...gle.com>, Fenghua Yu <fenghua.yu@...el.com>, 
 James Morse <james.morse@....com>, Ben Horgan <ben.horgan@....com>, 
 Dave Martin <Dave.Martin@....com>, Drew Fustini <fustini@...nel.org>, 
 linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org, 
 x86@...nel.org, Rob Herring <robh@...nel.org>, 
 "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, 
 Robert Moore <robert.moore@...el.com>, Sunil V L <sunilvl@...tanamicro.com>, 
 Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>
Cc: Paul Walmsley <paul.walmsley@...ive.com>, linux-acpi@...r.kernel.org, 
 acpica-devel@...ts.linux.dev, devicetree@...r.kernel.org
Subject: [PATCH RFC v2 10/17] RISC-V: QoS: add late_initcall to setup
 resctrl interface

Add late_initcall which checks if the Ssqosid extension is present, and
if so, calls resctrl setup and sets cpu hotplug state to "qos:online".

Co-developed-by: Adrien Ricciardi <aricciardi@...libre.com>
Signed-off-by: Adrien Ricciardi <aricciardi@...libre.com>
Signed-off-by: Drew Fustini <fustini@...nel.org>
---
 arch/riscv/kernel/qos/qos.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/riscv/kernel/qos/qos.c b/arch/riscv/kernel/qos/qos.c
index 7b06f7ae9056..2cd5d7be1d10 100644
--- a/arch/riscv/kernel/qos/qos.c
+++ b/arch/riscv/kernel/qos/qos.c
@@ -1,5 +1,32 @@
 // SPDX-License-Identifier: GPL-2.0-only
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/cpu.h>
+#include <linux/cpumask.h>
+#include <linux/riscv_qos.h>
+
+#include <asm/csr.h>
 #include <asm/qos.h>
 
+#include "internal.h"
+
 /* cached value of sqoscfg csr for each cpu */
 DEFINE_PER_CPU(u32, cpu_srmcfg);
+
+static int __init qos_arch_late_init(void)
+{
+	int err;
+
+	if (!riscv_isa_extension_available(NULL, SSQOSID))
+		return -ENODEV;
+
+	err = qos_resctrl_setup();
+	if (err != 0)
+		return err;
+
+	cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "qos:online", qos_resctrl_online_cpu,
+			  qos_resctrl_offline_cpu);
+
+	return err;
+}
+late_initcall(qos_arch_late_init);

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ