Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp106630rwr; Wed, 19 Apr 2023 04:12:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZFuhWKGcQP2MMRnmLlfib0KabUfIjtMAZp5Mn9hJ/OD2IcuCHC1NJkMlps5pFySRDTb6Rt X-Received: by 2002:a05:6a00:b50:b0:63d:4920:c101 with SMTP id p16-20020a056a000b5000b0063d4920c101mr2766356pfo.30.1681902760256; Wed, 19 Apr 2023 04:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681902760; cv=none; d=google.com; s=arc-20160816; b=HaID4wZCowEVq3Kn6MpRcIgg4b/pzBha3tteEDr+o5vhSVpWk3+g12Y+Z3pQk4oFCB xqFfkgP4+Rt51pPTbO6Lh6LgFdlWMwZBhncX9nqdYpMh13V5en/PZqsWLBQFKTXubFhd 2CILYoFEIIpAe/DoGqoD0z0korJ1Zqn/P7YpkCCyBooGm/b1L8L/82X/VZYFgtIKeRkN PhUvUnN9czdCHFjtu9K2J1MDu0CftLpGRxtdT2inR7ManpHqZLUzL3mRfzwkOw8UXJyP yuLwbAQEIpYwWdDPahZbwemHMbr972OOt0zY4YnLX/Nsnx4k//fTA/uuB/2F+5pwllKG +APg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Eblfm/T6iTpx+B5jQxcafLiaSwdeB6MwJNMx1053fIM=; b=Hk2BjXy9DpgsbTBTA4KAKUqOK9lTxpomnIETv2qQQdq1hLTdRIfOMwTamo5N+CryCH 2xZM5OrancFcGMZMdp07GQOyZDHYLelu2BEpgAOpZCbOq/Mr7IOn+a9W+SnnM0vB52EC DviVU3ZeLXqtNkrwdzAlwDRVetE45Es3r38tksQ4b8kmea4YsOS+At1yQ5h4sQMSAr6q 0CaC+tejNUvuhAZl2t1T/hOrtmKEm6qAM4TJtTKlsXjmQTfRJYncmQeWjVOmkTfhtBHw AFZuvpCWfYffWxFfqdgbX8/T1bofbwrV7WQDbGxbEWaN8dhpoYdBtn0zB6PoXg+rUcNE iw4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=DeZfx01Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b189-20020a621bc6000000b0063b8eb340b1si7663240pfb.274.2023.04.19.04.12.28; Wed, 19 Apr 2023 04:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=DeZfx01Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232967AbjDSLLZ (ORCPT + 99 others); Wed, 19 Apr 2023 07:11:25 -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-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: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = 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.34.1