From nobody Tue Dec 16 16:39:05 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0B2DC77B73 for ; Wed, 19 Apr 2023 11:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbjDSLL0 (ORCPT ); Wed, 19 Apr 2023 07:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232879AbjDSLLK (ORCPT ); Wed, 19 Apr 2023 07:11:10 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A45A13F9C for ; Wed, 19 Apr 2023 04:10:29 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1a80d827179so10132295ad.3 for ; Wed, 19 Apr 2023 04:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1681902623; x=1684494623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Eblfm/T6iTpx+B5jQxcafLiaSwdeB6MwJNMx1053fIM=; b=DeZfx01ZX7Sehx3CCekOj5Wmh5/0E6L27Vt1u0RCG6Af7W4Ww6d99E98VCdUMc5ILQ ppeTAQ4ynNy3TiNv6XuWSxIGB7HqcDqzwIX1tzEXE/xJHgae/7yiQ786zEhoR6k3gOvX L8RXwIuD/Bcpb+fx+/tEgYMPtOMn/5RGiZHZQSsVTwbwnESwjJZgQKjJgS+CYdiWmv/X sTlTz+tcJxIHBX9j344JEvQHen6NftYor8JECB66GT3RicUQttnGHRgNi5k9OBP15w4r +bm2YkMfwA9+FPgWxfcfMf6baW+J4rq9LuYDUDbRWAWXCt8WxTxt6hmZHGKv+vMZxzEt z6Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681902623; x=1684494623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Eblfm/T6iTpx+B5jQxcafLiaSwdeB6MwJNMx1053fIM=; b=XdFMMr2YsKNNzYQHqbxeYASfGeAwxhvJn9goi5e8jGYw/uRvUJ07CtBryCh1wKnU6z 7NrwQf/dr3XkkV8M1n9LNU2aBWdgz6VXi5W+YH9DGv7LdTYmRvwCx/7AWthR8SyF7vLq vtS7AhrP2OcJCf73HLak15pV7FAA/TdnpCg+/+1V04sTrOQ41IHvQ55WLh/wG2uoFHq5 ctDsN/UwfM1Ddygs9BX/P88ziy4Gwua5X6E0AE0vYI0SLWO+VPANnwUtoVE8XSQ1ryio ysVIBWLIubW7CZS/rOu6JuYB3frAm8fG/DzaQnvDJaeXVjl8/csObE+g8SvXQfUdXe51 1L9g== X-Gm-Message-State: AAQBX9dss5o5dCndAvwPBhTKEqKj46AImUER6KGjlqOVEPAinSqM94kE hEUlLQdoDWwP8b0/oapC+Ib8Zo4PQd+ASze/z5Y= X-Google-Smtp-Source: AKy350bJa8ymH8vz3WwMTgd0nDwI9tA5BpeE2IV7rV3XHn6aSE8c09ru5XOxb+Nqph2c5N8uPATfhA== X-Received: by 2002:a17:902:ab81:b0:1a6:4e7b:7037 with SMTP id f1-20020a170902ab8100b001a64e7b7037mr4418984plr.69.1681902623318; Wed, 19 Apr 2023 04:10:23 -0700 (PDT) Received: from x1.hsd1.or.comcast.net ([2601:1c2:1800:f680:eaf2:1d7a:7338:16cb]) by smtp.gmail.com with ESMTPSA id g12-20020a1709026b4c00b001a24cded097sm11180774plt.236.2023.04.19.04.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 04:10:22 -0700 (PDT) From: Drew Fustini To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Conor Dooley , Ved Shanbhogue , =?UTF-8?q?Kornel=20Dul=C4=99ba?= , Adrien Ricciardi , Nicolas Pitre , Fenghua Yu , Reinette Chatre , Babu Moger , Peter Newman , x86@kernel.org, Rob Herring , James Morse Cc: Drew Fustini Subject: [RFC PATCH 09/21] RISC-V: QoS: add late_initcall to setup resctrl interface Date: Wed, 19 Apr 2023 04:10:59 -0700 Message-Id: <20230419111111.477118-10-dfustini@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419111111.477118-1-dfustini@baylibre.com> References: <20230419111111.477118-1-dfustini@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Adrien Ricciardi Signed-off-by: Drew Fustini --- arch/riscv/kernel/qos/qos.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 arch/riscv/kernel/qos/qos.c diff --git a/arch/riscv/kernel/qos/qos.c b/arch/riscv/kernel/qos/qos.c new file mode 100644 index 000000000000..0b5fde06cbe1 --- /dev/null +++ b/arch/riscv/kernel/qos/qos.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2023 Rivos Inc. + +#include +#include +#include +#include +#include + +#include +#include + +#include "internal.h" + +static int __init qos_arch_late_init(void) +{ + int err; + + if (!riscv_isa_extension_available(NULL, SSQOSID)) + return -ENODEV; + + err =3D qos_resctrl_setup(); + if (err !=3D 0) + return err; + + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "qos:online", qos_resctrl_online_c= pu, + qos_resctrl_offline_cpu); + + return err; +} +late_initcall(qos_arch_late_init); --=20 2.34.1