From patchwork Mon Jan 9 05:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Chauhan X-Patchwork-Id: 1723146 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=L2AYu0ZO; 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=F3ReoUgD; 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 4Nr2Nt0qcSz23g7 for ; Mon, 9 Jan 2023 16:21:34 +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: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:In-Reply-To:References: List-Owner; bh=HxXjt24YYbM02DZqV+5clkCFMWycy4dkkBeC1K3Ptss=; b=L2AYu0ZOI1Xxh8 xhtDBW0J4RlCnkpeXLAgHDvPkj+sJ698qlQNZ/Pt7f05edCNHtHQT1NscGovh+d4XML9QdYRI/y6A xjotZaP+yYwrBv32wgcCrST7fF1nQ7MYcPk81u9y3OmAh5+/J6g3qls8WBCMh+65wLf9HK38X8cQt CBaNxCFaMqG9IMIw7oszX7ri5Nx+ODV3cU+rkkM7LY+65OJl41/m497mkrxyuDfzIAuYqisz2snS9 IUgk/mK7FTgUuIO9UQMNHTwOI+h0T+fRCS7NjK+uhGrpiusq63UNloGY73l1YRm7tkz4rD6fgzb0P GKe4FhQLvRHECVRSjXsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkay-00HQet-VB; Mon, 09 Jan 2023 05:21:16 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEkaw-00HQeH-8N for opensbi@lists.infradead.org; Mon, 09 Jan 2023 05:21:15 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9so8323646pll.9 for ; Sun, 08 Jan 2023 21:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CG3VwuYCo78V1ymRFn3JLtCtEFBhaxPoJRH6ULAUJFg=; b=F3ReoUgDQTDJ5ASRrqFS2TkOFreZbS1VnOM3ljgxKvadCk/Y1Orc4A5Kpru200Wcj8 p5zl/hlEY2yuDkKWLRMvtD6yENs1kVfr/3E46H5LAQEjuJ+xjm+FcUEVq1ISqNec1RxD nRE4Sut+jcdsrfq0EoT+H/cKc/9yDTE7vBdg2kuAjEDY5iOuQrHPwFhQ4IF+Nh/TgbQZ CJ8dnlzzsQRejBVbA1ZLvp0N/VSm7iAuuKYzNjjPYztGzloMDADyoPkHPsjI7bwU72fw 45Q5lDMKtiqapIhVPxcMwjrPCiYo2K1IAsSiNy0X3DqakJBsuzKFz1+MhhN6h2Q/6T7n M4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CG3VwuYCo78V1ymRFn3JLtCtEFBhaxPoJRH6ULAUJFg=; b=ircFXaCa+yr9fc5F9+KFT6A6gQPsQ0YBocuEHl5u+Nbtf+D/BI9gRhrvayzql139ov gFSCtJa33OLy1B31edWsxR64kSS96brZAJT/ytiRMaKSFUABEvli+D6NHnwbyvOfntYe aYEWaZ0g2p4I4h+trGib8QXf1P3vg8PBysLhvfPKbUVkHDaUtqV4MZtunTHmEUkAXoC+ L9gufwzj92l0lkXnG/q1oqzH10F9Y9OxpI8yyLS5M62Jobgt1eDdolRi8TA69FoX9GKH wO2D3z/LyCC3RfgdCDLtzzb0Vg0NMEZ0StPXjbSuJ1ANFLfZcaACUr3fM+BkO5635Szd SQ6A== X-Gm-Message-State: AFqh2kqWdlb45Im/OD0cDTYc6ssOChcByerKvN3sBHdT+6DSJdEbLsOo OTEcxmCcByC/P6FnC+JJ6A1ot/fT0bQpZlsy X-Google-Smtp-Source: AMrXdXsKV92QqqHDPukyGgOCSklrTWh/QQhv5a/xzybJJasJePeeNLK8w/uz8W3CqK77RQHbwkod8g== X-Received: by 2002:a17:902:ce09:b0:189:f7c2:7245 with SMTP id k9-20020a170902ce0900b00189f7c27245mr74595571plg.45.1673241672494; Sun, 08 Jan 2023 21:21:12 -0800 (PST) Received: from localhost.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id e6-20020a17090301c600b00192dda430ddsm4992027plh.123.2023.01.08.21.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 21:21:12 -0800 (PST) From: Himanshu Chauhan To: opensbi@lists.infradead.org Cc: Himanshu Chauhan Subject: [PATCH v2 0/9] Split region permissions into M-mode and SU-mode Date: Mon, 9 Jan 2023 05:20:34 +0000 Message-Id: <20230109052043.55473-1-hchauhan@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230108_212114_316992_B1505766 X-CRM114-Status: UNSURE ( 9.48 ) 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: This is first series in the series of forthcoming patches that would add support for different access permission for different sections of OpenSBI (RO, RX, RW). Eventually, this would lead to support [...] 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:62d 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 This is first series in the series of forthcoming patches that would add support for different access permission for different sections of OpenSBI (RO, RX, RW). Eventually, this would lead to support of smepmp extension. This patch series splits the current R/W/X permissions to M-mode R/W/X and SU-mode R/W/X. The split is in such a way that current permission semantics are not broken Changes in v2: 1. Fixed the grammatical mistakes in the commit log. 2. Removed the white space new line from sbi_domain.h 3. Added enforce permission bit[6] details to documentation Himanshu Chauhan (9): include: sbi: Fine grain the permissions for M and SU modes lib: sbi: Use finer permission semantics for address validation lib: sbi: Add permissions for the firmware start till end lib: sbi: Use finer permission sematics to decide on PMP bits lib: sbi: Modify the boot time region flag prints lib: utils: Use SU-{R/W/X} flags for region permissions during parsing lib: utils: Disallow non-root domains from adding M-mode regions lib: utils: Add M-mode {R/W} flags to the MMIO regions docs: Update domain's region permissions and requirements docs/domain_support.md | 12 +++++++-- include/sbi/sbi_domain.h | 44 +++++++++++++++++++++++++++---- lib/sbi/sbi_domain.c | 46 +++++++++++++++++++++++---------- lib/sbi/sbi_hart.c | 16 ++++++++---- lib/utils/fdt/fdt_domain.c | 20 +++++++++++--- lib/utils/ipi/aclint_mswi.c | 4 ++- lib/utils/irqchip/aplic.c | 4 ++- lib/utils/irqchip/imsic.c | 4 ++- lib/utils/timer/aclint_mtimer.c | 16 +++++++++--- 9 files changed, 131 insertions(+), 35 deletions(-) Tested-by: Anup Patel