From patchwork Tue Jun 20 14:32:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Chauhan X-Patchwork-Id: 1797362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) 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=1k+m8rQ1; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=P+J3SV9j; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qlpy502k3z20ZY for ; Wed, 21 Jun 2023 00:32:43 +1000 (AEST) 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=FKP8iaR8hQWeUToRodwkMCelt2Lha5aK4sNle7abwHU=; b=1k+m8rQ13kSiR2 Kcog/neUSVJWzuXAqStdbfM15a8ZTWhBHyZ6rqeJeYnPhbU/Aid+YBlgKag1Bsrl4E5CP1zMCmMbg 4LwgqS/ITVxoin8TUIhYPTcto4dd/crSd9AQ217J5VXcmdd49jmUifZN2TN+YFhJ6GZeUXR+82cMm 3FSjdjFpRSiwebskUYxNYwlIumEU2v2eC6+eAG7JEs99J+p5n1HNPjHd7afgxZjPjQgYsHfcoBs6F Yeo6nomF4BqBJKZRS5li0WRwwTvFKlwnWM62hs/K8DpjAxG3wli6foPbiYzLk9R42YWHmWhm6ZKBL VHZEQHc9OmNM4VablC1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBcPB-00BXQv-1E; Tue, 20 Jun 2023 14:32:25 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBcP8-00BXQ4-0g for opensbi@lists.infradead.org; Tue, 20 Jun 2023 14:32:23 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-66a2a04de58so62986b3a.1 for ; Tue, 20 Jun 2023 07:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1687271541; x=1689863541; 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=73yASVMgqNYwixvXNBy9MCH9LXxGouGNdKjJUP03GdA=; b=P+J3SV9jjPbSyPXNin9YLak69FQeQAmOg6NVsHxuHQw5RqAxjlS6KdatbG6SSFJ/ou 5th4Aym6qO5Lyt/Zbb741rSLNtByJJYiXCgIPvcKUrMAjwmmRzB+FTFbpvvIqr44lT4f 74Dl9hK7RMkZAaZq+BoOzgjaoecC9+wiYJFuTZ0J6LNoMq9NSesCxY5bzpMkjvwvFJ7n ioxytSMYbmAfIUvaDk0FyLDWe7QcyGKHOQw7QlSOI1rMdoLDU+L95+YTrRTXtNgI0Hwf 1Ux52ij4e202ZiKe78HoV3YTkD+GiEMRto2KsdNgToqwNjKYTqNnT6B5YYQP/w1WkfZG ivrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687271541; x=1689863541; 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=73yASVMgqNYwixvXNBy9MCH9LXxGouGNdKjJUP03GdA=; b=E2fh/hPLAYO8fhBlXxq7CkGK915hiZKNeWR8KGl36nCgrOCio/HIXsmI7m8541fvpE 8/DtNT5hQF8HxFT7MPqsa/4EiDQxfoh+Bpo2fSCk35oK1CvJLM2IhQtepjS5Y4Ju30x3 HWTcptwQYULNml6+m4BGhhESF9xjMsC6Xa7TtvgvkD+FJOwGqaLxLbydfsqLLpM3870f Ii0YM1pEHOJKxnEfhsFBfcGS7fdMXP5lZGuR5Xl8cvFvLBIykQ3ZnT4+aFCnNcNBgQ+G JjHXzKim436LAmkMp3dwv2GzBwpm0OlWilAa3SdKXHvI45m7aqHZeXdbNnDnpQ6zF/gg YHKg== X-Gm-Message-State: AC+VfDxuQDTeRVcD52HNr/6MUeBE0pU6YyyAX6lgrhnyklDdBG+GWwi1 gmPdJ9GwXz930AYwRxHbUizcrSZI72XijPybVmM= X-Google-Smtp-Source: ACHHUZ70Y0XFAGDnvO7ESZF57L1LT0mjyksyexMLwQC8ewzLCHssK8NfZy56i05BjR58F2JKp4nwBA== X-Received: by 2002:a05:6a00:1d95:b0:666:efc7:2463 with SMTP id z21-20020a056a001d9500b00666efc72463mr11111590pfw.2.1687271541274; Tue, 20 Jun 2023 07:32:21 -0700 (PDT) Received: from saptrishi.dc1.ventanamicro.com ([2409:40f2:100b:244b:e36c:3899:a3b9:b8a2]) by smtp.gmail.com with ESMTPSA id p18-20020a62ab12000000b0063afb08afeesm1420002pff.67.2023.06.20.07.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 07:32:20 -0700 (PDT) From: Himanshu Chauhan To: opensbi@lists.infradead.org Cc: Himanshu Chauhan Subject: [PATCH 1/6] include: sbi: Add macro definitions for mseccfg CSR Date: Tue, 20 Jun 2023 20:02:07 +0530 Message-Id: <20230620143212.2701598-2-hchauhan@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620143212.2701598-1-hchauhan@ventanamicro.com> References: <20230620143212.2701598-1-hchauhan@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230620_073222_250508_6C4F08EB X-CRM114-Status: UNSURE ( 7.69 ) 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 macros for Machine Security Configuration (mseccfg) CSR - Add macros to access/manipulate bits in msecfg CSR Signed-off-by: Himanshu Chauhan --- include/sbi/riscv_encoding.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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:431 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 Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org - Add macros for Machine Security Configuration (mseccfg) CSR - Add macros to access/manipulate bits in msecfg CSR Signed-off-by: Himanshu Chauhan Reviewed-by: Anup Patel --- include/sbi/riscv_encoding.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h index 4ebed97..50071ad 100644 --- a/include/sbi/riscv_encoding.h +++ b/include/sbi/riscv_encoding.h @@ -663,6 +663,18 @@ #define CSR_MHPMEVENT30H 0x73e #define CSR_MHPMEVENT31H 0x73f +/* Machine Security Configuration CSR (mseccfg) */ +#define CSR_MSECCFG_LOWER 0x747 +#define CSR_MSECCFG_UPPER 0x757 +#define CSR_MSECCFG (CSR_MSECCFG_LOWER) + +#define MSECCFG_MML_SHIFT (0) +#define MSECCFG_MML (_UL(1) << MSECCFG_MML_SHIFT) +#define MSECCFG_MMWP_SHIFT (1) +#define MSECCFG_MMWP (_UL(1) << MSECCFG_MMWP_SHIFT) +#define MSECCFG_RLB_SHIFT (2) +#define MSECCFG_RLB (_UL(1) << MSECCFG_RLB_SHIFT) + /* Counter Overflow CSR */ #define CSR_SCOUNTOVF 0xda0