Message ID | 20230419111111.477118-7-dfustini@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp305327vqo; Wed, 19 Apr 2023 04:20:48 -0700 (PDT) X-Google-Smtp-Source: AKy350Yp+3Dssni2xOWNpLcUHMKSIDrb3PvqZKYOE6/ji7ymO+hthfxTtEbjdkXeZImZQAiFGhyt X-Received: by 2002:a05:6a20:12d2:b0:c6:c0c1:b1fe with SMTP id v18-20020a056a2012d200b000c6c0c1b1femr3483235pzg.57.1681903248407; Wed, 19 Apr 2023 04:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681903248; cv=none; d=google.com; s=arc-20160816; b=GVXcDBlLt/Mh446tVYvxu2lUF+U9vnQ1nO0U3bzSI0D0hsbPx4Cs4gB9q/NzsY1scc R7vfY3QsnAJxpl3zLwELCl/ZJXNOkbaJpZeOkUX4eKbZG5835sVthdzt9l/240cOtG4r aX0O2sztA+GNVB/oiTg48iY4Se8Hxt3xpawc2lo0r8+jdEC76ga7PYZVgf0f4cBlyvrU 0sZiCjZ6ng2Y/iugltHkL62kBX6bwzZLFfgTxlbDs+eotjoJwtrxc3YL7ZwTSQpjA6po 0rT0/Pq55/slFheApYwSoAg4U7UMD4DwWltFkOKQZHs7TilJfV1h8EpWfbcJOqlooh0a t9fw== 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=erF7h0FFrrflFOP1De39iTiQwqZxcNsKEc8OIQm5UJM=; b=xMvlCsMMKMccCkHPkL/X7dmELPp1KB7h3lDJhLbHOlTJ9cvcTqYogC3rTxt52pbTP/ fsF9weRDQMbckC+M3IvVV841w6iNlO5uW3S6eAyGEqJHzVOAi3ubzilY7rnwDu3ivZhS IGahAjA8IO99ZTw9zx0h5etpUK8ugSEvuo5+8jtf6Nr99fiMk9SiCvBRl3SyqCV3nB5V avn/szpKtWezAKV862z5i2tGoxXjW97xPoO9vA79bOcCTXJsKv6pA1Tda0OjLnLn+SR/ V19N8l1kogdj6K9+P2mPsw2v8SJ56/cfdxmtn6r2SK9+ZcZ/2t1xlKMrI8Fjv/Cwpx6f rFDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=wz3bVzEC; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a63f114000000b0051bb433f5bbsi7418039pgi.386.2023.04.19.04.20.35; Wed, 19 Apr 2023 04:20:48 -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=wz3bVzEC; 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 S232911AbjDSLLI (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Wed, 19 Apr 2023 07:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232879AbjDSLLC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Apr 2023 07:11:02 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26F9913C1D for <linux-kernel@vger.kernel.org>; Wed, 19 Apr 2023 04:10:21 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1a52667955dso35500485ad.1 for <linux-kernel@vger.kernel.org>; Wed, 19 Apr 2023 04:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1681902618; x=1684494618; 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=erF7h0FFrrflFOP1De39iTiQwqZxcNsKEc8OIQm5UJM=; b=wz3bVzECh81V9P/8eSWWBlXF/ppb7Eo6YzU8zyukUtrt3VzZ0IEpHBtlfje9DVEk8A WgQ43IxHuPg5JxpS+AeX0+JDT9BXNewP9GBxLEbdYftK7bLLCUGMUBxE7QFEhweo+hXs ikPvUAgfl+FTTZIHdjmvg1mvLBoejr44HJSj8MVhg6jkkNQb0V/xq7HvECgQM+xvxg07 /rhj2VeNHkSdv02dw84Cnm0BPWlGc4/tYeOszJHSqvjMvIJoOYvVzIpUznLiSKPl9ow8 IW5VIWbPwZJgWUbhYU2YozHm+nuM/R3jyKv8aDekyuNVAe3ivBaYboWEbeNyyV528ZgP kQ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681902618; x=1684494618; 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=erF7h0FFrrflFOP1De39iTiQwqZxcNsKEc8OIQm5UJM=; b=hEz3Xh1sAubvbIvBnJHJ2sehVaTW3JG5ykg9QGSJCAJ8vrrIpuZ1czzIfgahy42k8S Dm8MXeSSXploDw37Wc7HvfgV9Di7oPvruyP7bEIU0wlg1jR4ymuA2778hNmmBqX22Rf4 jIBYeIIDC1P+SHe+qhF5NTWa/jNE6Pv0socXyaxwhTfYVzNKAcjHf8IY1n51KCVYA/cp iRZ7QpLG349wS8ncIJ+X6oRLyst6UTCKsC6mNiyCT2XBLer/wwz7/iXiYNlLrtXMaYKH xAbSQkCO0FvAjvk8wAV2Xn/N1blK0ANjdD7jBnYpaQ04EejswALDDRFdMAgiCy4Y9OAg x1LA== X-Gm-Message-State: AAQBX9cgnGNRCO0p2LD4AvzrHGuMiwci2oy0cubkxhcUhpqbxjseRMO/ kkuB4pjA2RhWxrgoYDXbKojQKw== X-Received: by 2002:a17:903:41c2:b0:1a8:106c:4a1a with SMTP id u2-20020a17090341c200b001a8106c4a1amr3748412ple.1.1681902618470; Wed, 19 Apr 2023 04:10:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 04:10:17 -0700 (PDT) From: Drew Fustini <dfustini@baylibre.com> To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Conor Dooley <conor.dooley@microchip.com>, Ved Shanbhogue <ved@rivosinc.com>, =?utf-8?q?Kornel_Dul=C4=99ba?= <mindal@semihalf.com>, Adrien Ricciardi <aricciardi@baylibre.com>, Nicolas Pitre <npitre@baylibre.com>, Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Babu Moger <babu.moger@amd.com>, Peter Newman <peternewman@google.com>, x86@kernel.org, Rob Herring <robh+dt@kernel.org>, James Morse <james.morse@arm.com> Cc: Drew Fustini <dfustini@baylibre.com> Subject: [RFC PATCH 06/21] RISC-V: QoS: define CBQRI resctrl resources and domains Date: Wed, 19 Apr 2023 04:10:56 -0700 Message-Id: <20230419111111.477118-7-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763603381045035398?= X-GMAIL-MSGID: =?utf-8?q?1763603381045035398?= |
Series |
RISC-V: QoS: add CBQRI resctrl interface
|
|
Commit Message
Drew Fustini
April 19, 2023, 11:10 a.m. UTC
Define data structures to encapsulate the resctrl resource and domain structures. Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com> Signed-off-by: Drew Fustini <dfustini@baylibre.com> --- 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/internal.h index e07d7f92e206..a3ed98ce5dd6 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 +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 */ /* from qemu/include/hw/riscv/cbqri.h */ struct riscv_cbqri_capacity_caps { @@ -127,4 +132,26 @@ struct cbqri_controller { bool mon_capable; }; +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 resctrl_dom; + // NCBLKS is 16 bit which is 2^16 = 65536 + // If each bit is a block, then cc_block_mask could 1024 times 64 byte + 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 */