Message ID | 20240329-dev-maxh-lin-452-6-9-v1-4-1534f93b94a7@sifive.com |
---|---|
State | RFC |
Headers | show
Return-Path: <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> 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=ZNgQQ5oC; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=NfAxuojr; 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 4V5Znw65Zhz1yXw for <incoming@patchwork.ozlabs.org>; Fri, 29 Mar 2024 20:28:04 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VsPfH50Xlk+UD3N2BMNp1uqYQYZSDqPDZIq3L0IaKjQ=; b=ZNgQQ5oC1pXFpX ycXwf9/5NqwnJzM6p+RLnVaPxL8NCzuK/PLKiGVvshW0sL6fz2yBhA+ZfpCHh1Hgws2Hww24XS4+l /Dntm0emfgs4sFNA0TM+2EYMoA/mODWAO567J+uults1UFsT6JVLVjs4o2CGNlR4gTCY0753bmCog taC/OPlaf7qbCIc0v/EGaXYimqHUCxFZ4iaAE/ot0g2qI7X5zkJBBjPvJX45kYhsJbIfYjmqlFfP+ WTnQNzRBjyZsWZdRqsfUEg9E3H72DKRyhMKCgtK8muMqyscNgFvP/O92TU+ezcTH5pWRl/PnjtEih 4Sy2vvyKLgj0Ucv1+RPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rq8Wp-0000000HUXW-0uFq; Fri, 29 Mar 2024 09:28:03 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rq8Wi-0000000HUR5-38CX for kvm-riscv@lists.infradead.org; Fri, 29 Mar 2024 09:27:59 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6e88e4c8500so1500827b3a.2 for <kvm-riscv@lists.infradead.org>; Fri, 29 Mar 2024 02:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1711704475; x=1712309275; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AWJBCH09eu6e6/Y/jgxKzI6AZAa7BXYvEZEuKCZc7nk=; b=NfAxuojrPPQMkaNVyuAP2qLs+VQQvUr1YTA43pWJjtTZ/PMgizHJMPv9VyvNqhF/jk xi/ZQgp09f6vLyoyqceiQJrq4oawo9ln4pcHpZXhTPN9o7FO5D3Mn8p3aJo9boAw/jVd 5Iof47RrtO+OR7VAnkYF4fSMo6OBw7JQ/6+Qhziv6FWwuRWQ+zYAO0MDd5SPnJ3dPSSY KkpLlraFVQukWZr++06Ns3J7iAclVcyHW1pWskhW5yP2fcSn/HDRBPwM+oHboEOwUaD3 G3cAB5cUvzA2UPx9B0/GLpAIerQ83gsoepdce6/h1KmQyqzb/2RRmygWJPS1RFvyzGSb CKfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711704475; x=1712309275; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWJBCH09eu6e6/Y/jgxKzI6AZAa7BXYvEZEuKCZc7nk=; b=Qm+IZ+ZMVIW3/OZrOh/QQaL1zLGOMmex4szJUH3PIUrmbd0DPi+VkuB46ygonaSEox o6VvJhyK05ytZoCjNUoQPA1SKxFRq1Do9Vpd1kQT/kWnFaQqcSKwDI/W4gMcVyNZJfbH thDpa79OUxuWGfJ/kTuLm312xAN6RYY0OyKNg2qdMCJjbKTOq9HSn3QcmRcilgLSQfZX zQeGfO9+Tnaqe6jdRjyepBMfmw4tlI33r0jyfLjDuaUDkNCvqexUcEa7nEL+L1hXS3+G Ah3LNThE3kaJl1U5zwVWYPhvhaPXF2DTO722ZF+Qkx8j1qQuyUjhQmdmeZr0KZrPUxHg wZDg== X-Forwarded-Encrypted: i=1; AJvYcCXTCjtydYBljiOfX1zBcV5S1Rp2AmWuXLxtgnqzz49aOWQLW1u4bHYBN1JLMkDhj7FLQt1vQXfoPRcfYb55tsfTRD8MRNxW7FJuedAfCg== X-Gm-Message-State: AOJu0Yw6r6rpvzzJ3YPdbmtr/0KnBEFb+07tk8JqIq0yIe7bs8nZ84gW xZu+h3TLjUJWEhgxsdj0nS1IJVoe6CqIHwcU2pWhF9imcF8UJAvDNyryuwwJDD0= X-Google-Smtp-Source: AGHT+IHveAaHJ+i93XoWQQhAxL1npi1lTK697/I+K/Ux4G4x9neoQ8w5TBypEt7P1DanmINkW4zEcQ== X-Received: by 2002:a05:6a21:3986:b0:1a3:af50:18bd with SMTP id ad6-20020a056a21398600b001a3af5018bdmr1630725pzc.28.1711704474638; Fri, 29 Mar 2024 02:27:54 -0700 (PDT) Received: from [127.0.1.1] (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id cv17-20020a17090afd1100b002a02f8d350fsm2628830pjb.53.2024.03.29.02.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 02:27:54 -0700 (PDT) From: Max Hsu <max.hsu@sifive.com> Date: Fri, 29 Mar 2024 17:26:20 +0800 Subject: [PATCH RFC 04/11] riscv: Add Sdtrig CSRs definition, Smstateen bit to access Sdtrig CSRs MIME-Version: 1.0 Message-Id: <20240329-dev-maxh-lin-452-6-9-v1-4-1534f93b94a7@sifive.com> References: <20240329-dev-maxh-lin-452-6-9-v1-0-1534f93b94a7@sifive.com> In-Reply-To: <20240329-dev-maxh-lin-452-6-9-v1-0-1534f93b94a7@sifive.com> To: Conor Dooley <conor@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, "Rafael J. Wysocki" <rafael@kernel.org>, Pavel Machek <pavel@ucw.cz>, Anup Patel <anup@brainfault.org>, Atish Patra <atishp@atishpatra.org>, Paolo Bonzini <pbonzini@redhat.com>, Shuah Khan <shuah@kernel.org> Cc: Palmer Dabbelt <palmer@sifive.com>, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, Max Hsu <max.hsu@sifive.com> X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240329_022757_159033_A988E79D X-CRM114-Status: UNSURE ( 7.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.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: Add hcontext/scontext CSRs definition to csr.h As riscv-state-enable [1] Smstateen extension spec: Sdtrig CSRs: hcontext/scontext availability are controlled by bit 57 of Smstateen CSRs. Link: https://github.com/riscvarchive/riscv-state-enable/releases/download/v1.0.0/Smstateen.pdf [1] Signed-off-by: Max Hsu <max.hsu@sifive.com> --- arch/riscv/include/asm/csr.h | 6 ++++++ 1 file chang [...] Content analysis details: (-0.2 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:433 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_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <kvm-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/kvm-riscv/> List-Post: <mailto:kvm-riscv@lists.infradead.org> List-Help: <mailto:kvm-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" <kvm-riscv-bounces@lists.infradead.org> Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
riscv: support Sdtrig extension hcontext/scontext CSRs
|
expand
|
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 2468c55933cd..308ae795dc82 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -204,6 +204,8 @@ #define ENVCFG_FIOM _AC(0x1, UL) /* Smstateen bits */ +#define SMSTATEEN0_HSCONTEXT_SHIFT 57 +#define SMSTATEEN0_HSCONTEXT (_ULL(1) << SMSTATEEN0_HSCONTEXT_SHIFT) #define SMSTATEEN0_AIA_IMSIC_SHIFT 58 #define SMSTATEEN0_AIA_IMSIC (_ULL(1) << SMSTATEEN0_AIA_IMSIC_SHIFT) #define SMSTATEEN0_AIA_SHIFT 59 @@ -480,6 +482,10 @@ #define IE_TIE (_AC(0x1, UL) << RV_IRQ_TIMER) #define IE_EIE (_AC(0x1, UL) << RV_IRQ_EXT) +/* riscv-debug-spec: Sdtrig extension */ +#define CSR_SCONTEXT 0x5a8 +#define CSR_HCONTEXT 0x6a8 + #ifndef __ASSEMBLY__ #define csr_swap(csr, val) \
Add hcontext/scontext CSRs definition to csr.h As riscv-state-enable [1] Smstateen extension spec: Sdtrig CSRs: hcontext/scontext availability are controlled by bit 57 of Smstateen CSRs. Link: https://github.com/riscvarchive/riscv-state-enable/releases/download/v1.0.0/Smstateen.pdf [1] Signed-off-by: Max Hsu <max.hsu@sifive.com> --- arch/riscv/include/asm/csr.h | 6 ++++++ 1 file changed, 6 insertions(+)