From patchwork Sat Feb 17 00:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Kumar Patra X-Patchwork-Id: 1900378 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=CTyn48eQ; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=I5OGKjLc; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=05DpMZXY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tc9RC35txz23j8 for ; Sat, 17 Feb 2024 11:58:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KXfAkN/RG/CRaTEmfSY5UF0qKn6vIXrpPJwRQJnkwQk=; b=CTyn48eQJGPx05 8u/NMjf0E6bfDpEXhV/D+tIH/Tni+gTqQk36WtwQ2IUK9bBz1RNR3ewdLw6lAWjzUllk5Vhc1/BW4 OCU0J475t8WL+vdg6Jn8NGlipPlmIXzIsFB3fs+i4ePDKDyXsCbmAKpZ26CPxtwFrfudoEUVtiNTw vzkLbyJwC9FqkW0zOHc6tcZRq2QXCaFAWa6Wk1p2H/0SYnp6UqzRtKCgvAyRqUYbbzU1Fxxjsxah4 v+96g6a3haGyH0OOoqo9iC7phDg8ZKt/v4eiCnro9fl/3TsKepBSFNTWWKytzQdsCKjiLM23tuZgC 2Qb/ntDJMuDsfV5wFmHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rb92T-00000004IIi-2gbB; Sat, 17 Feb 2024 00:58:45 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rb92I-00000004I74-39vr for kvm-riscv@bombadil.infradead.org; Sat, 17 Feb 2024 00:58:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=aQNMm6dQ5GKoaAsA3+Ylkhz7wa/7Q2Lc0P2/ZDz1Yac=; b=I5OGKjLc58wMFQIKJa8Y5jeO79 59tnnMftsIFG66YffiSmGukhWjN+wnjh79fqR3Mf5AmWAzVVqvzov0XwE7ZAjeTglFlRzQQvSU+c5 vEkV/uN6w56iOMiogm8pwF/hblQibELo0nrVwnSdoRxFvJVYSNUvKtxq6u3cqieEw9P7YZg5fZSsq WenAei3icBFMxqU/o6o6QBbfovyFKrgVpqcW6HfOc2tcYVzwiIxZOLR1yaCxdb89yoiHP+EBsMeOq ELmBofKt3tSFqTAxVrQi3sN94UoZlczJEtC5y6Ua6Gllh3uerQPv/ShqTUL2S1G7lVr3nCq1Zxoxw qAo6QHFw==; Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rb926-000000007H5-2tqF for kvm-riscv@lists.infradead.org; Sat, 17 Feb 2024 00:58:28 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6e11a779334so1714663b3a.0 for ; Fri, 16 Feb 2024 16:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1708131499; x=1708736299; darn=lists.infradead.org; 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=aQNMm6dQ5GKoaAsA3+Ylkhz7wa/7Q2Lc0P2/ZDz1Yac=; b=05DpMZXYxwex0tvTfd/IInF87FyE3QDfwYni1ypaCnSGSwhSJcyip1mbHWiTT2qFdc ztSY2qJfWP0geENmsDrRgq8DOBDmNzW4CRv9rIMJ70wcILFPZcBAiJU/VsVfrgkavzZZ w1yqAqveNOmtCQHFxpUnvjunFE+6Dm3Y9xaHOGCcy8SFI+79HlMvt6+Xjhp9MCpH5giE HzIuj5d0KwLEZd2Xnr+YAq9wHNWnj9q1SMnZQHLBeXBPwFUtKLknmvA3LzGg0Fn/Lb4H nOXX9sgQs3kG636FesJE/DeM7sH+Tlbywdu8QjstbJE8xLmfcQpdDyJnfJzUzNHK0oTg bPvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708131499; x=1708736299; 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=aQNMm6dQ5GKoaAsA3+Ylkhz7wa/7Q2Lc0P2/ZDz1Yac=; b=Caj+RwH69IQdKnpiiaxfoqY5AEKwVNJnwyDDLGpJJa7YuDrn77VNPIrqTC49u/sIQP DfqVAhEfczPm/pbzHkHRGk/ulGnq7WUDp6jP6zwLny0u2L9FWtuIL1OPoK/h7LeclzjC UL+l9elp65w8mp7Xh9/3mEJGqYCFKr0QlNfmeMg8OXqjtoHqG2RxQj/KGc80WxI6dvV2 PIsp2BM81aJFtg6ouM6sQnfWoEeFwmtfj7HH8a6bmCPJ5k7FJaGFJpYddYn6JW69NqUJ /aSop05dswC0tLVlMIPTb6R8bYvYn+kzDtGXJJsaUMj2pivghKtod+sGODlKvrfd2PpD QjUg== X-Forwarded-Encrypted: i=1; AJvYcCWdeZZmTqHpYC1nYp+jWJxu0v5mcjvxV1tCMcr9BPQ1vCvnNlxP1NbBiwYJmmNYDY0RafSUlPGdmH4vtw6DFyuyCLctnO8qvZncWwuhRQ== X-Gm-Message-State: AOJu0YyVhnWJoVvBUJ7oi40hceIgQbXOSMdTM+cgWYWhwUJ8UeABlcmD NcSar1zbUEsNKm9mkj8tU8t3nveJwmo5akAEUhcFY9bDaEiJte43fpLe+/GCq+g= X-Google-Smtp-Source: AGHT+IHBAccR7wewW50qDb/5Fg2zOt9vMTs18qGTYlJw9BsFoZL8lyrT4M/cgU7xwOtlRTzAVrdVuQ== X-Received: by 2002:a05:6a00:2451:b0:6e0:50cb:5f0a with SMTP id d17-20020a056a00245100b006e050cb5f0amr13240534pfj.12.1708131499011; Fri, 16 Feb 2024 16:58:19 -0800 (PST) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d188-20020a6336c5000000b005dc89957e06sm487655pga.71.2024.02.16.16.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:58:18 -0800 (PST) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Adrian Hunter , Alexander Shishkin , Alexandre Ghiti , Andrew Jones , Anup Patel , Arnaldo Carvalho de Melo , Atish Patra , Christian Brauner , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Conor Dooley , devicetree@vger.kernel.org, Evan Green , Guo Ren , Heiko Stuebner , Ian Rogers , Ingo Molnar , James Clark , Jing Zhang , Jiri Olsa , Ji Sheng Teoh , John Garry , Jonathan Corbet , Kan Liang , Krzysztof Kozlowski , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, Ley Foon Tan , linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Namhyung Kim , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rob Herring , Samuel Holland , Weilin Wang , Will Deacon , kaiwenxue1@gmail.com, Yang Jihong Subject: [PATCH RFC 02/20] RISC-V: Add Sxcsrind ISA extension CSR definitions Date: Fri, 16 Feb 2024 16:57:20 -0800 Message-Id: <20240217005738.3744121-3-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240217005738.3744121-1-atishp@rivosinc.com> References: <20240217005738.3744121-1-atishp@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240217_005823_356930_15BF7F6D X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Kaiwen Xue This adds definitions of new CSRs and bits defined in Sxcsrind ISA extension. These CSR enables indirect accesses mechanism to access any CSRs in M-, S-, and VS-mode. The range of the select values an [...] Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Kaiwen Xue This adds definitions of new CSRs and bits defined in Sxcsrind ISA extension. These CSR enables indirect accesses mechanism to access any CSRs in M-, S-, and VS-mode. The range of the select values and ireg will be define by the ISA extension using Sxcsrind extension. Signed-off-by: Kaiwen Xue Signed-off-by: Atish Patra --- arch/riscv/include/asm/csr.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 510014051f5d..0a54856fd807 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -302,6 +302,12 @@ /* Supervisor-Level Window to Indirectly Accessed Registers (AIA) */ #define CSR_SISELECT 0x150 #define CSR_SIREG 0x151 +/* Supervisor-Level Window to Indirectly Accessed Registers (Sxcsrind) */ +#define CSR_SIREG2 0x152 +#define CSR_SIREG3 0x153 +#define CSR_SIREG4 0x155 +#define CSR_SIREG5 0x156 +#define CSR_SIREG6 0x157 /* Supervisor-Level Interrupts (AIA) */ #define CSR_STOPEI 0x15c @@ -349,6 +355,14 @@ /* VS-Level Window to Indirectly Accessed Registers (H-extension with AIA) */ #define CSR_VSISELECT 0x250 #define CSR_VSIREG 0x251 +/* + * VS-Level Window to Indirectly Accessed Registers (H-extension with Sxcsrind) + */ +#define CSR_VSIREG2 0x252 +#define CSR_VSIREG3 0x253 +#define CSR_VSIREG4 0x255 +#define CSR_VSIREG5 0x256 +#define CSR_VISREG6 0x257 /* VS-Level Interrupts (H-extension with AIA) */ #define CSR_VSTOPEI 0x25c @@ -389,6 +403,12 @@ /* Machine-Level Window to Indirectly Accessed Registers (AIA) */ #define CSR_MISELECT 0x350 #define CSR_MIREG 0x351 +/* Machine-Level Window to Indrecitly Accessed Registers (Sxcsrind) */ +#define CSR_MIREG2 0x352 +#define CSR_MIREG3 0x353 +#define CSR_MIREG4 0x355 +#define CSR_MIREG5 0x356 +#define CSR_MIREG6 0x357 /* Machine-Level Interrupts (AIA) */ #define CSR_MTOPEI 0x35c